mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 22:25:03 +00:00
eb4b0ec75e
Let's not mix platform_data headers with the core headers. Instead, let's create a subdir at linux/platform_data and move the headers to that common place, adding it to MAINTAINERS. The headers were moved with: mkdir include/linux/platform_data/media/; git mv include/media/gpio-ir-recv.h include/media/ir-rx51.h include/media/mmp-camera.h include/media/omap1_camera.h include/media/omap4iss.h include/media/s5p_hdmi.h include/media/si4713.h include/media/sii9234.h include/media/smiapp.h include/media/soc_camera.h include/media/soc_camera_platform.h include/media/timb_radio.h include/media/timb_video.h include/linux/platform_data/media/ And the references fixed with this script: MAIN_DIR="linux/platform_data/" PREV_DIR="media/" DIRS="media/" echo "Checking affected files" >&2 for i in $DIRS; do for j in $(find include/$MAIN_DIR/$i -type f -name '*.h'); do n=`basename $j` git grep -l $n done done|sort|uniq >files && ( echo "Handling files..." >&2; echo "for i in \$(cat files|grep -v Documentation); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo "perl -ne 's,(include [\\\"\\<])$PREV_DIR($i)([\\\"\\>]),\1$MAIN_DIR$j\2\3,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done"; ); echo "Handling documentation..." >&2; echo "for i in MAINTAINERS \$(cat files); do cat \$i | \\"; ( cd include/$MAIN_DIR; for j in $DIRS; do for i in $(ls $j); do echo " perl -ne 's,include/$PREV_DIR($i)\b,include/$MAIN_DIR$j\1,; print \$_' |\\"; done; done; echo "cat > a && mv a \$i; done" ); ) >script && . ./script Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
83 lines
1.9 KiB
C
83 lines
1.9 KiB
C
/*
|
|
* Generic Platform Camera Driver Header
|
|
*
|
|
* Copyright (C) 2008 Magnus Damm
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#ifndef __SOC_CAMERA_H__
|
|
#define __SOC_CAMERA_H__
|
|
|
|
#include <linux/videodev2.h>
|
|
#include <media/soc_camera.h>
|
|
#include <media/v4l2-mediabus.h>
|
|
|
|
struct device;
|
|
|
|
struct soc_camera_platform_info {
|
|
const char *format_name;
|
|
unsigned long format_depth;
|
|
struct v4l2_mbus_framefmt format;
|
|
unsigned long mbus_param;
|
|
enum v4l2_mbus_type mbus_type;
|
|
struct soc_camera_device *icd;
|
|
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(struct soc_camera_device *icd,
|
|
struct platform_device **pdev,
|
|
struct soc_camera_link *plink,
|
|
void (*release)(struct device *dev),
|
|
int id)
|
|
{
|
|
struct soc_camera_subdev_desc *ssdd =
|
|
(struct soc_camera_subdev_desc *)plink;
|
|
struct soc_camera_platform_info *info = ssdd->drv_priv;
|
|
int ret;
|
|
|
|
if (&icd->sdesc->subdev_desc != ssdd)
|
|
return -ENODEV;
|
|
|
|
if (*pdev)
|
|
return -EBUSY;
|
|
|
|
*pdev = platform_device_alloc("soc_camera_platform", id);
|
|
if (!*pdev)
|
|
return -ENOMEM;
|
|
|
|
info->icd = icd;
|
|
|
|
(*pdev)->dev.platform_data = info;
|
|
(*pdev)->dev.release = release;
|
|
|
|
ret = platform_device_add(*pdev);
|
|
if (ret < 0) {
|
|
platform_device_put(*pdev);
|
|
*pdev = NULL;
|
|
info->icd = NULL;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
|
|
struct platform_device *pdev,
|
|
const struct soc_camera_link *plink)
|
|
{
|
|
const struct soc_camera_subdev_desc *ssdd =
|
|
(const struct soc_camera_subdev_desc *)plink;
|
|
if (&icd->sdesc->subdev_desc != ssdd || !pdev)
|
|
return;
|
|
|
|
platform_device_unregister(pdev);
|
|
}
|
|
|
|
#endif /* __SOC_CAMERA_H__ */
|