From b5dcee225ce972fecb054e104be22b2a6f65303d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 10 Nov 2015 12:01:44 -0200 Subject: [PATCH] [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: Mauro Carvalho Chehab Acked-by: Arnd Bergmann --- MAINTAINERS | 20 +++++++++---------- arch/arm/mach-davinci/board-da850-evm.c | 4 ++-- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 4 ++-- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 4 ++-- arch/arm/mach-pxa/pcm990-baseboard.c | 2 +- arch/blackfin/mach-bf561/boards/ezkit.c | 2 +- arch/blackfin/mach-bf609/boards/ezkit.c | 6 +++--- arch/sh/boards/mach-ap325rxa/setup.c | 2 +- arch/sh/boards/mach-ecovec24/setup.c | 6 +++--- arch/sh/boards/mach-kfr2r09/setup.c | 2 +- arch/sh/boards/mach-migor/setup.c | 4 ++-- arch/sh/boards/mach-se/7724/setup.c | 2 +- drivers/media/i2c/ad9389b.c | 2 +- drivers/media/i2c/adp1653.c | 2 +- drivers/media/i2c/adv7183.c | 2 +- drivers/media/i2c/adv7343.c | 2 +- drivers/media/i2c/adv7393.c | 2 +- drivers/media/i2c/adv7511.c | 2 +- drivers/media/i2c/adv7604.c | 2 +- drivers/media/i2c/adv7842.c | 2 +- drivers/media/i2c/ak881x.c | 2 +- drivers/media/i2c/as3645a.c | 2 +- drivers/media/i2c/bt819.c | 2 +- drivers/media/i2c/ir-kbd-i2c.c | 2 +- drivers/media/i2c/lm3560.c | 2 +- drivers/media/i2c/lm3646.c | 2 +- drivers/media/i2c/m52790.c | 2 +- drivers/media/i2c/m5mols/m5mols_capture.c | 2 +- drivers/media/i2c/m5mols/m5mols_core.c | 2 +- drivers/media/i2c/msp3400-driver.c | 2 +- drivers/media/i2c/mt9m032.c | 2 +- drivers/media/i2c/mt9p031.c | 2 +- drivers/media/i2c/mt9t001.c | 2 +- drivers/media/i2c/mt9v011.c | 2 +- drivers/media/i2c/mt9v032.c | 2 +- drivers/media/i2c/noon010pc30.c | 2 +- drivers/media/i2c/ov2659.c | 2 +- drivers/media/i2c/ov7670.c | 2 +- drivers/media/i2c/ov9650.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3.h | 2 +- drivers/media/i2c/s5k4ecgx.c | 2 +- drivers/media/i2c/s5k6aa.c | 2 +- drivers/media/i2c/saa6588.c | 2 +- drivers/media/i2c/saa7115.c | 2 +- drivers/media/i2c/saa7127.c | 2 +- drivers/media/i2c/smiapp/smiapp.h | 2 +- drivers/media/i2c/soc_camera/mt9t112.c | 2 +- drivers/media/i2c/soc_camera/mt9v022.c | 2 +- drivers/media/i2c/soc_camera/ov772x.c | 2 +- drivers/media/i2c/soc_camera/rj54n1cb0c.c | 2 +- drivers/media/i2c/soc_camera/tw9910.c | 2 +- drivers/media/i2c/sr030pc30.c | 2 +- drivers/media/i2c/tc358743.c | 2 +- drivers/media/i2c/ths7303.c | 2 +- drivers/media/i2c/tvaudio.c | 2 +- drivers/media/i2c/tvp514x.c | 2 +- drivers/media/i2c/tvp5150.c | 2 +- drivers/media/i2c/tvp7002.c | 2 +- drivers/media/i2c/uda1342.c | 2 +- drivers/media/i2c/upd64031a.c | 2 +- drivers/media/i2c/upd64083.c | 2 +- drivers/media/i2c/wm8775.c | 2 +- drivers/media/pci/bt8xx/bttv-cards.c | 2 +- drivers/media/pci/bt8xx/bttv-driver.c | 4 ++-- drivers/media/pci/bt8xx/bttvp.h | 2 +- drivers/media/pci/cobalt/cobalt-driver.c | 6 +++--- drivers/media/pci/cobalt/cobalt-irq.c | 2 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 4 ++-- drivers/media/pci/cx18/cx18-cards.c | 2 +- drivers/media/pci/cx18/cx18-driver.h | 2 +- drivers/media/pci/cx88/cx88-alsa.c | 2 +- drivers/media/pci/cx88/cx88-video.c | 2 +- drivers/media/pci/cx88/cx88.h | 4 ++-- drivers/media/pci/ivtv/ivtv-cards.c | 8 ++++---- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/ivtv/ivtv-driver.h | 2 +- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- drivers/media/pci/ivtv/ivtv-firmware.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 2 +- drivers/media/pci/ivtv/ivtv-routing.c | 6 +++--- drivers/media/pci/saa7134/saa7134-video.c | 2 +- drivers/media/pci/saa7134/saa7134.h | 2 +- drivers/media/pci/saa7146/mxb.c | 2 +- drivers/media/pci/zoran/zoran_card.c | 2 +- .../media/platform/marvell-ccic/mcam-core.c | 2 +- drivers/media/platform/via-camera.c | 2 +- drivers/media/usb/cx231xx/cx231xx.h | 2 +- drivers/media/usb/em28xx/em28xx-camera.c | 2 +- drivers/media/usb/em28xx/em28xx-cards.c | 6 +++--- drivers/media/usb/em28xx/em28xx.h | 2 +- drivers/media/usb/go7007/go7007-usb.c | 4 ++-- drivers/media/usb/go7007/go7007-v4l2.c | 2 +- drivers/media/usb/hdpvr/hdpvr.h | 2 +- .../media/usb/pvrusb2/pvrusb2-hdw-internal.h | 2 +- drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c | 2 +- drivers/media/usb/pvrusb2/pvrusb2-video-v4l.c | 2 +- drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/tm6000/tm6000-cards.c | 2 +- drivers/media/usb/usbvision/usbvision-core.c | 2 +- drivers/media/usb/usbvision/usbvision-video.c | 2 +- include/media/{ => i2c}/ad9389b.h | 0 include/media/{ => i2c}/adp1653.h | 2 +- include/media/{ => i2c}/adv7183.h | 0 include/media/{ => i2c}/adv7343.h | 0 include/media/{ => i2c}/adv7393.h | 0 include/media/{ => i2c}/adv7511.h | 0 include/media/{ => i2c}/adv7604.h | 0 include/media/{ => i2c}/adv7842.h | 0 include/media/{ => i2c}/ak881x.h | 0 include/media/{ => i2c}/as3645a.h | 2 +- include/media/{ => i2c}/bt819.h | 0 include/media/{ => i2c}/cs5345.h | 0 include/media/{ => i2c}/cs53l32a.h | 0 include/media/{ => i2c}/ir-kbd-i2c.h | 0 include/media/{ => i2c}/lm3560.h | 2 +- include/media/{ => i2c}/lm3646.h | 2 +- include/media/{ => i2c}/m52790.h | 0 include/media/{ => i2c}/m5mols.h | 0 include/media/{ => i2c}/mt9m032.h | 0 include/media/{ => i2c}/mt9p031.h | 0 include/media/{ => i2c}/mt9t001.h | 0 include/media/{ => i2c}/mt9t112.h | 0 include/media/{ => i2c}/mt9v011.h | 0 include/media/{ => i2c}/mt9v022.h | 0 include/media/{ => i2c}/mt9v032.h | 0 include/media/{ => i2c}/noon010pc30.h | 0 include/media/{ => i2c}/ov2659.h | 0 include/media/{ => i2c}/ov7670.h | 0 include/media/{ => i2c}/ov772x.h | 0 include/media/{ => i2c}/ov9650.h | 0 include/media/{ => i2c}/rj54n1cb0c.h | 0 include/media/{ => i2c}/s5c73m3.h | 0 include/media/{ => i2c}/s5k4ecgx.h | 0 include/media/{ => i2c}/s5k6aa.h | 0 include/media/{ => i2c}/saa6588.h | 0 include/media/{ => i2c}/saa7115.h | 1 - include/media/{ => i2c}/saa7127.h | 1 - include/media/{ => i2c}/smiapp.h | 2 +- include/media/{ => i2c}/sr030pc30.h | 0 include/media/{ => i2c}/tc358743.h | 0 include/media/{ => i2c}/ths7303.h | 0 include/media/{ => i2c}/tvaudio.h | 0 include/media/{ => i2c}/tvp514x.h | 0 include/media/{ => i2c}/tvp5150.h | 1 - include/media/{ => i2c}/tvp7002.h | 0 include/media/{ => i2c}/tw9910.h | 0 include/media/{ => i2c}/uda1342.h | 0 include/media/{ => i2c}/upd64031a.h | 0 include/media/{ => i2c}/upd64083.h | 0 include/media/{ => i2c}/wm8775.h | 0 155 files changed, 140 insertions(+), 143 deletions(-) rename include/media/{ => i2c}/ad9389b.h (100%) rename include/media/{ => i2c}/adp1653.h (99%) rename include/media/{ => i2c}/adv7183.h (100%) rename include/media/{ => i2c}/adv7343.h (100%) rename include/media/{ => i2c}/adv7393.h (100%) rename include/media/{ => i2c}/adv7511.h (100%) rename include/media/{ => i2c}/adv7604.h (100%) rename include/media/{ => i2c}/adv7842.h (100%) rename include/media/{ => i2c}/ak881x.h (100%) rename include/media/{ => i2c}/as3645a.h (98%) rename include/media/{ => i2c}/bt819.h (100%) rename include/media/{ => i2c}/cs5345.h (100%) rename include/media/{ => i2c}/cs53l32a.h (100%) rename include/media/{ => i2c}/ir-kbd-i2c.h (100%) rename include/media/{ => i2c}/lm3560.h (98%) rename include/media/{ => i2c}/lm3646.h (98%) rename include/media/{ => i2c}/m52790.h (100%) rename include/media/{ => i2c}/m5mols.h (100%) rename include/media/{ => i2c}/mt9m032.h (100%) rename include/media/{ => i2c}/mt9p031.h (100%) rename include/media/{ => i2c}/mt9t001.h (100%) rename include/media/{ => i2c}/mt9t112.h (100%) rename include/media/{ => i2c}/mt9v011.h (100%) rename include/media/{ => i2c}/mt9v022.h (100%) rename include/media/{ => i2c}/mt9v032.h (100%) rename include/media/{ => i2c}/noon010pc30.h (100%) rename include/media/{ => i2c}/ov2659.h (100%) rename include/media/{ => i2c}/ov7670.h (100%) rename include/media/{ => i2c}/ov772x.h (100%) rename include/media/{ => i2c}/ov9650.h (100%) rename include/media/{ => i2c}/rj54n1cb0c.h (100%) rename include/media/{ => i2c}/s5c73m3.h (100%) rename include/media/{ => i2c}/s5k4ecgx.h (100%) rename include/media/{ => i2c}/s5k6aa.h (100%) rename include/media/{ => i2c}/saa6588.h (100%) rename include/media/{ => i2c}/saa7115.h (99%) rename include/media/{ => i2c}/saa7127.h (99%) rename include/media/{ => i2c}/smiapp.h (98%) rename include/media/{ => i2c}/sr030pc30.h (100%) rename include/media/{ => i2c}/tc358743.h (100%) rename include/media/{ => i2c}/ths7303.h (100%) rename include/media/{ => i2c}/tvaudio.h (100%) rename include/media/{ => i2c}/tvp514x.h (100%) rename include/media/{ => i2c}/tvp5150.h (99%) rename include/media/{ => i2c}/tvp7002.h (100%) rename include/media/{ => i2c}/tw9910.h (100%) rename include/media/{ => i2c}/uda1342.h (100%) rename include/media/{ => i2c}/upd64031a.h (100%) rename include/media/{ => i2c}/upd64083.h (100%) rename include/media/{ => i2c}/wm8775.h (100%) diff --git a/MAINTAINERS b/MAINTAINERS index e9caa4b28828..a8e3f478d869 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -395,7 +395,7 @@ M: Sakari Ailus 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 @@ -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 @@ -4596,7 +4596,7 @@ M: Heungjun Kim 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -9840,7 +9840,7 @@ M: Sakari Ailus 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 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 diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 1ed545cc2b83..9cc7b818fbf6 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -49,8 +49,8 @@ #include #include -#include -#include +#include +#include #define DA850_EVM_PHY_ID "davinci_mdio-0:00" #define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8) diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c index b46b4d25f93e..c71dd9982f03 100644 --- a/arch/arm/mach-davinci/board-dm355-evm.c +++ b/arch/arm/mach-davinci/board-dm355-evm.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index a756003595e9..f073518f621a 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c @@ -40,8 +40,8 @@ #include #include -#include -#include +#include +#include #include "davinci.h" diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c index bbdd2d614b49..7a20507a3eef 100644 --- a/arch/arm/mach-davinci/board-dm644x-evm.c +++ b/arch/arm/mach-davinci/board-dm644x-evm.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c index 846a84ddc28e..ee6ab7e8d3b0 100644 --- a/arch/arm/mach-davinci/board-dm646x-evm.c +++ b/arch/arm/mach-davinci/board-dm646x-evm.c @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index b71c96f614f9..e3b58cb84c06 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 2de71e8c104b..f35525b55819 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c @@ -443,7 +443,7 @@ static const struct ppi_info ppi_info = { }; #if IS_ENABLED(CONFIG_VIDEO_ADV7183) -#include +#include static struct v4l2_input adv7183_inputs[] = { { .index = 0, diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c index 2c61fc0c98f9..c7928d8ebb82 100644 --- a/arch/blackfin/mach-bf609/boards/ezkit.c +++ b/arch/blackfin/mach-bf609/boards/ezkit.c @@ -933,7 +933,7 @@ static struct bfin_capture_config bfin_capture_data = { #endif #if IS_ENABLED(CONFIG_VIDEO_ADV7842) -#include +#include static struct v4l2_input adv7842_inputs[] = { { @@ -1084,7 +1084,7 @@ static const struct ppi_info ppi_info = { }; #if IS_ENABLED(CONFIG_VIDEO_ADV7511) -#include +#include static struct v4l2_output adv7511_outputs[] = { { @@ -1125,7 +1125,7 @@ static struct bfin_display_config bfin_display_data = { #endif #if IS_ENABLED(CONFIG_VIDEO_ADV7343) -#include +#include static struct v4l2_output adv7343_outputs[] = { { diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index cbd2a9f02a91..62b045c6d289 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index d531791f06ff..5fcec7648d52 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -40,8 +40,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -900,7 +900,7 @@ static struct platform_device irda_device = { .resource = irda_resources, }; -#include +#include #include static struct ak881x_pdata ak881x_pdata = { diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 7d997cec09c5..ec9357333878 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include