[media] include/media: split I2C headers from V4L2 core
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 10 Nov 2015 14:01:44 +0000 (12:01 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 17 Nov 2015 08:57:11 +0000 (06:57 -0200)
commitb5dcee225ce972fecb054e104be22b2a6f65303d
tree0f83e95abde14960d263eb79f478984bcf81f03d
parentb7be755733dc44c72956c91876e5d86c56052a54
[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 <mchehab@osg.samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
205 files changed:
MAINTAINERS
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/board-dm355-evm.c
arch/arm/mach-davinci/board-dm365-evm.c
arch/arm/mach-davinci/board-dm644x-evm.c
arch/arm/mach-davinci/board-dm646x-evm.c
arch/arm/mach-pxa/pcm990-baseboard.c
arch/blackfin/mach-bf561/boards/ezkit.c
arch/blackfin/mach-bf609/boards/ezkit.c
arch/sh/boards/mach-ap325rxa/setup.c
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-kfr2r09/setup.c
arch/sh/boards/mach-migor/setup.c
arch/sh/boards/mach-se/7724/setup.c
drivers/media/i2c/ad9389b.c
drivers/media/i2c/adp1653.c
drivers/media/i2c/adv7183.c
drivers/media/i2c/adv7343.c
drivers/media/i2c/adv7393.c
drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c
drivers/media/i2c/ak881x.c
drivers/media/i2c/as3645a.c
drivers/media/i2c/bt819.c
drivers/media/i2c/ir-kbd-i2c.c
drivers/media/i2c/lm3560.c
drivers/media/i2c/lm3646.c
drivers/media/i2c/m52790.c
drivers/media/i2c/m5mols/m5mols_capture.c
drivers/media/i2c/m5mols/m5mols_core.c
drivers/media/i2c/msp3400-driver.c
drivers/media/i2c/mt9m032.c
drivers/media/i2c/mt9p031.c
drivers/media/i2c/mt9t001.c
drivers/media/i2c/mt9v011.c
drivers/media/i2c/mt9v032.c
drivers/media/i2c/noon010pc30.c
drivers/media/i2c/ov2659.c
drivers/media/i2c/ov7670.c
drivers/media/i2c/ov9650.c
drivers/media/i2c/s5c73m3/s5c73m3-core.c
drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
drivers/media/i2c/s5c73m3/s5c73m3.h
drivers/media/i2c/s5k4ecgx.c
drivers/media/i2c/s5k6aa.c
drivers/media/i2c/saa6588.c
drivers/media/i2c/saa7115.c
drivers/media/i2c/saa7127.c
drivers/media/i2c/smiapp/smiapp.h
drivers/media/i2c/soc_camera/mt9t112.c
drivers/media/i2c/soc_camera/mt9v022.c
drivers/media/i2c/soc_camera/ov772x.c
drivers/media/i2c/soc_camera/rj54n1cb0c.c
drivers/media/i2c/soc_camera/tw9910.c
drivers/media/i2c/sr030pc30.c
drivers/media/i2c/tc358743.c
drivers/media/i2c/ths7303.c
drivers/media/i2c/tvaudio.c
drivers/media/i2c/tvp514x.c
drivers/media/i2c/tvp5150.c
drivers/media/i2c/tvp7002.c
drivers/media/i2c/uda1342.c
drivers/media/i2c/upd64031a.c
drivers/media/i2c/upd64083.c
drivers/media/i2c/wm8775.c
drivers/media/pci/bt8xx/bttv-cards.c
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/bt8xx/bttvp.h
drivers/media/pci/cobalt/cobalt-driver.c
drivers/media/pci/cobalt/cobalt-irq.c
drivers/media/pci/cobalt/cobalt-v4l2.c
drivers/media/pci/cx18/cx18-cards.c
drivers/media/pci/cx18/cx18-driver.h
drivers/media/pci/cx88/cx88-alsa.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/cx88/cx88.h
drivers/media/pci/ivtv/ivtv-cards.c
drivers/media/pci/ivtv/ivtv-driver.c
drivers/media/pci/ivtv/ivtv-driver.h
drivers/media/pci/ivtv/ivtv-fileops.c
drivers/media/pci/ivtv/ivtv-firmware.c
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/pci/ivtv/ivtv-routing.c
drivers/media/pci/saa7134/saa7134-video.c
drivers/media/pci/saa7134/saa7134.h
drivers/media/pci/saa7146/mxb.c
drivers/media/pci/zoran/zoran_card.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/platform/via-camera.c
drivers/media/usb/cx231xx/cx231xx.h
drivers/media/usb/em28xx/em28xx-camera.c
drivers/media/usb/em28xx/em28xx-cards.c
drivers/media/usb/em28xx/em28xx.h
drivers/media/usb/go7007/go7007-usb.c
drivers/media/usb/go7007/go7007-v4l2.c
drivers/media/usb/hdpvr/hdpvr.h
drivers/media/usb/pvrusb2/pvrusb2-hdw-internal.h
drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c
drivers/media/usb/pvrusb2/pvrusb2-video-v4l.c
drivers/media/usb/stk1160/stk1160-core.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/tm6000/tm6000-cards.c
drivers/media/usb/usbvision/usbvision-core.c
drivers/media/usb/usbvision/usbvision-video.c
include/media/ad9389b.h [deleted file]
include/media/adp1653.h [deleted file]
include/media/adv7183.h [deleted file]
include/media/adv7343.h [deleted file]
include/media/adv7393.h [deleted file]
include/media/adv7511.h [deleted file]
include/media/adv7604.h [deleted file]
include/media/adv7842.h [deleted file]
include/media/ak881x.h [deleted file]
include/media/as3645a.h [deleted file]
include/media/bt819.h [deleted file]
include/media/cs5345.h [deleted file]
include/media/cs53l32a.h [deleted file]
include/media/i2c/ad9389b.h [new file with mode: 0644]
include/media/i2c/adp1653.h [new file with mode: 0644]
include/media/i2c/adv7183.h [new file with mode: 0644]
include/media/i2c/adv7343.h [new file with mode: 0644]
include/media/i2c/adv7393.h [new file with mode: 0644]
include/media/i2c/adv7511.h [new file with mode: 0644]
include/media/i2c/adv7604.h [new file with mode: 0644]
include/media/i2c/adv7842.h [new file with mode: 0644]
include/media/i2c/ak881x.h [new file with mode: 0644]
include/media/i2c/as3645a.h [new file with mode: 0644]
include/media/i2c/bt819.h [new file with mode: 0644]
include/media/i2c/cs5345.h [new file with mode: 0644]
include/media/i2c/cs53l32a.h [new file with mode: 0644]
include/media/i2c/ir-kbd-i2c.h [new file with mode: 0644]
include/media/i2c/lm3560.h [new file with mode: 0644]
include/media/i2c/lm3646.h [new file with mode: 0644]
include/media/i2c/m52790.h [new file with mode: 0644]
include/media/i2c/m5mols.h [new file with mode: 0644]
include/media/i2c/mt9m032.h [new file with mode: 0644]
include/media/i2c/mt9p031.h [new file with mode: 0644]
include/media/i2c/mt9t001.h [new file with mode: 0644]
include/media/i2c/mt9t112.h [new file with mode: 0644]
include/media/i2c/mt9v011.h [new file with mode: 0644]
include/media/i2c/mt9v022.h [new file with mode: 0644]
include/media/i2c/mt9v032.h [new file with mode: 0644]
include/media/i2c/noon010pc30.h [new file with mode: 0644]
include/media/i2c/ov2659.h [new file with mode: 0644]
include/media/i2c/ov7670.h [new file with mode: 0644]
include/media/i2c/ov772x.h [new file with mode: 0644]
include/media/i2c/ov9650.h [new file with mode: 0644]
include/media/i2c/rj54n1cb0c.h [new file with mode: 0644]
include/media/i2c/s5c73m3.h [new file with mode: 0644]
include/media/i2c/s5k4ecgx.h [new file with mode: 0644]
include/media/i2c/s5k6aa.h [new file with mode: 0644]
include/media/i2c/saa6588.h [new file with mode: 0644]
include/media/i2c/saa7115.h [new file with mode: 0644]
include/media/i2c/saa7127.h [new file with mode: 0644]
include/media/i2c/smiapp.h [new file with mode: 0644]
include/media/i2c/sr030pc30.h [new file with mode: 0644]
include/media/i2c/tc358743.h [new file with mode: 0644]
include/media/i2c/ths7303.h [new file with mode: 0644]
include/media/i2c/tvaudio.h [new file with mode: 0644]
include/media/i2c/tvp514x.h [new file with mode: 0644]
include/media/i2c/tvp5150.h [new file with mode: 0644]
include/media/i2c/tvp7002.h [new file with mode: 0644]
include/media/i2c/tw9910.h [new file with mode: 0644]
include/media/i2c/uda1342.h [new file with mode: 0644]
include/media/i2c/upd64031a.h [new file with mode: 0644]
include/media/i2c/upd64083.h [new file with mode: 0644]
include/media/i2c/wm8775.h [new file with mode: 0644]
include/media/ir-kbd-i2c.h [deleted file]
include/media/lm3560.h [deleted file]
include/media/lm3646.h [deleted file]
include/media/m52790.h [deleted file]
include/media/m5mols.h [deleted file]
include/media/mt9m032.h [deleted file]
include/media/mt9p031.h [deleted file]
include/media/mt9t001.h [deleted file]
include/media/mt9t112.h [deleted file]
include/media/mt9v011.h [deleted file]
include/media/mt9v022.h [deleted file]
include/media/mt9v032.h [deleted file]
include/media/noon010pc30.h [deleted file]
include/media/ov2659.h [deleted file]
include/media/ov7670.h [deleted file]
include/media/ov772x.h [deleted file]
include/media/ov9650.h [deleted file]
include/media/rj54n1cb0c.h [deleted file]
include/media/s5c73m3.h [deleted file]
include/media/s5k4ecgx.h [deleted file]
include/media/s5k6aa.h [deleted file]
include/media/saa6588.h [deleted file]
include/media/saa7115.h [deleted file]
include/media/saa7127.h [deleted file]
include/media/smiapp.h [deleted file]
include/media/sr030pc30.h [deleted file]
include/media/tc358743.h [deleted file]
include/media/ths7303.h [deleted file]
include/media/tvaudio.h [deleted file]
include/media/tvp514x.h [deleted file]
include/media/tvp5150.h [deleted file]
include/media/tvp7002.h [deleted file]
include/media/tw9910.h [deleted file]
include/media/uda1342.h [deleted file]
include/media/upd64031a.h [deleted file]
include/media/upd64083.h [deleted file]
include/media/wm8775.h [deleted file]