Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250114
b: refs/heads/master
c: ec0c8d5
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 72ab02a commit 8e05d83
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0df5417acf65cff05343b1fb83fb40344e155ea
refs/heads/master: ec0c8d555a93aa7e2c5c4f11f12686e5b2245696
50 changes: 50 additions & 0 deletions trunk/include/media/soc_camera_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,54 @@ struct soc_camera_platform_info {
int (*set_capture)(struct soc_camera_platform_info *info, int enable);
};

static inline void soc_camera_platform_release(struct platform_device **pdev)
{
*pdev = NULL;
}

static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
struct device *dev,
struct platform_device **pdev,
struct soc_camera_link *plink,
void (*release)(struct device *dev),
int id)
{
struct soc_camera_platform_info *info = plink->priv;
int ret;

if (icl != plink)
return -ENODEV;

if (*pdev)
return -EBUSY;

*pdev = platform_device_alloc("soc_camera_platform", id);
if (!*pdev)
return -ENOMEM;

info->dev = dev;

(*pdev)->dev.platform_data = info;
(*pdev)->dev.release = release;

ret = platform_device_add(*pdev);
if (ret < 0) {
platform_device_put(*pdev);
*pdev = NULL;
info->dev = NULL;
}

return ret;
}

static inline void soc_camera_platform_del(const struct soc_camera_link *icl,
struct platform_device *pdev,
const struct soc_camera_link *plink)
{
if (icl != plink || !pdev)
return;

platform_device_unregister(pdev);
}

#endif /* __SOC_CAMERA_H__ */

0 comments on commit 8e05d83

Please sign in to comment.