Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5dcee22 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] include/media: split I2C headers from V4L2 core



Currently, include/media is messy, as it contains both the V4L2 core
headers and some driver-specific headers on the same place. That makes
harder to identify what core headers should be documented and what
headers belong to I2C drivers that are included only by bridge/main
drivers that would require the functions provided by them.

Let's move those i2c specific files to its own subdirectory.

The files to move were produced via the following script:
	mkdir include/media/i2c
	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
	(cd include/media; for i in *.h; do n=`echo $i|sed s/.h$/.c/`; if [ -e ../../drivers/media/*/i2c/$n ]; then echo $i; git mv $i i2c/; fi; done)
	for i in include/media/*.h; do n=`basename $i`;  (for j in $(git grep -l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep i2c list`" != "" ]; then git mv $i include/media/i2c; fi; fi; done

And the references corrected via this script:
    MAIN_DIR="media/"
    PREV_DIR="media/"
    DIRS="i2c/"

    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

Merged Sakari Ailus patch that moves smiapp.h to include/media/i2c.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent b7be7557
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -395,7 +395,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi>
L:	linux-media@vger.kernel.org
S:	Maintained
F:	drivers/media/i2c/adp1653.c
F:	include/media/adp1653.h
F:	include/media/i2c/adp1653.h

ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501)
M:	Michael Hennerich <michael.hennerich@analog.com>
@@ -1773,7 +1773,7 @@ L: linux-media@vger.kernel.org
T:	git git://linuxtv.org/media_tree.git
S:	Maintained
F:	drivers/media/i2c/as3645a.c
F:	include/media/as3645a.h
F:	include/media/i2c/as3645a.h

ASC7621 HARDWARE MONITOR DRIVER
M:	George Joseph <george.joseph@fairview5.com>
@@ -4596,7 +4596,7 @@ M: Heungjun Kim <riverful.kim@samsung.com>
L:	linux-media@vger.kernel.org
S:	Maintained
F:	drivers/media/i2c/m5mols/
F:	include/media/m5mols.h
F:	include/media/i2c/m5mols.h

FUJITSU TABLET EXTRAS
M:	Robert Gerlach <khnz@gmx.de>
@@ -7169,7 +7169,7 @@ L: linux-media@vger.kernel.org
T:	git git://linuxtv.org/media_tree.git
S:	Maintained
F:	drivers/media/i2c/mt9m032.c
F:	include/media/mt9m032.h
F:	include/media/i2c/mt9m032.h

MT9P031 APTINA CAMERA SENSOR
M:	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7177,7 +7177,7 @@ L: linux-media@vger.kernel.org
T:	git git://linuxtv.org/media_tree.git
S:	Maintained
F:	drivers/media/i2c/mt9p031.c
F:	include/media/mt9p031.h
F:	include/media/i2c/mt9p031.h

MT9T001 APTINA CAMERA SENSOR
M:	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7185,7 +7185,7 @@ L: linux-media@vger.kernel.org
T:	git git://linuxtv.org/media_tree.git
S:	Maintained
F:	drivers/media/i2c/mt9t001.c
F:	include/media/mt9t001.h
F:	include/media/i2c/mt9t001.h

MT9V032 APTINA CAMERA SENSOR
M:	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
@@ -7194,7 +7194,7 @@ T: git git://linuxtv.org/media_tree.git
S:	Maintained
F:	Documentation/devicetree/bindings/media/i2c/mt9v032.txt
F:	drivers/media/i2c/mt9v032.c
F:	include/media/mt9v032.h
F:	include/media/i2c/mt9v032.h

MULTIFUNCTION DEVICES (MFD)
M:	Lee Jones <lee.jones@linaro.org>
@@ -9751,7 +9751,7 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/
T:	git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
S:	Maintained
F:	drivers/media/i2c/ov2659.c
F:	include/media/ov2659.h
F:	include/media/i2c/ov2659.h

SILICON MOTION SM712 FRAME BUFFER DRIVER
M:	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
@@ -9840,7 +9840,7 @@ M: Sakari Ailus <sakari.ailus@iki.fi>
L:	linux-media@vger.kernel.org
S:	Maintained
F:	drivers/media/i2c/smiapp/
F:	include/media/smiapp.h
F:	include/media/i2c/smiapp.h
F:	drivers/media/i2c/smiapp-pll.c
F:	drivers/media/i2c/smiapp-pll.h
F:	include/uapi/linux/smiapp.h
@@ -10781,7 +10781,7 @@ M: Mats Randgaard <matrandg@cisco.com>
L:	linux-media@vger.kernel.org
S:	Maintained
F:	drivers/media/i2c/tc358743*
F:	include/media/tc358743.h
F:	include/media/i2c/tc358743.h

TMIO MMC DRIVER
M:	Ian Molton <ian@mnementh.co.uk>
+2 −2
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@
#include <asm/mach/arch.h>
#include <asm/system_info.h>

#include <media/tvp514x.h>
#include <media/adv7343.h>
#include <media/i2c/tvp514x.h>
#include <media/i2c/adv7343.h>

#define DA850_EVM_PHY_ID		"davinci_mdio-0:00"
#define DA850_LCD_PWR_PIN		GPIO_TO_PIN(2, 8)
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
#include <linux/gpio.h>
#include <linux/clk.h>
#include <linux/videodev2.h>
#include <media/tvp514x.h>
#include <media/i2c/tvp514x.h>
#include <linux/spi/spi.h>
#include <linux/spi/eeprom.h>
#include <linux/platform_data/gpio-davinci.h>
+2 −2
Original line number Diff line number Diff line
@@ -40,8 +40,8 @@
#include <linux/platform_data/mtd-davinci.h>
#include <linux/platform_data/keyscan-davinci.h>

#include <media/ths7303.h>
#include <media/tvp514x.h>
#include <media/i2c/ths7303.h>
#include <media/i2c/tvp514x.h>

#include "davinci.h"

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <linux/v4l2-dv-timings.h>
#include <linux/export.h>

#include <media/tvp514x.h>
#include <media/i2c/tvp514x.h>

#include <asm/mach-types.h>
#include <asm/mach/arch.h>
Loading