From ae009e7e28ec4df53dfacd46f7afcc7835ad9b3e Mon Sep 17 00:00:00 2001 From: hschang Date: Mon, 30 Mar 2015 18:13:40 +0900 Subject: [PATCH] Fix meta-bsp structure. --- Makefile | 3 +- meta-bsp/bm750/conf/layer.conf | 6 - meta-bsp/bm750/conf/machine/bm750.conf | 20 - .../linux/linux-vuplus-3.1.1/bm750_defconfig | 2691 - .../linux-vuplus-3.1.1/linux_3.1.1_bm750.patch | 181 - .../linux/linux-vuplus-3.9.6/bm750_defconfig | 3132 - .../linux/linux-vuplus-3.9.6/linux-sata_bcm.patch | 55 - .../recipes/linux/linux-vuplus_3.1.1.bbappend | 8 - .../recipes/linux/linux-vuplus_3.9.6.bbappend | 6 - .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - meta-bsp/classes/image_types_ubi.bbclass | 29 + meta-bsp/classes/image_types_ubi_initrd.bbclass | 28 + meta-bsp/classes/image_types_ubi_splash.bbclass | 31 + .../classes/image_types_ubi_splash_initrd.bbclass | 29 + ...age_types_ubi_splash_initrd_forceupdate.bbclass | 29 + meta-bsp/common/classes/image_types_ubi.bbclass | 29 - .../common/classes/image_types_ubi_initrd.bbclass | 28 - .../common/classes/image_types_ubi_splash.bbclass | 31 - .../classes/image_types_ubi_splash_initrd.bbclass | 29 - ...age_types_ubi_splash_initrd_forceupdate.bbclass | 29 - meta-bsp/common/conf/layer.conf | 10 - .../conf/machine/include/vuplus-mips32el.inc | 9 - .../conf/machine/include/vuplus-ubi-initrd.inc | 4 - .../vuplus-ubi-splash-initrd-forceupdate.inc | 4 - .../machine/include/vuplus-ubi-splash-initrd.inc | 4 - .../conf/machine/include/vuplus-ubi-splash.inc | 4 - .../common/conf/machine/include/vuplus-ubi.inc | 4 - meta-bsp/common/conf/machine/include/vuplus.inc | 20 - .../linux-vuplus-2.6.37/bcmgenet_oobctrl.patch | 13 - .../linux-vuplus-2.6.37/brcm_disable_enet1.patch | 28 - .../linux/linux-vuplus-2.6.37/brcm_mtd_mac.patch | 60 - .../linux/linux-vuplus-2.6.37/dvb-core.patch | 1330 - .../linux/linux-vuplus-2.6.37/fix_cpu_proc.patch | 13 - .../recipes/linux/linux-vuplus-2.6.37/pinmux.patch | 15 - .../recipes/linux/linux-vuplus-2.6.37/serial.patch | 12 - .../linux/linux-vuplus-3.1.1/fix_cpu_proc.patch | 13 - .../recipes/linux/linux-vuplus-3.1.1/igmp.patch | 13 - .../kernel_miscompilation_with_gcc_4_8.patch | 251 - .../linux/linux-vuplus-3.1.1/linux-sata_brcm.patch | 243 - .../linux-vuplus-3.1.1/rt5372_kernel_3.1.1.patch | 437 - .../linux-vuplus-3.13.5/linux-tcp_output.patch | 13 - .../linux-vuplus-3.13.5/linux_dvb_adapter.patch | 36 - ...2800usb_fix_warn_tx_status_timeout_to_dbg.patch | 13 - .../linux/linux-vuplus-3.3.6/brcm_3.3.patch | 1749 - .../linux/linux-vuplus-3.3.6/brcm_mtd_mac.patch | 61 - .../brcm_remove_entire_mtd.patch | 17 - .../linux/linux-vuplus-3.3.6/dvb_core_5.5.patch | 136 - .../linux/linux-vuplus-3.3.6/fix_cpu_proc.patch | 13 - .../linux-vuplus-3.3.8/bmips-no-array-bounds.patch | 13 - .../linux/linux-vuplus-3.3.8/brcm_3.3.patch | 64 - .../linux/linux-vuplus-3.3.8/brcm_mtd_mac.patch | 74 - .../linux/linux-vuplus-3.3.8/dvb_backport.patch | 1120888 ---------------- .../linux/linux-vuplus-3.3.8/dvb_core_5.5.patch | 132 - .../linux/linux-vuplus-3.3.8/fix_cpu_proc.patch | 13 - .../kernel_miscompilation_with_gcc_4_8.patch | 252 - .../linux-vuplus-3.3.8/rt5372_kernel_3.3.8.patch | 387 - .../fix_fuse_for_linux_mips_3-9.patch | 34 - ...2800usb_fix_warn_tx_status_timeout_to_dbg.patch | 13 - .../common/recipes/linux/linux-vuplus_2.6.37.bb | 57 - .../common/recipes/linux/linux-vuplus_3.1.1.bb | 55 - .../common/recipes/linux/linux-vuplus_3.13.5.bb | 65 - .../common/recipes/linux/linux-vuplus_3.3.6.bb | 57 - .../common/recipes/linux/linux-vuplus_3.3.8.bb | 60 - .../common/recipes/linux/linux-vuplus_3.9.6.bb | 61 - .../recipes/vuplus/vuplus-blindscan-utils.bb | 75 - meta-bsp/common/recipes/vuplus/vuplus-bootlogo.bb | 45 - .../recipes/vuplus/vuplus-bootlogo/backdrop.mvi | Bin 74877 -> 0 bytes .../recipes/vuplus/vuplus-bootlogo/bootlogo.mvi | Bin 74952 -> 0 bytes .../vuplus/vuplus-bootlogo/bootlogo_wait.mvi | Bin 74952 -> 0 bytes .../recipes/vuplus/vuplus-bootlogo/switchoff.mvi | Bin 74951 -> 0 bytes .../vuplus-bootlogo/vuplus-bootlogo.sysvinit | 31 - .../common/recipes/vuplus/vuplus-dvb-modules.bb | 33 - meta-bsp/common/recipes/vuplus/vuplus-dvb-proxy.bb | 30 - .../common/recipes/vuplus/vuplus-platform-util.bb | 39 - .../vuplus-platform-util.sysvinit | 36 - .../common/recipes/vuplus/vuplus-tuner-turbo.inc | 42 - .../recipes/vuplus/vuplus-tuner-turbo_3.13.5.bb | 8 - .../recipes/vuplus/vuplus-tuner-turbo_3.9.6-r1.bb | 10 - .../recipes/vuplus/vuplus-tuner-turbo_3.9.6-r2.bb | 10 - meta-bsp/conf/layer.conf | 10 + meta-bsp/conf/machine/bm750.conf | 20 + meta-bsp/conf/machine/include/vuplus-mips32el.inc | 9 + .../conf/machine/include/vuplus-ubi-initrd.inc | 4 + .../vuplus-ubi-splash-initrd-forceupdate.inc | 4 + .../machine/include/vuplus-ubi-splash-initrd.inc | 4 + .../conf/machine/include/vuplus-ubi-splash.inc | 4 + meta-bsp/conf/machine/include/vuplus-ubi.inc | 4 + meta-bsp/conf/machine/include/vuplus.inc | 20 + meta-bsp/conf/machine/vuduo2.conf | 32 + meta-bsp/conf/machine/vusolo.conf | 18 + meta-bsp/conf/machine/vusolo2.conf | 31 + meta-bsp/conf/machine/vusolose.conf | 31 + meta-bsp/conf/machine/vuultimo.conf | 26 + meta-bsp/conf/machine/vuuno.conf | 22 + meta-bsp/conf/machine/vuzero.conf | 26 + .../recipes-graphics/libgles/libgles-vuduo2.bb | 9 + .../recipes-graphics/libgles/libgles-vusolo2.bb | 10 + .../recipes-graphics/libgles/libgles-vusolose.bb | 9 + meta-bsp/recipes-graphics/libgles/libgles.inc | 30 + .../recipes-kernel/linux/linux-vuplus-3.13.5.inc | 70 + .../linux-vuplus-3.13.5/linux-tcp_output.patch | 13 + .../linux-vuplus-3.13.5/linux_dvb_adapter.patch | 36 + ...2800usb_fix_warn_tx_status_timeout_to_dbg.patch | 13 + .../linux-vuplus-3.13.5/vuduo2/brcm_s3_wol.patch | 68 + .../linux-vuplus-3.13.5/vuduo2/vuduo2_defconfig | 3001 + .../vuduo2/vuduo2_defconfig_proxy | 2863 + .../vusolo2/linux-bcm_ethernet.patch | 12 + .../linux-vuplus-3.13.5/vusolo2/vusolo2_defconfig | 2994 + .../vusolo2/vusolo2_defconfig_proxy | 2856 + .../linux-vuplus-3.13.5/vusolose/brcm_s3_wol.patch | 67 + .../vusolose/vusolose_defconfig | 2998 + .../vusolose/vusolose_defconfig_proxy | 2860 + .../linux-vuplus-3.13.5/vuzero/vuzero_defconfig | 2980 + .../recipes-kernel/linux/linux-vuplus-3.9.6.inc | 66 + .../linux/linux-vuplus-3.9.6/bm750/bm750_defconfig | 3132 + .../linux-vuplus-3.9.6/bm750/linux-sata_bcm.patch | 55 + .../fix_fuse_for_linux_mips_3-9.patch | 34 + ...2800usb_fix_warn_tx_status_timeout_to_dbg.patch | 13 + .../linux-vuplus-3.9.6/vusolo/vusolo_defconfig | 3113 + .../vuultimo/linux-sata_bcm.patch | 55 + .../vuultimo/vu_ultimo_fixed_mtd.patch | 43 + .../linux-vuplus-3.9.6/vuultimo/vuultimo_defconfig | 3132 + .../linux-vuplus-3.9.6/vuuno/linux-sata_bcm.patch | 55 + .../linux/linux-vuplus-3.9.6/vuuno/vuuno_defconfig | 3132 + .../linux/linux-vuplus-bm750_3.9.6.bb | 9 + .../linux/linux-vuplus-vuduo2_3.13.5.bb | 11 + .../linux/linux-vuplus-vusolo2_3.13.5.bb | 12 + .../linux/linux-vuplus-vusolo_3.9.6.bb | 8 + .../linux/linux-vuplus-vusolose_3.13.5.bb | 11 + .../linux/linux-vuplus-vuultimo_3.9.6.bb | 12 + .../linux/linux-vuplus-vuuno_3.9.6.bb | 9 + .../linux/linux-vuplus-vuzero_3.13.5.bb | 10 + meta-bsp/recipes-vuplus/enigma2/enigma2.bbappend | 40 + .../enigma2/enigma2/enigma2_vuplus_misc.patch | 12 + .../enigma2/enigma2_vuplus_remove_pvr_action.patch | 195 + .../enigma2/enigma2/vuduo2/skin_user_vuduo2.xml | 186 + .../enigma2/vuduo2/vfd_icons_vuduo2/crypt.png | Bin 0 -> 140 bytes .../enigma2/vuduo2/vfd_icons_vuduo2/dolby.png | Bin 0 -> 149 bytes .../enigma2/vuduo2/vfd_icons_vuduo2/format.png | Bin 0 -> 157 bytes .../enigma2/vuduo2/vfd_icons_vuduo2/rec.png | Bin 0 -> 152 bytes .../enigma2/vuduo2/vfd_icons_vuduo2/teletext.png | Bin 0 -> 128 bytes .../enigma2/enigma2/vuultimo/analog.ttf | Bin 0 -> 41168 bytes .../enigma2/enigma2/vuultimo/skin_user.xml | 243 + .../enigma2/vuultimo/vfd_icons/vfd_icon_crypt.png | Bin 0 -> 961 bytes .../enigma2/vuultimo/vfd_icons/vfd_icon_dolby.png | Bin 0 -> 985 bytes .../enigma2/vuultimo/vfd_icons/vfd_icon_format.png | Bin 0 -> 996 bytes .../enigma2/vuultimo/vfd_icons/vfd_icon_rec.png | Bin 0 -> 1009 bytes .../enigma2/vuultimo/vfd_icons/vfd_icon_txt.png | Bin 0 -> 975 bytes .../vuplus-blindscan-utils.bb | 75 + .../vuplus-bootlogo/files/backdrop.mvi | Bin 0 -> 74877 bytes .../vuplus-bootlogo/files/bootlogo.mvi | Bin 0 -> 74952 bytes .../vuplus-bootlogo/files/bootlogo_wait.mvi | Bin 0 -> 74952 bytes .../vuplus-bootlogo/files/switchoff.mvi | Bin 0 -> 74951 bytes .../files/vuduo2/splash_cfe_auto.bin | Bin 0 -> 1036856 bytes .../vuplus-bootlogo/files/vuplus-bootlogo.sysvinit | 31 + .../files/vusolo2/splash_cfe_auto.bin | Bin 0 -> 1036856 bytes .../files/vusolose/splash_cfe_auto.bin | Bin 0 -> 1036856 bytes .../files/vuultimo/splash_cfe_auto.bin | Bin 0 -> 1244216 bytes .../files/vuuno/splash_cfe_auto.bin | Bin 0 -> 1244216 bytes .../files/vuzero/splash_cfe_auto.bin | Bin 0 -> 1036856 bytes .../vuplus-bootlogo/vuplus-bootlogo-bm750.bb | 6 + .../vuplus-bootlogo/vuplus-bootlogo-vuduo2.bb | 19 + .../vuplus-bootlogo/vuplus-bootlogo-vusolo.bb | 6 + .../vuplus-bootlogo/vuplus-bootlogo-vusolo2.bb | 20 + .../vuplus-bootlogo/vuplus-bootlogo-vusolose.bb | 20 + .../vuplus-bootlogo/vuplus-bootlogo-vuultimo.bb | 13 + .../vuplus-bootlogo/vuplus-bootlogo-vuuno.bb | 13 + .../vuplus-bootlogo/vuplus-bootlogo-vuzero.bb | 19 + .../vuplus-bootlogo/vuplus-bootlogo.inc | 47 + .../vuplus-dvb-modules/vuplus-dvb-modules-bm750.bb | 10 + .../vuplus-dvb-modules-vuduo2.bb | 10 + .../vuplus-dvb-modules-vusolo.bb | 10 + .../vuplus-dvb-modules-vusolo2.bb | 10 + .../vuplus-dvb-modules-vusolose.bb | 10 + .../vuplus-dvb-modules-vuultimo.bb | 10 + .../vuplus-dvb-modules/vuplus-dvb-modules-vuuno.bb | 10 + .../vuplus-dvb-modules-vuzero.bb | 10 + .../vuplus-dvb-modules/vuplus-dvb-modules.inc | 36 + .../vuplus-dvb-proxy/vuplus-dvb-proxy-vuduo2.bb | 14 + .../vuplus-dvb-proxy/vuplus-dvb-proxy-vusolo2.bb | 13 + .../vuplus-dvb-proxy/vuplus-dvb-proxy-vusolose.bb | 13 + .../vuplus-dvb-proxy/vuplus-dvb-proxy.inc | 33 + .../vuplus-manual/vuplus-manual-vuduo2.bb | 9 + .../vuplus-manual/vuplus-manual-vusolo2.bb | 9 + .../vuplus-manual/vuplus-manual-vusolose.bb | 8 + .../vuplus-manual/vuplus-manual-vuzero.bb | 8 + .../recipes-vuplus/vuplus-manual/vuplus-manual.inc | 27 + .../files/vuplus-platform-util.sysvinit | 36 + .../vuplus-platform-util-vuduo2.bb | 9 + .../vuplus-platform-util-vusolo2.bb | 10 + .../vuplus-platform-util-vusolose.bb | 9 + .../vuplus-platform-util/vuplus-platform-util.inc | 41 + .../vuplus-tuner-turbo/vuplus-tuner-turbo.inc | 42 + .../vuplus-tuner-turbo_3.13.5.bb | 8 + .../vuplus-tuner-turbo_3.9.6-r1.bb | 10 + .../vuplus-tuner-turbo_3.9.6-r2.bb | 10 + meta-bsp/vuduo2/conf/layer.conf | 6 - meta-bsp/vuduo2/conf/machine/vuduo2.conf | 32 - .../bmips-no-array-bounds.patch | 13 - .../linux/linux-vuplus-2.6.37/vuduo2_defconfig | 2526 - .../linux/linux-vuplus-3.13.5/brcm_s3_wol.patch | 68 - .../linux/linux-vuplus-3.13.5/vuduo2_defconfig | 3001 - .../linux-vuplus-3.13.5/vuduo2_defconfig_proxy | 2863 - .../linux/linux-vuplus-3.3.8/brcm_s3_wol.patch | 89 - .../linux/linux-vuplus-3.3.8/nand_base.patch | 418 - .../linux/linux-vuplus-3.3.8/remove_genet1.patch | 16 - .../linux/linux-vuplus-3.3.8/vuduo2_defconfig | 2405 - .../recipes/linux/linux-vuplus_2.6.37.bbappend | 6 - .../recipes/linux/linux-vuplus_3.13.5.bbappend | 9 - .../recipes/linux/linux-vuplus_3.3.8.bbappend | 8 - meta-bsp/vuduo2/recipes/vuplus/enigma2.bbappend | 15 - .../recipes/vuplus/enigma2/skin_user_vuduo2.xml | 186 - .../vuplus/enigma2/vfd_icons_vuduo2/crypt.png | Bin 140 -> 0 bytes .../vuplus/enigma2/vfd_icons_vuduo2/dolby.png | Bin 149 -> 0 bytes .../vuplus/enigma2/vfd_icons_vuduo2/format.png | Bin 157 -> 0 bytes .../vuplus/enigma2/vfd_icons_vuduo2/rec.png | Bin 152 -> 0 bytes .../vuplus/enigma2/vfd_icons_vuduo2/teletext.png | Bin 128 -> 0 bytes meta-bsp/vuduo2/recipes/vuplus/libgles.bbappend | 6 - .../vuduo2/recipes/vuplus/vuplus-bootlogo.bbappend | 13 - .../vuplus/vuplus-bootlogo/initrd_cfe_auto.bin | Bin 5891168 -> 0 bytes .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1036856 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - .../recipes/vuplus/vuplus-dvb-proxy.bbappend | 10 - .../vuduo2/recipes/vuplus/vuplus-manual.bbappend | 5 - .../recipes/vuplus/vuplus-platform-util.bbappend | 6 - meta-bsp/vusolo/conf/layer.conf | 6 - meta-bsp/vusolo/conf/machine/vusolo.conf | 18 - .../linux-vuplus-3.1.1/fix_cpu_proc_solo.patch | 13 - .../linux-vuplus-3.1.1/linux_3.1.1_vusolo.patch | 164 - .../linux/linux-vuplus-3.1.1/vusolo_defconfig | 2679 - .../linux/linux-vuplus-3.9.6/vusolo_defconfig | 3113 - .../recipes/linux/linux-vuplus_3.1.1.bbappend | 8 - .../recipes/linux/linux-vuplus_3.9.6.bbappend | 6 - meta-bsp/vusolo/recipes/vuplus/enigma2.bbappend | 3 - .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - meta-bsp/vusolo2/conf/layer.conf | 6 - meta-bsp/vusolo2/conf/machine/vusolo2.conf | 31 - .../linux-vuplus-3.13.5/linux-bcm_ethernet.patch | 12 - .../linux/linux-vuplus-3.13.5/vusolo2_defconfig | 2994 - .../linux-vuplus-3.13.5/vusolo2_defconfig_proxy | 2856 - .../linux-vuplus-3.3.6/bmips-no-array-bounds.patch | 13 - .../linux/linux-vuplus-3.3.6/dvb_backport.patch | 1120953 ----------------- .../linux/linux-vuplus-3.3.6/vusolo2_defconfig | 2399 - .../linux/linux-vuplus-3.3.8/vusolo2_defconfig | 2399 - .../recipes/linux/linux-vuplus_3.13.5.bbappend | 10 - .../recipes/linux/linux-vuplus_3.3.6.bbappend | 6 - .../recipes/linux/linux-vuplus_3.3.8.bbappend | 4 - meta-bsp/vusolo2/recipes/vuplus/libgles.bbappend | 6 - .../recipes/vuplus/vuplus-bootlogo.bbappend | 14 - .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1036856 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - .../recipes/vuplus/vuplus-dvb-proxy.bbappend | 10 - .../vusolo2/recipes/vuplus/vuplus-manual.bbappend | 5 - .../recipes/vuplus/vuplus-platform-util.bbappend | 7 - meta-bsp/vusolose/conf/layer.conf | 6 - meta-bsp/vusolose/conf/machine/vusolose.conf | 31 - .../linux/linux-vuplus-3.13.5/brcm_s3_wol.patch | 67 - .../linux/linux-vuplus-3.13.5/vusolose_defconfig | 2998 - .../linux-vuplus-3.13.5/vusolose_defconfig_proxy | 2860 - .../recipes/linux/linux-vuplus_3.13.5.bbappend | 9 - meta-bsp/vusolose/recipes/vuplus/enigma2.bbappend | 8 - .../enigma2/enigma2_vuplus_remove_pvr_action.patch | 195 - meta-bsp/vusolose/recipes/vuplus/libgles.bbappend | 5 - .../recipes/vuplus/vuplus-bootlogo.bbappend | 15 - .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1036856 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - .../recipes/vuplus/vuplus-dvb-proxy.bbappend | 9 - .../vusolose/recipes/vuplus/vuplus-manual.bbappend | 4 - .../recipes/vuplus/vuplus-platform-util.bbappend | 5 - meta-bsp/vuultimo/conf/layer.conf | 6 - meta-bsp/vuultimo/conf/machine/vuultimo.conf | 26 - .../linux/linux-vuplus-3.1.1/vuultimo_defconfig | 2703 - .../linux/linux-vuplus-3.9.6/linux-sata_bcm.patch | 55 - .../linux-vuplus-3.9.6/vu_ultimo_fixed_mtd.patch | 43 - .../linux/linux-vuplus-3.9.6/vuultimo_defconfig | 3132 - .../recipes/linux/linux-vuplus_3.1.1.bbappend | 8 - .../recipes/linux/linux-vuplus_3.9.6.bbappend | 10 - meta-bsp/vuultimo/recipes/vuplus/enigma2.bbappend | 14 - .../recipes/vuplus/vuplus-bootlogo.bbappend | 9 - .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1244216 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - meta-bsp/vuuno/conf/layer.conf | 6 - meta-bsp/vuuno/conf/machine/vuuno.conf | 22 - .../linux-vuplus-3.1.1/linux_3.1.1_vuuno.patch | 43 - .../linux/linux-vuplus-3.1.1/vuuno_defconfig | 2703 - .../linux/linux-vuplus-3.9.6/linux-sata_bcm.patch | 55 - .../linux/linux-vuplus-3.9.6/vuuno_defconfig | 3132 - .../recipes/linux/linux-vuplus_3.1.1.bbappend | 8 - .../recipes/linux/linux-vuplus_3.9.6.bbappend | 7 - .../vuuno/recipes/vuplus/vuplus-bootlogo.bbappend | 9 - .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1244216 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - meta-bsp/vuzero/conf/layer.conf | 6 - meta-bsp/vuzero/conf/machine/vuzero.conf | 26 - .../linux/linux-vuplus-3.13.5/vuzero_defconfig | 2980 - .../recipes/linux/linux-vuplus_3.13.5.bbappend | 8 - meta-bsp/vuzero/recipes/vuplus/enigma2.bbappend | 8 - .../enigma2/enigma2_vuplus_remove_pvr_action.patch | 195 - .../vuzero/recipes/vuplus/vuplus-bootlogo.bbappend | 14 - .../vuplus/vuplus-bootlogo/splash_cfe_auto.bin | Bin 1036856 -> 0 bytes .../recipes/vuplus/vuplus-dvb-modules.bbappend | 6 - .../vuzero/recipes/vuplus/vuplus-manual.bbappend | 4 - .../recipes-graphics/libgles/libgles.bb | 27 - meta-openvuplus/recipes-vuplus/enigma2/enigma2.bb | 2 +- .../recipes-vuplus/enigma2/enigma2/analog.ttf | Bin 41168 -> 0 bytes .../enigma2/enigma2/enigma2_vuplus_misc.patch | 12 - .../recipes-vuplus/enigma2/enigma2/skin_user.xml | 243 - .../enigma2/enigma2/vfd_icons/vfd_icon_crypt.png | Bin 961 -> 0 bytes .../enigma2/enigma2/vfd_icons/vfd_icon_dolby.png | Bin 985 -> 0 bytes .../enigma2/enigma2/vfd_icons/vfd_icon_format.png | Bin 996 -> 0 bytes .../enigma2/enigma2/vfd_icons/vfd_icon_rec.png | Bin 1009 -> 0 bytes .../enigma2/enigma2/vfd_icons/vfd_icon_txt.png | Bin 975 -> 0 bytes .../recipes-vuplus/webmanual/vuplus-manual.bb | 24 - 313 files changed, 35584 insertions(+), 2304591 deletions(-) delete mode 100644 meta-bsp/bm750/conf/layer.conf delete mode 100644 meta-bsp/bm750/conf/machine/bm750.conf delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/bm750_defconfig delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_bm750.patch delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/bm750_defconfig delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus_3.1.1.bbappend delete mode 100644 meta-bsp/bm750/recipes/linux/linux-vuplus_3.9.6.bbappend delete mode 100644 meta-bsp/bm750/recipes/vuplus/vuplus-dvb-modules.bbappend create mode 100644 meta-bsp/classes/image_types_ubi.bbclass create mode 100644 meta-bsp/classes/image_types_ubi_initrd.bbclass create mode 100644 meta-bsp/classes/image_types_ubi_splash.bbclass create mode 100644 meta-bsp/classes/image_types_ubi_splash_initrd.bbclass create mode 100644 meta-bsp/classes/image_types_ubi_splash_initrd_forceupdate.bbclass delete mode 100644 meta-bsp/common/classes/image_types_ubi.bbclass delete mode 100644 meta-bsp/common/classes/image_types_ubi_initrd.bbclass delete mode 100644 meta-bsp/common/classes/image_types_ubi_splash.bbclass delete mode 100644 meta-bsp/common/classes/image_types_ubi_splash_initrd.bbclass delete mode 100644 meta-bsp/common/classes/image_types_ubi_splash_initrd_forceupdate.bbclass delete mode 100644 meta-bsp/common/conf/layer.conf delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-mips32el.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-ubi-initrd.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd-forceupdate.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-ubi-splash.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus-ubi.inc delete mode 100644 meta-bsp/common/conf/machine/include/vuplus.inc delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/bcmgenet_oobctrl.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_disable_enet1.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_mtd_mac.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/dvb-core.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/fix_cpu_proc.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/pinmux.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/serial.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/fix_cpu_proc.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/igmp.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/kernel_miscompilation_with_gcc_4_8.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/linux-sata_brcm.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/rt5372_kernel_3.1.1.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux-tcp_output.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux_dvb_adapter.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_3.3.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_mtd_mac.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_remove_entire_mtd.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/dvb_core_5.5.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/fix_cpu_proc.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/bmips-no-array-bounds.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_3.3.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_mtd_mac.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/dvb_backport.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/dvb_core_5.5.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/fix_cpu_proc.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/kernel_miscompilation_with_gcc_4_8.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/rt5372_kernel_3.3.8.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.9.6/fix_fuse_for_linux_mips_3-9.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus-3.9.6/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_2.6.37.bb delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_3.1.1.bb delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_3.13.5.bb delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_3.3.6.bb delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_3.3.8.bb delete mode 100644 meta-bsp/common/recipes/linux/linux-vuplus_3.9.6.bb delete mode 100755 meta-bsp/common/recipes/vuplus/vuplus-blindscan-utils.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo/backdrop.mvi delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo/bootlogo.mvi delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo/bootlogo_wait.mvi delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo/switchoff.mvi delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-bootlogo/vuplus-bootlogo.sysvinit delete mode 100755 meta-bsp/common/recipes/vuplus/vuplus-dvb-modules.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-dvb-proxy.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-platform-util.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-platform-util/vuplus-platform-util.sysvinit delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-tuner-turbo.inc delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-tuner-turbo_3.13.5.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-tuner-turbo_3.9.6-r1.bb delete mode 100644 meta-bsp/common/recipes/vuplus/vuplus-tuner-turbo_3.9.6-r2.bb create mode 100644 meta-bsp/conf/layer.conf create mode 100644 meta-bsp/conf/machine/bm750.conf create mode 100644 meta-bsp/conf/machine/include/vuplus-mips32el.inc create mode 100644 meta-bsp/conf/machine/include/vuplus-ubi-initrd.inc create mode 100644 meta-bsp/conf/machine/include/vuplus-ubi-splash-initrd-forceupdate.inc create mode 100644 meta-bsp/conf/machine/include/vuplus-ubi-splash-initrd.inc create mode 100644 meta-bsp/conf/machine/include/vuplus-ubi-splash.inc create mode 100644 meta-bsp/conf/machine/include/vuplus-ubi.inc create mode 100644 meta-bsp/conf/machine/include/vuplus.inc create mode 100644 meta-bsp/conf/machine/vuduo2.conf create mode 100644 meta-bsp/conf/machine/vusolo.conf create mode 100644 meta-bsp/conf/machine/vusolo2.conf create mode 100644 meta-bsp/conf/machine/vusolose.conf create mode 100644 meta-bsp/conf/machine/vuultimo.conf create mode 100644 meta-bsp/conf/machine/vuuno.conf create mode 100644 meta-bsp/conf/machine/vuzero.conf create mode 100644 meta-bsp/recipes-graphics/libgles/libgles-vuduo2.bb create mode 100644 meta-bsp/recipes-graphics/libgles/libgles-vusolo2.bb create mode 100644 meta-bsp/recipes-graphics/libgles/libgles-vusolose.bb create mode 100644 meta-bsp/recipes-graphics/libgles/libgles.inc create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5.inc create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/linux-tcp_output.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/linux_dvb_adapter.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuduo2/brcm_s3_wol.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuduo2/vuduo2_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuduo2/vuduo2_defconfig_proxy create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolo2/linux-bcm_ethernet.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolo2/vusolo2_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolo2/vusolo2_defconfig_proxy create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolose/brcm_s3_wol.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolose/vusolose_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vusolose/vusolose_defconfig_proxy create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.13.5/vuzero/vuzero_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6.inc create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/bm750/bm750_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/bm750/linux-sata_bcm.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/fix_fuse_for_linux_mips_3-9.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vusolo/vusolo_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vuultimo/linux-sata_bcm.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vuultimo/vu_ultimo_fixed_mtd.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vuultimo/vuultimo_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vuuno/linux-sata_bcm.patch create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-3.9.6/vuuno/vuuno_defconfig create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-bm750_3.9.6.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vuduo2_3.13.5.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vusolo2_3.13.5.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vusolo_3.9.6.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vusolose_3.13.5.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vuultimo_3.9.6.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vuuno_3.9.6.bb create mode 100644 meta-bsp/recipes-kernel/linux/linux-vuplus-vuzero_3.13.5.bb create mode 100644 meta-bsp/recipes-vuplus/enigma2/enigma2.bbappend create mode 100644 meta-bsp/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_misc.patch create mode 100644 meta-bsp/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_remove_pvr_action.patch create mode 100644 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/skin_user_vuduo2.xml create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/vfd_icons_vuduo2/crypt.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/vfd_icons_vuduo2/dolby.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/vfd_icons_vuduo2/format.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/vfd_icons_vuduo2/rec.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuduo2/vfd_icons_vuduo2/teletext.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/analog.ttf create mode 100644 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/skin_user.xml create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/vfd_icons/vfd_icon_crypt.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/vfd_icons/vfd_icon_dolby.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/vfd_icons/vfd_icon_format.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/vfd_icons/vfd_icon_rec.png create mode 100755 meta-bsp/recipes-vuplus/enigma2/enigma2/vuultimo/vfd_icons/vfd_icon_txt.png create mode 100755 meta-bsp/recipes-vuplus/vuplus-blindscan-utils/vuplus-blindscan-utils.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/backdrop.mvi create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/bootlogo.mvi create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/bootlogo_wait.mvi create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/switchoff.mvi create mode 100755 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vuduo2/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vuplus-bootlogo.sysvinit create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vusolo2/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vusolose/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vuultimo/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vuuno/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/files/vuzero/splash_cfe_auto.bin create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-bm750.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vuduo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vusolo.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vusolo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vusolose.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vuultimo.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vuuno.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo-vuzero.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-bootlogo/vuplus-bootlogo.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-bm750.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vuduo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vusolo.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vusolo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vusolose.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vuultimo.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vuuno.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules-vuzero.bb create mode 100755 meta-bsp/recipes-vuplus/vuplus-dvb-modules/vuplus-dvb-modules.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-proxy/vuplus-dvb-proxy-vuduo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-proxy/vuplus-dvb-proxy-vusolo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-proxy/vuplus-dvb-proxy-vusolose.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-dvb-proxy/vuplus-dvb-proxy.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-manual/vuplus-manual-vuduo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-manual/vuplus-manual-vusolo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-manual/vuplus-manual-vusolose.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-manual/vuplus-manual-vuzero.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-manual/vuplus-manual.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-platform-util/files/vuplus-platform-util.sysvinit create mode 100644 meta-bsp/recipes-vuplus/vuplus-platform-util/vuplus-platform-util-vuduo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-platform-util/vuplus-platform-util-vusolo2.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-platform-util/vuplus-platform-util-vusolose.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-platform-util/vuplus-platform-util.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-tuner-turbo/vuplus-tuner-turbo.inc create mode 100644 meta-bsp/recipes-vuplus/vuplus-tuner-turbo/vuplus-tuner-turbo_3.13.5.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-tuner-turbo/vuplus-tuner-turbo_3.9.6-r1.bb create mode 100644 meta-bsp/recipes-vuplus/vuplus-tuner-turbo/vuplus-tuner-turbo_3.9.6-r2.bb delete mode 100644 meta-bsp/vuduo2/conf/layer.conf delete mode 100644 meta-bsp/vuduo2/conf/machine/vuduo2.conf delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-2.6.37/bmips-no-array-bounds.patch delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-2.6.37/vuduo2_defconfig delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.13.5/brcm_s3_wol.patch delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.13.5/vuduo2_defconfig delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.13.5/vuduo2_defconfig_proxy delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.3.8/brcm_s3_wol.patch delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.3.8/nand_base.patch delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.3.8/remove_genet1.patch delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus-3.3.8/vuduo2_defconfig delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus_2.6.37.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus_3.13.5.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/linux/linux-vuplus_3.3.8.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/enigma2.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/enigma2/skin_user_vuduo2.xml delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/enigma2/vfd_icons_vuduo2/crypt.png delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/enigma2/vfd_icons_vuduo2/dolby.png delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/enigma2/vfd_icons_vuduo2/format.png delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/enigma2/vfd_icons_vuduo2/rec.png delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/enigma2/vfd_icons_vuduo2/teletext.png delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/libgles.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-bootlogo/initrd_cfe_auto.bin delete mode 100755 meta-bsp/vuduo2/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-dvb-proxy.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-manual.bbappend delete mode 100644 meta-bsp/vuduo2/recipes/vuplus/vuplus-platform-util.bbappend delete mode 100644 meta-bsp/vusolo/conf/layer.conf delete mode 100644 meta-bsp/vusolo/conf/machine/vusolo.conf delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus-3.1.1/fix_cpu_proc_solo.patch delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_vusolo.patch delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus-3.1.1/vusolo_defconfig delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus-3.9.6/vusolo_defconfig delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus_3.1.1.bbappend delete mode 100644 meta-bsp/vusolo/recipes/linux/linux-vuplus_3.9.6.bbappend delete mode 100644 meta-bsp/vusolo/recipes/vuplus/enigma2.bbappend delete mode 100644 meta-bsp/vusolo/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vusolo2/conf/layer.conf delete mode 100644 meta-bsp/vusolo2/conf/machine/vusolo2.conf delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.13.5/linux-bcm_ethernet.patch delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.13.5/vusolo2_defconfig delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.13.5/vusolo2_defconfig_proxy delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.3.6/bmips-no-array-bounds.patch delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.3.6/dvb_backport.patch delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.3.6/vusolo2_defconfig delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus-3.3.8/vusolo2_defconfig delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus_3.13.5.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus_3.3.6.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/linux/linux-vuplus_3.3.8.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/libgles.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-dvb-proxy.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-manual.bbappend delete mode 100644 meta-bsp/vusolo2/recipes/vuplus/vuplus-platform-util.bbappend delete mode 100644 meta-bsp/vusolose/conf/layer.conf delete mode 100644 meta-bsp/vusolose/conf/machine/vusolose.conf delete mode 100644 meta-bsp/vusolose/recipes/linux/linux-vuplus-3.13.5/brcm_s3_wol.patch delete mode 100644 meta-bsp/vusolose/recipes/linux/linux-vuplus-3.13.5/vusolose_defconfig delete mode 100644 meta-bsp/vusolose/recipes/linux/linux-vuplus-3.13.5/vusolose_defconfig_proxy delete mode 100644 meta-bsp/vusolose/recipes/linux/linux-vuplus_3.13.5.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/enigma2.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/enigma2/enigma2_vuplus_remove_pvr_action.patch delete mode 100644 meta-bsp/vusolose/recipes/vuplus/libgles.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-dvb-proxy.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-manual.bbappend delete mode 100644 meta-bsp/vusolose/recipes/vuplus/vuplus-platform-util.bbappend delete mode 100644 meta-bsp/vuultimo/conf/layer.conf delete mode 100644 meta-bsp/vuultimo/conf/machine/vuultimo.conf delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.1.1/vuultimo_defconfig delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/vu_ultimo_fixed_mtd.patch delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus-3.9.6/vuultimo_defconfig delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus_3.1.1.bbappend delete mode 100644 meta-bsp/vuultimo/recipes/linux/linux-vuplus_3.9.6.bbappend delete mode 100644 meta-bsp/vuultimo/recipes/vuplus/enigma2.bbappend delete mode 100644 meta-bsp/vuultimo/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vuultimo/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vuultimo/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vuuno/conf/layer.conf delete mode 100644 meta-bsp/vuuno/conf/machine/vuuno.conf delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_vuuno.patch delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus-3.1.1/vuuno_defconfig delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus-3.9.6/vuuno_defconfig delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus_3.1.1.bbappend delete mode 100644 meta-bsp/vuuno/recipes/linux/linux-vuplus_3.9.6.bbappend delete mode 100644 meta-bsp/vuuno/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vuuno/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vuuno/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vuzero/conf/layer.conf delete mode 100644 meta-bsp/vuzero/conf/machine/vuzero.conf delete mode 100644 meta-bsp/vuzero/recipes/linux/linux-vuplus-3.13.5/vuzero_defconfig delete mode 100644 meta-bsp/vuzero/recipes/linux/linux-vuplus_3.13.5.bbappend delete mode 100644 meta-bsp/vuzero/recipes/vuplus/enigma2.bbappend delete mode 100644 meta-bsp/vuzero/recipes/vuplus/enigma2/enigma2_vuplus_remove_pvr_action.patch delete mode 100644 meta-bsp/vuzero/recipes/vuplus/vuplus-bootlogo.bbappend delete mode 100644 meta-bsp/vuzero/recipes/vuplus/vuplus-bootlogo/splash_cfe_auto.bin delete mode 100644 meta-bsp/vuzero/recipes/vuplus/vuplus-dvb-modules.bbappend delete mode 100644 meta-bsp/vuzero/recipes/vuplus/vuplus-manual.bbappend delete mode 100644 meta-openvuplus/recipes-graphics/libgles/libgles.bb delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/analog.ttf delete mode 100644 meta-openvuplus/recipes-vuplus/enigma2/enigma2/enigma2_vuplus_misc.patch delete mode 100644 meta-openvuplus/recipes-vuplus/enigma2/enigma2/skin_user.xml delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/vfd_icons/vfd_icon_crypt.png delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/vfd_icons/vfd_icon_dolby.png delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/vfd_icons/vfd_icon_format.png delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/vfd_icons/vfd_icon_rec.png delete mode 100755 meta-openvuplus/recipes-vuplus/enigma2/enigma2/vfd_icons/vfd_icon_txt.png delete mode 100644 meta-openvuplus/recipes-vuplus/webmanual/vuplus-manual.bb diff --git a/Makefile b/Makefile index a8e7a31..8a7374b 100644 --- a/Makefile +++ b/Makefile @@ -56,8 +56,7 @@ DEPDIR = $(BUILD_DIR)/.deps endif BBLAYERS ?= \ - $(CURDIR)/meta-bsp/$(MACHINE) \ - $(CURDIR)/meta-bsp/common \ + $(CURDIR)/meta-bsp \ $(CURDIR)/meta-openvuplus \ $(CURDIR)/meta-openembedded/meta-oe \ $(CURDIR)/meta-openembedded/meta-networking \ diff --git a/meta-bsp/bm750/conf/layer.conf b/meta-bsp/bm750/conf/layer.conf deleted file mode 100644 index 87ed4cb..0000000 --- a/meta-bsp/bm750/conf/layer.conf +++ /dev/null @@ -1,6 +0,0 @@ -BBFILES += "${LAYERDIR}/recipes/*/*.bb" -BBFILES += "${LAYERDIR}/recipes/*/*.bbappend" -BBPATH .= ":${LAYERDIR}" -BBFILE_COLLECTIONS += "bm750" -BBFILE_PRIORITY_bm750 = "40" -BBFILE_PATTERN_bm750 := "^${LAYERDIR}/" diff --git a/meta-bsp/bm750/conf/machine/bm750.conf b/meta-bsp/bm750/conf/machine/bm750.conf deleted file mode 100644 index 430920b..0000000 --- a/meta-bsp/bm750/conf/machine/bm750.conf +++ /dev/null @@ -1,20 +0,0 @@ -#@TYPE: Machine -#@NAME: Vu+ Duo -#@DESCRIPTION: Machine configuration for Vu+ Duo. - -VUPLUS_FEATURES += "vuwlan" -VUPLUS_FEATURES += "display-text-vfd" -VUPLUS_FEATURES += "fan_simple" -VUPLUS_FEATURES += "hbbtv" -VUPLUS_FEATURES += "streamtv" -VUPLUS_FEATURES += "dlna" -VUPLUS_FEATURES += "3gmodem" -VUPLUS_FEATURES += "audioeffect" - -IMAGE_UNPACK_PATH = "vuplus/duo" -MKFS_UBI_MAX_ERASE_BLK_COUNT = "4096" - -require conf/machine/include/vuplus-ubi.inc -require conf/machine/include/vuplus-mips32el.inc - -VUPLUS_KERNEL_VERSION = "3.9.6" diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/bm750_defconfig b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/bm750_defconfig deleted file mode 100644 index a82a620..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/bm750_defconfig +++ /dev/null @@ -1,2691 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/mips 3.1.1 Kernel Configuration -# -CONFIG_MIPS=y - -# -# Machine selection -# -# CONFIG_MIPS_ALCHEMY is not set -# CONFIG_AR7 is not set -# CONFIG_ATH79 is not set -# CONFIG_BCM47XX is not set -# CONFIG_BCM63XX is not set -CONFIG_BRCMSTB=y -# CONFIG_MIPS_COBALT is not set -# CONFIG_MACH_DECSTATION is not set -# CONFIG_MACH_JAZZ is not set -# CONFIG_MACH_JZ4740 is not set -# CONFIG_LANTIQ is not set -# CONFIG_LASAT is not set -# CONFIG_MACH_LOONGSON is not set -# CONFIG_MIPS_MALTA is not set -# CONFIG_MIPS_SIM is not set -# CONFIG_NEC_MARKEINS is not set -# CONFIG_MACH_VR41XX is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set -# CONFIG_PNX8550_JBS is not set -# CONFIG_PNX8550_STB810 is not set -# CONFIG_PMC_MSP is not set -# CONFIG_PMC_YOSEMITE is not set -# CONFIG_POWERTV is not set -# CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP27 is not set -# CONFIG_SGI_IP28 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SIBYTE_CRHINE is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHONE is not set -# CONFIG_SIBYTE_RHONE is not set -# CONFIG_SIBYTE_SWARM is not set -# CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_SENTOSA is not set -# CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SNI_RM is not set -# CONFIG_MACH_TX39XX is not set -# CONFIG_MACH_TX49XX is not set -# CONFIG_MIKROTIK_RB532 is not set -# CONFIG_WR_PPMC is not set -# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set -# CONFIG_NLM_XLR_BOARD is not set -# CONFIG_ALCHEMY_GPIO_INDIRECT is not set - -# -# Broadcom STB options -# -# CONFIG_BRCM_LEGACY is not set -# CONFIG_BCM3548B0 is not set -# CONFIG_BCM35125A0 is not set -# CONFIG_BCM35230C0 is not set -# CONFIG_BCM35330A0 is not set -# CONFIG_BCM7125C0 is not set -# CONFIG_BCM7135A0 is not set -# CONFIG_BCM7231A0 is not set -# CONFIG_BCM7325B0 is not set -CONFIG_BCM7335B0=y -# CONFIG_BCM7340B0 is not set -# CONFIG_BCM7342B0 is not set -# CONFIG_BCM7344A0 is not set -# CONFIG_BCM7346A0 is not set -# CONFIG_BCM7358A0 is not set -# CONFIG_BCM7405B0 is not set -# CONFIG_BCM7405D0 is not set -# CONFIG_BCM7408B0 is not set -# CONFIG_BCM7420C0 is not set -# CONFIG_BCM7422A0 is not set -# CONFIG_BCM7425A0 is not set -# CONFIG_BCM7468B0 is not set -# CONFIG_BCM7550A0 is not set -# CONFIG_BCM7550B0 is not set -# CONFIG_BCM7552A0 is not set -# CONFIG_BCM7601B0 is not set -# CONFIG_BCM7630B0 is not set -# CONFIG_BCM7631B0 is not set -# CONFIG_BCM7635A0 is not set -# CONFIG_BCM7640A0 is not set - -# -# Memory map -# -# CONFIG_BRCM_UPPER_MEMORY is not set -# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set - -# -# Onchip peripherals -# -CONFIG_BRCM_CONSOLE_DEVICE=0 -CONFIG_BRCM_FLASH=y -CONFIG_BRCM_FIXED_MTD_PARTITIONS=y -CONFIG_MTD_BRCMNAND=y -CONFIG_BRCMNAND_MTD_EXTENSION=y -# CONFIG_MTD_BRCMNAND_VERIFY_WRITE is not set -# CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING is not set -CONFIG_BCMEMAC=y -CONFIG_SATA_BRCMSTB=y -CONFIG_BRCM_USB=y -# CONFIG_BRCM_OVERRIDE_USB is not set -CONFIG_BRCM_PM=y -CONFIG_CSRC_UPG=y - -# -# Miscellaneous options -# -# CONFIG_BRCM_FORCE_DOCSIS is not set -CONFIG_BRCM_LIBGCC=y -# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set -# CONFIG_BRCM_DEBUG_OPTIONS is not set -CONFIG_BMIPS4380=y -CONFIG_BRCM_HAS_16550=y -CONFIG_BRCM_HAS_UARTA=y -CONFIG_BRCM_HAS_UARTB=y -CONFIG_BRCM_HAS_UARTC=y -CONFIG_BRCM_UARTA_IS_16550=y -CONFIG_BRCM_UARTB_IS_16550=y -CONFIG_BRCM_UARTC_IS_16550=y -CONFIG_BRCM_HAS_PCI23=y -CONFIG_BRCM_HAS_EMAC_0=y -CONFIG_BRCM_HAS_EMAC_1=y -CONFIG_BRCM_HAS_SATA=y -CONFIG_BRCM_HAS_SATA2=y -# CONFIG_BRCM_SATA_75MHZ_PLL is not set -# CONFIG_BRCM_SATA_SINGLE_PORT is not set -CONFIG_BRCM_HAS_NOR=y -CONFIG_BRCM_HAS_NAND_MINOR_1=y -CONFIG_BRCM_HAS_NAND_MAJOR_2=y -CONFIG_BRCMNAND_MAJOR_VERS=2 -CONFIG_BRCMNAND_MINOR_VERS=1 -CONFIG_BRCM_HAS_NAND=y -CONFIG_BRCM_CPU_DIV=y -CONFIG_BRCM_HAS_UPPER_MEMORY=y -CONFIG_BRCM_HAS_1GB_MEMC0=y -CONFIG_BRCM_PLATFORM_DEFAULTS=y -CONFIG_BCM7335=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_ARCH_SUPPORTS_OPROFILE=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_SCHED_OMIT_FRAME_POINTER=y -CONFIG_BOOT_RAW=y -CONFIG_CEVT_R4K_LIB=y -CONFIG_CEVT_R4K=y -CONFIG_CFE=y -# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set -CONFIG_DMA_NONCOHERENT=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_SYS_HAS_EARLY_PRINTK=y -# CONFIG_HOTPLUG_CPU is not set -CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y -# CONFIG_MIPS_MACHINE is not set -# CONFIG_NO_IOPORT is not set -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -CONFIG_IRQ_CPU=y -CONFIG_SWAP_IO_SPACE=y -CONFIG_MIPS_L1_CACHE_SHIFT=5 - -# -# CPU selection -# -CONFIG_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_WEAK_ORDERING=y -CONFIG_CPU_MIPS32=y -CONFIG_CPU_MIPSR1=y -CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_HARDWARE_WATCHPOINTS=y - -# -# Kernel type -# -CONFIG_32BIT=y -CONFIG_PAGE_SIZE_4KB=y -# CONFIG_PAGE_SIZE_16KB is not set -# CONFIG_PAGE_SIZE_64KB is not set -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_MIPS_MT_DISABLED=y -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_CPU_HAS_SYNC=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_POPULATES_NODE_MAP=y -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_COMPACTION is not set -# CONFIG_PHYS_ADDR_T_64BIT is not set -CONFIG_ZONE_DMA_FLAG=0 -CONFIG_VIRT_TO_BUS=y -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -# CONFIG_CLEANCACHE is not set -CONFIG_SMP=y -CONFIG_SYS_SUPPORTS_SMP=y -CONFIG_NR_CPUS=2 -CONFIG_TICK_ONESHOT=y -# CONFIG_NO_HZ is not set -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -# CONFIG_HZ_48 is not set -# CONFIG_HZ_100 is not set -# CONFIG_HZ_128 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_256 is not set -CONFIG_HZ_1000=y -# CONFIG_HZ_1024 is not set -CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_HZ=1000 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_KEXEC is not set -# CONFIG_SECCOMP is not set -# CONFIG_USE_OF is not set -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_HAVE_IRQ_WORK=y - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_DEFAULT_HOSTNAME="(none)" -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_FHANDLE is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_GENERIC_HARDIRQS=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_HARDIRQS=y -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_IRQ_FORCED_THREADING=y - -# -# RCU Subsystem -# -CONFIG_TREE_RCU=y -# CONFIG_PREEMPT_RCU is not set -# CONFIG_RCU_TRACE is not set -CONFIG_RCU_FANOUT=32 -# CONFIG_RCU_FANOUT_EXACT is not set -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -# CONFIG_NAMESPACES is not set -# CONFIG_SCHED_AUTOGROUP is not set -#CONFIG_SYSFS_DEPRECATED is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -# CONFIG_RD_BZIP2 is not set -# CONFIG_RD_LZMA is not set -# CONFIG_RD_XZ is not set -# CONFIG_RD_LZO is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_EXPERT=y -CONFIG_SYSCTL_SYSCALL=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -# CONFIG_PERF_EVENTS is not set -# CONFIG_PERF_COUNTERS is not set -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PCI_QUIRKS=y -CONFIG_COMPAT_BRK=y -CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -# CONFIG_JUMP_LABEL is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_USE_GENERIC_SMP_HELPERS=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y - -# -# GCOV-based kernel profiling -# -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_STOP_MACHINE=y -CONFIG_BLOCK=y -CONFIG_LBDAF=y -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_DEADLINE is not set -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="cfq" -# CONFIG_INLINE_SPIN_TRYLOCK is not set -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK is not set -# CONFIG_INLINE_SPIN_LOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -CONFIG_INLINE_SPIN_UNLOCK=y -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_READ_TRYLOCK is not set -# CONFIG_INLINE_READ_LOCK is not set -# CONFIG_INLINE_READ_LOCK_BH is not set -# CONFIG_INLINE_READ_LOCK_IRQ is not set -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -CONFIG_INLINE_READ_UNLOCK=y -# CONFIG_INLINE_READ_UNLOCK_BH is not set -CONFIG_INLINE_READ_UNLOCK_IRQ=y -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_WRITE_TRYLOCK is not set -# CONFIG_INLINE_WRITE_LOCK is not set -# CONFIG_INLINE_WRITE_LOCK_BH is not set -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -CONFIG_INLINE_WRITE_UNLOCK=y -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set -CONFIG_MUTEX_SPIN_ON_OWNER=y -# CONFIG_FREEZER is not set - -# -# Bus options (PCI, PCMCIA, EISA, ISA, TC) -# -CONFIG_HW_HAS_PCI=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -# CONFIG_ARCH_SUPPORTS_MSI is not set -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_IOV is not set -CONFIG_MMU=y -# CONFIG_PCCARD is not set -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_RAPIDIO is not set - -# -# Executable file formats -# -CONFIG_BINFMT_ELF=y -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_TRAD_SIGNALS=y - -# -# Power management options -# -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_SUSPEND is not set -# CONFIG_HIBERNATION is not set -# CONFIG_PM_RUNTIME is not set -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -CONFIG_XFRM_IPCOMP=m -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -CONFIG_IP_PNP_RARP=y -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -CONFIG_INET_TUNNEL=m -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -CONFIG_IPV6=m -CONFIG_IPV6_PRIVACY=y -CONFIG_IPV6_ROUTER_PREF=y -# CONFIG_IPV6_ROUTE_INFO is not set -# CONFIG_IPV6_OPTIMISTIC_DAD is not set -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_INET6_XFRM_MODE_TRANSPORT=m -CONFIG_INET6_XFRM_MODE_TUNNEL=m -CONFIG_INET6_XFRM_MODE_BEET=m -CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m -CONFIG_IPV6_SIT=m -# CONFIG_IPV6_SIT_6RD is not set -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -# CONFIG_IPV6_MULTIPLE_TABLES is not set -CONFIG_IPV6_MROUTE=y -# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set -CONFIG_IPV6_PIMSM_V2=y -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_BRIDGE=m -#CONFIG_BRIDGE_IGMP_SNOOPING is not set -# CONFIG_NET_DSA is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -# CONFIG_BATMAN_ADV is not set -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_XPS=y - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -CONFIG_BT=m -CONFIG_BT_L2CAP=y -# CONFIG_BT_SCO is not set -CONFIG_BT_RFCOMM=m -CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_BNEP=m -# CONFIG_BT_BNEP_MC_FILTER is not set -CONFIG_BT_BNEP_PROTO_FILTER=y -CONFIG_BT_HIDP=m - -# -# Bluetooth device drivers -# -CONFIG_BT_HCIBTUSB=m -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_H4=y -CONFIG_BT_HCIUART_BCSP=y -# CONFIG_BT_HCIUART_ATH3K is not set -CONFIG_BT_HCIUART_LL=y -CONFIG_BT_HCIBCM203X=m -CONFIG_BT_HCIBPA10X=m -CONFIG_BT_HCIBFUSB=m -CONFIG_BT_HCIVHCI=m -# CONFIG_BT_MRVL is not set -# CONFIG_BT_ATH3K is not set -# CONFIG_AF_RXRPC is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_SPY=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=y -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_REG_DEBUG is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_INTERNAL_REGDB is not set -CONFIG_CFG80211_WEXT=y -CONFIG_WIRELESS_EXT_SYSFS=y -CONFIG_LIB80211=y -CONFIG_LIB80211_CRYPT_WEP=m -CONFIG_LIB80211_CRYPT_CCMP=m -CONFIG_LIB80211_CRYPT_TKIP=m -# CONFIG_LIB80211_DEBUG is not set -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -# CONFIG_MAC80211_RC_PID is not set -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_MINSTREL_HT=y -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -# CONFIG_MAC80211_MESH is not set -CONFIG_MAC80211_LEDS=y -# CONFIG_MAC80211_DEBUG_MENU is not set -# CONFIG_WIMAX is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_EXTRA_FIRMWARE="" -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_DEBUG is not set -# CONFIG_MTD_TESTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_CMDLINE_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_SWAP is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -CONFIG_MTD_ROM=y -CONFIG_MTD_ABSENT=y - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP=y -# CONFIG_MTD_PHYSMAP_COMPAT is not set -# CONFIG_MTD_INTEL_VR_NOR is not set -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -CONFIG_MTD_NAND_ECC=y -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND=y -# CONFIG_MTD_NAND_VERIFY_WRITE is not set -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_NAND_MUSEUM_IDS is not set -# CONFIG_MTD_NAND_DENALI is not set -CONFIG_MTD_NAND_IDS=y -# CONFIG_MTD_NAND_RICOH is not set -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_CAFE is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_ALAUDA is not set -# CONFIG_MTD_ONENAND is not set - -# -# LPDDR flash memory drivers -# -# CONFIG_MTD_LPDDR is not set -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_RESERVE=1 -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_MTD_UBI_DEBUG is not set -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set - -# -# DRBD disabled because PROC_FS, INET or CONNECTOR not selected -# -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_SX8 is not set -# CONFIG_BLK_DEV_UB is not set -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_BLK_DEV_XIP is not set -# CONFIG_CDROM_PKTCDVD is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_BLK_DEV_HD is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_SENSORS_LIS3LV02D is not set -CONFIG_MISC_DEVICES=y -# CONFIG_AD525X_DPOT is not set -# CONFIG_PHANTOM is not set -# CONFIG_INTEL_MID_PTI is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1780 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_BMP085 is not set -# CONFIG_PCH_PHUB is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -CONFIG_EEPROM_93CX6=y -# CONFIG_CB710_CORE is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_SENSORS_LIS3_I2C is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -CONFIG_BLK_DEV_SR=y -# CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set -CONFIG_SCSI_WAIT_SCAN=m - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_SCSI_BNX2X_FCOE is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_LIBFC is not set -# CONFIG_LIBFCOE is not set -# CONFIG_FCOE is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_PMCRAID is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_SRP is not set -# CONFIG_SCSI_BFA_FC is not set -# CONFIG_SCSI_DH is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_SATA_PMP=y - -# -# Controllers with non-SFF native interface -# -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -# CONFIG_SATA_SIL24 is not set -CONFIG_ATA_SFF=y - -# -# SFF controllers with custom DMA interface -# -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_SX4 is not set -CONFIG_ATA_BMDMA=y - -# -# SATA SFF controllers with BMDMA -# -# CONFIG_ATA_PIIX is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_SVW is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set - -# -# PATA SFF controllers with BMDMA -# -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_ATP867X is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CS5536 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_MARVELL is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RDC is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SCH is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_TOSHIBA is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set - -# -# PIO-only SFF controllers -# -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_PATA_RZ1000 is not set - -# -# Generic fallback / legacy drivers -# -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_LEGACY is not set -# CONFIG_MD is not set -# CONFIG_TARGET_CORE is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# CONFIG_I2O is not set -CONFIG_NETDEVICES=y -# CONFIG_DUMMY is not set -# CONFIG_BONDING is not set -# CONFIG_MACVLAN is not set -# CONFIG_EQUALIZER is not set -CONFIG_TUN=m -# CONFIG_VETH is not set -# CONFIG_ARCNET is not set -CONFIG_MII=y -# CONFIG_PHYLIB is not set -CONFIG_NET_ETHERNET=y -# CONFIG_AX88796 is not set -# CONFIG_HAPPYMEAL is not set -# CONFIG_SUNGEM is not set -# CONFIG_CASSINI is not set -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_SMC91X is not set -# CONFIG_DM9000 is not set -# CONFIG_ETHOC is not set -# CONFIG_SMSC911X is not set -# CONFIG_DNET is not set -# CONFIG_NET_TULIP is not set -# CONFIG_HP100 is not set -# CONFIG_IBM_NEW_EMAC_ZMII is not set -# CONFIG_IBM_NEW_EMAC_RGMII is not set -# CONFIG_IBM_NEW_EMAC_TAH is not set -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set -# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set -# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set -# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set -# CONFIG_NET_PCI is not set -# CONFIG_B44 is not set -# CONFIG_KS8851_MLL is not set -# CONFIG_ATL2 is not set -CONFIG_NETDEV_1000=y -# CONFIG_ACENIC is not set -# CONFIG_DL2K is not set -# CONFIG_E1000 is not set -# CONFIG_E1000E is not set -# CONFIG_IP1000 is not set -# CONFIG_IGB is not set -# CONFIG_IGBVF is not set -# CONFIG_NS83820 is not set -# CONFIG_HAMACHI is not set -# CONFIG_YELLOWFIN is not set -# CONFIG_R8169 is not set -# CONFIG_SIS190 is not set -# CONFIG_SKGE is not set -# CONFIG_SKY2 is not set -# CONFIG_VIA_VELOCITY is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set -# CONFIG_QLA3XXX is not set -# CONFIG_ATL1 is not set -# CONFIG_ATL1E is not set -# CONFIG_ATL1C is not set -# CONFIG_JME is not set -# CONFIG_STMMAC_ETH is not set -# CONFIG_PCH_GBE is not set -# CONFIG_NETDEV_10000 is not set -# CONFIG_TR is not set -CONFIG_WLAN=y -CONFIG_LIBERTAS_THINFIRM=m -# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set -CONFIG_LIBERTAS_THINFIRM_USB=m -# CONFIG_ATMEL is not set -CONFIG_AT76C50X_USB=m -# CONFIG_PRISM54 is not set -CONFIG_USB_ZD1201=y -# CONFIG_USB_NET_RNDIS_WLAN is not set -# CONFIG_RTL8180 is not set -CONFIG_RTL8187=m -CONFIG_RTL8187_LEDS=y -# CONFIG_ADM8211 is not set -# CONFIG_MAC80211_HWSIM is not set -# CONFIG_MWL8K is not set -CONFIG_ATH_COMMON=m -# CONFIG_ATH_DEBUG is not set -# CONFIG_ATH5K is not set -# CONFIG_ATH5K_PCI is not set -CONFIG_ATH9K_HW=m -CONFIG_ATH9K_COMMON=m -CONFIG_ATH9K=m -# CONFIG_ATH9K_PCI is not set -# CONFIG_ATH9K_AHB is not set -CONFIG_ATH9K_RATE_CONTROL=y -CONFIG_ATH9K_HTC=m -CONFIG_CARL9170=m -CONFIG_CARL9170_LEDS=y -CONFIG_CARL9170_WPC=y -# CONFIG_B43 is not set -# CONFIG_B43LEGACY is not set -CONFIG_HOSTAP=m -CONFIG_HOSTAP_FIRMWARE=y -# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set -# CONFIG_HOSTAP_PLX is not set -# CONFIG_HOSTAP_PCI is not set -# CONFIG_IPW2100 is not set -# CONFIG_IPW2200 is not set -# CONFIG_IWLAGN is not set -# CONFIG_IWL4965 is not set -# CONFIG_IWL3945 is not set -CONFIG_LIBERTAS=m -# CONFIG_LIBERTAS_USB is not set -# CONFIG_LIBERTAS_DEBUG is not set -# CONFIG_LIBERTAS_MESH is not set -# CONFIG_HERMES is not set -CONFIG_P54_COMMON=m -# CONFIG_P54_USB is not set -# CONFIG_P54_PCI is not set -CONFIG_P54_LEDS=y -CONFIG_RT2X00=m -# CONFIG_RT2400PCI is not set -# CONFIG_RT2500PCI is not set -# CONFIG_RT61PCI is not set -# CONFIG_RT2800PCI is not set -CONFIG_RT2500USB=m -CONFIG_RT73USB=m -CONFIG_RT2800USB=m -CONFIG_RT2800USB_RT33XX=y -CONFIG_RT2800USB_RT35XX=y -CONFIG_RT2800USB_RT53XX=y -CONFIG_RT2800USB_UNKNOWN=y -CONFIG_RT2800_LIB=m -CONFIG_RT2X00_LIB_USB=m -CONFIG_RT2X00_LIB=m -CONFIG_RT2X00_LIB_FIRMWARE=y -CONFIG_RT2X00_LIB_CRYPTO=y -CONFIG_RT2X00_LIB_LEDS=y -# CONFIG_RT2X00_DEBUG is not set -# CONFIG_RTL8192CE is not set -# CONFIG_RTL8192SE is not set -# CONFIG_RTL8192DE is not set -CONFIG_RTL8192CU=m -CONFIG_RTLWIFI=m -CONFIG_RTL8192C_COMMON=m -CONFIG_WL1251=m -# CONFIG_WL12XX_MENU is not set -CONFIG_ZD1211RW=m -# CONFIG_ZD1211RW_DEBUG is not set -CONFIG_MWIFIEX=y - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -# CONFIG_USB_USBNET is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_WAN is not set - -# -# CAIF transport drivers -# -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PPP=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPP_FILTER=y -CONFIG_PPP_ASYNC=m -CONFIG_PPP_SYNC_TTY=m -CONFIG_PPP_DEFLATE=m -CONFIG_PPP_BSDCOMP=m -CONFIG_PPP_MPPE=m -CONFIG_PPPOE=m -# CONFIG_SLIP is not set -CONFIG_SLHC=m -# CONFIG_NET_FC is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -# CONFIG_VMXNET3 is not set -# CONFIG_ISDN is not set -# CONFIG_PHONE is not set - -# -# Input device support -# -CONFIG_INPUT=y -# CONFIG_INPUT_FF_MEMLESS is not set -CONFIG_INPUT_POLLDEV=m -# CONFIG_INPUT_SPARSEKMAP is not set - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=y -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -# CONFIG_KEYBOARD_ATKBD is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MCS is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -CONFIG_INPUT_MOUSE=y -# CONFIG_MOUSE_PS2 is not set -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_NOZOMI is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVKMEM=y - -# -# Serial drivers -# -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_MFD_HSU is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_TIMBERDALE is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_PCH_UART is not set -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=y -# CONFIG_HW_RANDOM_TIMERIOMEM is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -# CONFIG_RAMOOPS is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -CONFIG_I2C_HELPER_AUTO=y - -# -# I2C Hardware Bus support -# - -# -# PC SMBus host controller drivers -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_INTEL_MID is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set -# CONFIG_I2C_EG20T is not set - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_SPI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# - -# -# Enable Device Drivers -> PPS to see the PTP clock options. -# -# CONFIG_W1 is not set -# CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -# CONFIG_WATCHDOG is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -# CONFIG_SSB is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set -CONFIG_MFD_SUPPORT=y -# CONFIG_MFD_CORE is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS6507X is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_VX855 is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_REGULATOR is not set -CONFIG_MEDIA_SUPPORT=y - -# -# Multimedia core support -# -# CONFIG_MEDIA_CONTROLLER is not set -CONFIG_VIDEO_DEV=y -CONFIG_VIDEO_V4L2_COMMON=y -CONFIG_DVB_CORE=y -CONFIG_DVB_NET=y -CONFIG_VIDEO_MEDIA=y - -# -# Multimedia drivers -# -CONFIG_RC_CORE=y -CONFIG_LIRC=y -CONFIG_RC_MAP=y -CONFIG_IR_NEC_DECODER=y -CONFIG_IR_RC5_DECODER=y -CONFIG_IR_RC6_DECODER=y -CONFIG_IR_JVC_DECODER=y -CONFIG_IR_SONY_DECODER=y -CONFIG_IR_RC5_SZ_DECODER=y -CONFIG_IR_MCE_KBD_DECODER=y -CONFIG_IR_LIRC_CODEC=y -# CONFIG_IR_IMON is not set -# CONFIG_IR_MCEUSB is not set -# CONFIG_IR_REDRAT3 is not set -# CONFIG_IR_STREAMZAP is not set -# CONFIG_RC_LOOPBACK is not set -CONFIG_MEDIA_ATTACH=y -CONFIG_MEDIA_TUNER=y -CONFIG_MEDIA_TUNER_CUSTOMISE=y - -# -# Customize TV tuners -# -CONFIG_MEDIA_TUNER_SIMPLE=m -CONFIG_MEDIA_TUNER_TDA8290=m -CONFIG_MEDIA_TUNER_TDA827X=m -CONFIG_MEDIA_TUNER_TDA18271=m -CONFIG_MEDIA_TUNER_TDA9887=m -CONFIG_MEDIA_TUNER_TEA5761=m -CONFIG_MEDIA_TUNER_TEA5767=m -CONFIG_MEDIA_TUNER_MT20XX=m -CONFIG_MEDIA_TUNER_MT2060=m -CONFIG_MEDIA_TUNER_MT2266=m -CONFIG_MEDIA_TUNER_MT2131=m -CONFIG_MEDIA_TUNER_QT1010=m -CONFIG_MEDIA_TUNER_XC2028=m -CONFIG_MEDIA_TUNER_XC5000=m -CONFIG_MEDIA_TUNER_XC4000=m -CONFIG_MEDIA_TUNER_MXL5005S=m -CONFIG_MEDIA_TUNER_MXL5007T=m -CONFIG_MEDIA_TUNER_MC44S803=m -CONFIG_MEDIA_TUNER_MAX2165=m -CONFIG_MEDIA_TUNER_TDA18218=m -CONFIG_MEDIA_TUNER_TDA18212=m -CONFIG_VIDEO_V4L2=y -CONFIG_VIDEOBUF_GEN=m -CONFIG_VIDEOBUF_VMALLOC=m -CONFIG_VIDEOBUF_DVB=m -CONFIG_VIDEO_TVEEPROM=m -CONFIG_VIDEO_TUNER=m -CONFIG_VIDEO_CAPTURE_DRIVERS=y -# CONFIG_VIDEO_ADV_DEBUG is not set -# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set -# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set -CONFIG_VIDEO_IR_I2C=y - -# -# Encoders, decoders, sensors and other helper chips -# - -# -# Audio decoders, processors and mixers -# -# CONFIG_VIDEO_TVAUDIO is not set -# CONFIG_VIDEO_TDA7432 is not set -# CONFIG_VIDEO_TDA9840 is not set -# CONFIG_VIDEO_TEA6415C is not set -# CONFIG_VIDEO_TEA6420 is not set -# CONFIG_VIDEO_MSP3400 is not set -# CONFIG_VIDEO_CS5345 is not set -# CONFIG_VIDEO_CS53L32A is not set -# CONFIG_VIDEO_TLV320AIC23B is not set -# CONFIG_VIDEO_WM8775 is not set -# CONFIG_VIDEO_WM8739 is not set -# CONFIG_VIDEO_VP27SMPX is not set - -# -# RDS decoders -# -# CONFIG_VIDEO_SAA6588 is not set - -# -# Video decoders -# -# CONFIG_VIDEO_ADV7180 is not set -# CONFIG_VIDEO_BT819 is not set -# CONFIG_VIDEO_BT856 is not set -# CONFIG_VIDEO_BT866 is not set -# CONFIG_VIDEO_KS0127 is not set -# CONFIG_VIDEO_SAA7110 is not set -# CONFIG_VIDEO_SAA711X is not set -# CONFIG_VIDEO_SAA7191 is not set -# CONFIG_VIDEO_TVP514X is not set -# CONFIG_VIDEO_TVP5150 is not set -# CONFIG_VIDEO_TVP7002 is not set -# CONFIG_VIDEO_VPX3220 is not set - -# -# Video and audio decoders -# -# CONFIG_VIDEO_SAA717X is not set -# CONFIG_VIDEO_CX25840 is not set - -# -# MPEG video encoders -# -# CONFIG_VIDEO_CX2341X is not set - -# -# Video encoders -# -# CONFIG_VIDEO_SAA7127 is not set -# CONFIG_VIDEO_SAA7185 is not set -# CONFIG_VIDEO_ADV7170 is not set -# CONFIG_VIDEO_ADV7175 is not set -# CONFIG_VIDEO_ADV7343 is not set -# CONFIG_VIDEO_AK881X is not set - -# -# Camera sensor devices -# -# CONFIG_VIDEO_OV7670 is not set -# CONFIG_VIDEO_MT9V011 is not set -# CONFIG_VIDEO_TCM825X is not set - -# -# Flash devices -# - -# -# Video improvement chips -# -# CONFIG_VIDEO_UPD64031A is not set -# CONFIG_VIDEO_UPD64083 is not set - -# -# Miscelaneous helper chips -# -# CONFIG_VIDEO_THS7303 is not set -# CONFIG_VIDEO_M52790 is not set -# CONFIG_VIDEO_BT848 is not set -# CONFIG_VIDEO_CPIA2 is not set -# CONFIG_VIDEO_SAA7134 is not set -# CONFIG_VIDEO_MXB is not set -# CONFIG_VIDEO_HEXIUM_ORION is not set -# CONFIG_VIDEO_HEXIUM_GEMINI is not set -# CONFIG_VIDEO_CX88 is not set -# CONFIG_VIDEO_CX23885 is not set -# CONFIG_VIDEO_AU0828 is not set -# CONFIG_VIDEO_IVTV is not set -# CONFIG_VIDEO_CX18 is not set -# CONFIG_VIDEO_SAA7164 is not set -# CONFIG_VIDEO_CAFE_CCIC is not set -# CONFIG_VIDEO_SR030PC30 is not set -# CONFIG_VIDEO_NOON010PC30 is not set -# CONFIG_SOC_CAMERA is not set -CONFIG_V4L_USB_DRIVERS=y -# CONFIG_USB_VIDEO_CLASS is not set -CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y -CONFIG_USB_GSPCA=m -# CONFIG_USB_M5602 is not set -# CONFIG_USB_STV06XX is not set -# CONFIG_USB_GL860 is not set -# CONFIG_USB_GSPCA_BENQ is not set -# CONFIG_USB_GSPCA_CONEX is not set -# CONFIG_USB_GSPCA_CPIA1 is not set -# CONFIG_USB_GSPCA_ETOMS is not set -# CONFIG_USB_GSPCA_FINEPIX is not set -# CONFIG_USB_GSPCA_JEILINJ is not set -# CONFIG_USB_GSPCA_KINECT is not set -# CONFIG_USB_GSPCA_KONICA is not set -# CONFIG_USB_GSPCA_MARS is not set -# CONFIG_USB_GSPCA_MR97310A is not set -# CONFIG_USB_GSPCA_NW80X is not set -# CONFIG_USB_GSPCA_OV519 is not set -# CONFIG_USB_GSPCA_OV534 is not set -# CONFIG_USB_GSPCA_OV534_9 is not set -# CONFIG_USB_GSPCA_PAC207 is not set -# CONFIG_USB_GSPCA_PAC7302 is not set -# CONFIG_USB_GSPCA_PAC7311 is not set -# CONFIG_USB_GSPCA_SE401 is not set -# CONFIG_USB_GSPCA_SN9C2028 is not set -# CONFIG_USB_GSPCA_SN9C20X is not set -# CONFIG_USB_GSPCA_SONIXB is not set -# CONFIG_USB_GSPCA_SONIXJ is not set -# CONFIG_USB_GSPCA_SPCA500 is not set -# CONFIG_USB_GSPCA_SPCA501 is not set -# CONFIG_USB_GSPCA_SPCA505 is not set -# CONFIG_USB_GSPCA_SPCA506 is not set -# CONFIG_USB_GSPCA_SPCA508 is not set -# CONFIG_USB_GSPCA_SPCA561 is not set -# CONFIG_USB_GSPCA_SPCA1528 is not set -# CONFIG_USB_GSPCA_SQ905 is not set -# CONFIG_USB_GSPCA_SQ905C is not set -# CONFIG_USB_GSPCA_SQ930X is not set -# CONFIG_USB_GSPCA_STK014 is not set -# CONFIG_USB_GSPCA_STV0680 is not set -# CONFIG_USB_GSPCA_SUNPLUS is not set -# CONFIG_USB_GSPCA_T613 is not set -# CONFIG_USB_GSPCA_TV8532 is not set -# CONFIG_USB_GSPCA_VC032X is not set -# CONFIG_USB_GSPCA_VICAM is not set -# CONFIG_USB_GSPCA_XIRLINK_CIT is not set -# CONFIG_USB_GSPCA_ZC3XX is not set -# CONFIG_VIDEO_PVRUSB2 is not set -# CONFIG_VIDEO_HDPVR is not set -CONFIG_VIDEO_EM28XX=m -CONFIG_VIDEO_EM28XX_ALSA=m -CONFIG_VIDEO_EM28XX_DVB=m -CONFIG_VIDEO_EM28XX_RC=y -# CONFIG_VIDEO_TLG2300 is not set -# CONFIG_VIDEO_CX231XX is not set -# CONFIG_VIDEO_USBVISION is not set -# CONFIG_USB_ET61X251 is not set -# CONFIG_USB_SN9C102 is not set -# CONFIG_USB_PWC is not set -# CONFIG_USB_ZR364XX is not set -# CONFIG_USB_STKWEBCAM is not set -# CONFIG_USB_S2255 is not set -# CONFIG_V4L_MEM2MEM_DRIVERS is not set -CONFIG_RADIO_ADAPTERS=y -# CONFIG_RADIO_MAXIRADIO is not set -# CONFIG_I2C_SI4713 is not set -# CONFIG_RADIO_SI4713 is not set -# CONFIG_USB_DSBR is not set -# CONFIG_RADIO_SI470X is not set -# CONFIG_USB_MR800 is not set -# CONFIG_RADIO_TEA5764 is not set -# CONFIG_RADIO_SAA7706H is not set -# CONFIG_RADIO_TEF6862 is not set -# CONFIG_RADIO_WL1273 is not set - -# -# Texas Instruments WL128x FM driver (ST based) -# -CONFIG_DVB_MAX_ADAPTERS=8 -CONFIG_DVB_DYNAMIC_MINORS=y -CONFIG_DVB_CAPTURE_DRIVERS=y - -# -# Supported SAA7146 based PCI Adapters -# -# CONFIG_TTPCI_EEPROM is not set -# CONFIG_DVB_AV7110 is not set -# CONFIG_DVB_BUDGET_CORE is not set - -# -# Supported USB Adapters -# -CONFIG_DVB_USB=m -# CONFIG_DVB_USB_DEBUG is not set -CONFIG_DVB_USB_A800=m -CONFIG_DVB_USB_DIBUSB_MB=m -CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y -CONFIG_DVB_USB_DIBUSB_MC=m -CONFIG_DVB_USB_DIB0700=m -CONFIG_DVB_USB_UMT_010=m -CONFIG_DVB_USB_CXUSB=m -CONFIG_DVB_USB_M920X=m -CONFIG_DVB_USB_GL861=m -CONFIG_DVB_USB_AU6610=m -CONFIG_DVB_USB_DIGITV=m -CONFIG_DVB_USB_VP7045=m -CONFIG_DVB_USB_VP702X=m -CONFIG_DVB_USB_GP8PSK=m -CONFIG_DVB_USB_NOVA_T_USB2=m -CONFIG_DVB_USB_TTUSB2=m -CONFIG_DVB_USB_DTT200U=m -CONFIG_DVB_USB_OPERA1=m -CONFIG_DVB_USB_AF9005=m -CONFIG_DVB_USB_AF9005_REMOTE=m -CONFIG_DVB_USB_DW2102=m -CONFIG_DVB_USB_CINERGY_T2=m -CONFIG_DVB_USB_ANYSEE=m -CONFIG_DVB_USB_DTV5100=m -CONFIG_DVB_USB_AF9015=m -CONFIG_DVB_USB_CE6230=m -CONFIG_DVB_USB_FRIIO=m -CONFIG_DVB_USB_EC168=m -CONFIG_DVB_USB_AZ6027=m -CONFIG_DVB_USB_LME2510=m -CONFIG_DVB_USB_TECHNISAT_USB2=m -CONFIG_DVB_TTUSB_BUDGET=m -# CONFIG_DVB_TTUSB_DEC is not set -CONFIG_SMS_SIANO_MDTV=m - -# -# Siano module components -# -CONFIG_SMS_USB_DRV=m - -# -# Supported FlexCopII (B2C2) Adapters -# -# CONFIG_DVB_B2C2_FLEXCOP is not set - -# -# Supported BT878 Adapters -# - -# -# Supported Pluto2 Adapters -# -# CONFIG_DVB_PLUTO2 is not set - -# -# Supported SDMC DM1105 Adapters -# -# CONFIG_DVB_DM1105 is not set - -# -# Supported Earthsoft PT1 Adapters -# -# CONFIG_DVB_PT1 is not set - -# -# Supported Mantis Adapters -# -# CONFIG_MANTIS_CORE is not set - -# -# Supported nGene Adapters -# -# CONFIG_DVB_NGENE is not set - -# -# Supported ddbridge ('Octopus') Adapters -# -# CONFIG_DVB_DDBRIDGE is not set - -# -# Supported DVB Frontends -# -CONFIG_DVB_FE_CUSTOMISE=y - -# -# Customise DVB Frontends -# - -# -# Multistandard (satellite) frontends -# -CONFIG_DVB_STB0899=m -CONFIG_DVB_STB6100=m -CONFIG_DVB_STV090x=m -CONFIG_DVB_STV6110x=m - -# -# Multistandard (cable + terrestrial) frontends -# -CONFIG_DVB_DRXK=m -CONFIG_DVB_TDA18271C2DD=m - -# -# DVB-S (satellite) frontends -# -CONFIG_DVB_CX24110=m -CONFIG_DVB_CX24123=m -CONFIG_DVB_MT312=m -CONFIG_DVB_ZL10036=m -CONFIG_DVB_ZL10039=m -CONFIG_DVB_S5H1420=m -CONFIG_DVB_STV0288=m -CONFIG_DVB_STB6000=m -CONFIG_DVB_STV0299=m -CONFIG_DVB_STV6110=m -CONFIG_DVB_STV0900=m -CONFIG_DVB_TDA8083=m -CONFIG_DVB_TDA10086=m -CONFIG_DVB_TDA8261=m -CONFIG_DVB_VES1X93=m -CONFIG_DVB_TUNER_ITD1000=m -CONFIG_DVB_TUNER_CX24113=m -CONFIG_DVB_TDA826X=m -CONFIG_DVB_TUA6100=m -CONFIG_DVB_CX24116=m -CONFIG_DVB_SI21XX=m -CONFIG_DVB_DS3000=m -CONFIG_DVB_MB86A16=m - -# -# DVB-T (terrestrial) frontends -# -CONFIG_DVB_SP8870=m -CONFIG_DVB_SP887X=m -CONFIG_DVB_CX22700=m -CONFIG_DVB_CX22702=m -CONFIG_DVB_S5H1432=m -CONFIG_DVB_DRXD=m -CONFIG_DVB_L64781=m -CONFIG_DVB_TDA1004X=m -CONFIG_DVB_NXT6000=m -CONFIG_DVB_MT352=m -CONFIG_DVB_ZL10353=m -CONFIG_DVB_DIB3000MB=m -CONFIG_DVB_DIB3000MC=m -CONFIG_DVB_DIB7000M=m -CONFIG_DVB_DIB7000P=m -CONFIG_DVB_DIB9000=m -CONFIG_DVB_TDA10048=m -CONFIG_DVB_AF9013=m -CONFIG_DVB_EC100=m -CONFIG_DVB_STV0367=m -CONFIG_DVB_CXD2820R=m - -# -# DVB-C (cable) frontends -# -CONFIG_DVB_VES1820=m -CONFIG_DVB_TDA10021=m -CONFIG_DVB_TDA10023=m -CONFIG_DVB_STV0297=m - -# -# ATSC (North American/Korean Terrestrial/Cable DTV) frontends -# -CONFIG_DVB_NXT200X=m -CONFIG_DVB_OR51211=m -CONFIG_DVB_OR51132=m -CONFIG_DVB_BCM3510=m -CONFIG_DVB_LGDT330X=m -CONFIG_DVB_LGDT3305=m -CONFIG_DVB_S5H1409=m -CONFIG_DVB_AU8522=m -CONFIG_DVB_S5H1411=m - -# -# ISDB-T (terrestrial) frontends -# -CONFIG_DVB_S921=m -CONFIG_DVB_DIB8000=m -CONFIG_DVB_MB86A20S=m - -# -# Digital terrestrial only tuners/PLL -# -CONFIG_DVB_PLL=m -CONFIG_DVB_TUNER_DIB0070=m -CONFIG_DVB_TUNER_DIB0090=m - -# -# SEC control devices for DVB-S -# -CONFIG_DVB_LNBP21=m -CONFIG_DVB_ISL6405=m -CONFIG_DVB_ISL6421=m -CONFIG_DVB_ISL6423=m -CONFIG_DVB_LGS8GL5=m -CONFIG_DVB_LGS8GXX=m -CONFIG_DVB_ATBM8830=m -CONFIG_DVB_TDA665x=m -CONFIG_DVB_IX2505V=m - -# -# Tools to develop new frontends -# -# CONFIG_DVB_DUMMY_FE is not set - -# -# Graphics support -# -# CONFIG_VGA_ARB is not set -# CONFIG_DRM is not set -# CONFIG_STUB_POULSBO is not set -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -# CONFIG_FB_DDC is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_WMT_GE_ROPS is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set - -# -# Display device support -# -# CONFIG_DISPLAY_SUPPORT is not set -# CONFIG_LOGO is not set -CONFIG_SOUND=y -CONFIG_SOUND_OSS_CORE=y -CONFIG_SOUND_OSS_CORE_PRECLAIM=y -CONFIG_SND=y -CONFIG_SND_TIMER=y -CONFIG_SND_PCM=y -CONFIG_SND_SEQUENCER=y -# CONFIG_SND_SEQ_DUMMY is not set -CONFIG_SND_OSSEMUL=y -CONFIG_SND_MIXER_OSS=y -CONFIG_SND_PCM_OSS=y -# CONFIG_SND_PCM_OSS_PLUGINS is not set -# CONFIG_SND_SEQUENCER_OSS is not set -# CONFIG_SND_HRTIMER is not set -# CONFIG_SND_DYNAMIC_MINORS is not set -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_RAWMIDI_SEQ is not set -# CONFIG_SND_OPL3_LIB_SEQ is not set -# CONFIG_SND_OPL4_LIB_SEQ is not set -# CONFIG_SND_SBAWE_SEQ is not set -# CONFIG_SND_EMU10K1_SEQ is not set -# CONFIG_SND_DRIVERS is not set -# CONFIG_SND_PCI is not set -# CONFIG_SND_MIPS is not set -# CONFIG_SND_USB is not set -# CONFIG_SND_SOC is not set -# CONFIG_SOUND_PRIME is not set -CONFIG_HID_SUPPORT=y -CONFIG_HID=y -CONFIG_HIDRAW=y - -# -# USB Input Devices -# -CONFIG_USB_HID=y -# CONFIG_HID_PID is not set -CONFIG_USB_HIDDEV=y - -# -# Special HID drivers -# -# CONFIG_HID_A4TECH is not set -# CONFIG_HID_ACRUX is not set -CONFIG_HID_APPLE=m -CONFIG_HID_BELKIN=m -CONFIG_HID_CHERRY=m -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_EZKEY is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -CONFIG_HID_LOGITECH=m -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIWII_FF is not set -CONFIG_HID_MAGICMOUSE=m -CONFIG_HID_MICROSOFT=m -CONFIG_HID_MONTEREY=m -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NTRIG is not set -CONFIG_HID_ORTEK=m -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_QUANTA is not set -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAMSUNG is not set -CONFIG_HID_SONY=m -# CONFIG_HID_SPEEDLINK is not set -CONFIG_HID_SUNPLUS=m -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_THRUSTMASTER is not set -CONFIG_HID_WACOM=m -# CONFIG_HID_WACOM_POWER_SUPPLY is not set -CONFIG_HID_WIIMOTE=m -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -CONFIG_USB_SUPPORT=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -CONFIG_USB_DEVICEFS=y -CONFIG_USB_DEVICE_CLASS=y -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -# CONFIG_USB_EHCI_HCD is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1760_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_UHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_WHCI_HCD is not set -# CONFIG_USB_HWA_HCD is not set - -# -# USB Device Class drivers -# -CONFIG_USB_ACM=m -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set -# CONFIG_USB_UAS is not set -# CONFIG_USB_LIBUSUAL is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB port drivers -# -CONFIG_USB_SERIAL=m -CONFIG_USB_EZUSB=y -CONFIG_USB_SERIAL_GENERIC=y -# CONFIG_USB_SERIAL_AIRCABLE is not set -CONFIG_USB_SERIAL_ARK3116=m -CONFIG_USB_SERIAL_BELKIN=m -# CONFIG_USB_SERIAL_CH341 is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -# CONFIG_USB_SERIAL_CP210X is not set -# CONFIG_USB_SERIAL_CYPRESS_M8 is not set -# CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=m -# CONFIG_USB_SERIAL_FUNSOFT is not set -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_EDGEPORT_TI is not set -# CONFIG_USB_SERIAL_GARMIN is not set -# CONFIG_USB_SERIAL_IPW is not set -# CONFIG_USB_SERIAL_IUU is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -CONFIG_USB_SERIAL_KEYSPAN=m -# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_KOBIL_SCT is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_MOS7720 is not set -# CONFIG_USB_SERIAL_MOS7840 is not set -# CONFIG_USB_SERIAL_MOTOROLA is not set -# CONFIG_USB_SERIAL_NAVMAN is not set -CONFIG_USB_SERIAL_PL2303=m -# CONFIG_USB_SERIAL_OTI6858 is not set -# CONFIG_USB_SERIAL_QCAUX is not set -# CONFIG_USB_SERIAL_QUALCOMM is not set -# CONFIG_USB_SERIAL_SPCP8X5 is not set -# CONFIG_USB_SERIAL_HP4X is not set -# CONFIG_USB_SERIAL_SAFE is not set -# CONFIG_USB_SERIAL_SIEMENS_MPI is not set -# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set -# CONFIG_USB_SERIAL_SYMBOL is not set -# CONFIG_USB_SERIAL_TI is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_XIRCOM is not set -CONFIG_USB_SERIAL_WWAN=m -CONFIG_USB_SERIAL_OPTION=m -# CONFIG_USB_SERIAL_OMNINET is not set -# CONFIG_USB_SERIAL_OPTICON is not set -# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set -# CONFIG_USB_SERIAL_ZIO is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_DEBUG is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_GADGET is not set - -# -# OTG and related infrastructure -# -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_UWB is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y - -# -# LED drivers -# -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_PCA9532 is not set -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP5521 is not set -# CONFIG_LEDS_LP5523 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_BD2802 is not set -CONFIG_LEDS_TRIGGERS=y - -# -# LED Triggers -# -# CONFIG_LEDS_TRIGGER_TIMER is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set - -# -# iptables trigger is under Netfilter config (LED target) -# -# CONFIG_ACCESSIBILITY is not set -# CONFIG_INFINIBAND is not set -CONFIG_RTC_LIB=y -# CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_AUXDISPLAY is not set -# CONFIG_UIO is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_BALLOON is not set -CONFIG_STAGING=y -# CONFIG_ET131X is not set -# CONFIG_VIDEO_GO7007 is not set -# CONFIG_VIDEO_CX25821 is not set -# CONFIG_VIDEO_TM6000 is not set -# CONFIG_DVB_CXD2099 is not set -# CONFIG_USBIP_CORE is not set -CONFIG_W35UND=m -CONFIG_PRISM2_USB=m -# CONFIG_ECHO is not set -# CONFIG_BRCMUTIL is not set -# CONFIG_BRCMSMAC is not set -# CONFIG_ASUS_OLED is not set -CONFIG_R8187SE=m -CONFIG_RTL8192U=m -# CONFIG_RTL8192E is not set -CONFIG_R8712U=m -# CONFIG_R8712_AP is not set -# CONFIG_RTS_PSTOR is not set -# CONFIG_TRANZPORT is not set -# CONFIG_POHMELFS is not set -# CONFIG_IDE_PHISON is not set -# CONFIG_LINE6_USB is not set -# CONFIG_USB_SERIAL_QUATECH2 is not set -# CONFIG_USB_SERIAL_QUATECH_USB2 is not set -# CONFIG_VT6655 is not set -# CONFIG_VT6656 is not set -# CONFIG_VME_BUS is not set -# CONFIG_DX_SEP is not set -# CONFIG_IIO is not set -# CONFIG_XVMALLOC is not set -# CONFIG_ZRAM is not set -# CONFIG_FB_SM7XX is not set -# CONFIG_VIDEO_DT3155 is not set -# CONFIG_CRYSTALHD is not set -# CONFIG_FB_XGI is not set -# CONFIG_LIRC_STAGING is not set -# CONFIG_EASYCAP is not set -# CONFIG_SOLO6X10 is not set -# CONFIG_USB_ENESTORAGE is not set -# CONFIG_BCM_WIMAX is not set -# CONFIG_FT1000 is not set - -# -# Speakup console speech -# -# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -# CONFIG_ALTERA_STAPL is not set -CONFIG_IOMMU_SUPPORT=y -# CONFIG_VIRT_DRIVERS is not set - -# -# File systems -# -CONFIG_EXT2_FS=m -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set -# CONFIG_EXT3_FS_XATTR is not set -CONFIG_EXT4_FS=y -# CONFIG_EXT4_FS_XATTR is not set -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD=y -CONFIG_JBD2=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -# CONFIG_GFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_FS_POSIX_ACL is not set -CONFIG_EXPORTFS=m -CONFIG_FILE_LOCKING=y -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -CONFIG_AUTOFS4_FS=y -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# CD-ROM/DVD Filesystems -# -CONFIG_ISO9660_FS=y -CONFIG_JOLIET=y -# CONFIG_ZISOFS is not set -CONFIG_UDF_FS=y -CONFIG_UDF_NLS=y - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -CONFIG_NTFS_FS=y -# CONFIG_NTFS_DEBUG is not set -CONFIG_NTFS_RW=y - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_TMPFS_XATTR is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -CONFIG_JFFS2_SUMMARY=y -# CONFIG_JFFS2_FS_XATTR is not set -CONFIG_JFFS2_COMPRESSION_OPTIONS=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JFFS2_LZO=y -CONFIG_JFFS2_RTIME=y -CONFIG_JFFS2_RUBIN=y -# CONFIG_JFFS2_CMODE_NONE is not set -# CONFIG_JFFS2_CMODE_PRIORITY is not set -# CONFIG_JFFS2_CMODE_SIZE is not set -CONFIG_JFFS2_CMODE_FAVOURLZO=y -CONFIG_UBIFS_FS=y -# CONFIG_UBIFS_FS_XATTR is not set -# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UBIFS_FS_DEBUG is not set -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=m -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZO is not set -# CONFIG_SQUASHFS_XZ is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -# CONFIG_NFS_V4 is not set -CONFIG_ROOT_NFS=y -CONFIG_NFSD=m -CONFIG_NFSD_V3=y -# CONFIG_NFSD_V3_ACL is not set -# CONFIG_NFSD_V4 is not set -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -# CONFIG_CEPH_FS is not set -CONFIG_CIFS=m -# CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_DEBUG2 is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -CONFIG_MAC_PARTITION=y -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-15" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m -CONFIG_NLS_ISO8859_8=m -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=y -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -CONFIG_NLS_UTF8=y - -# -# Kernel hacking -# -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -# CONFIG_PRINTK_TIME is not set -CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 -# CONFIG_ENABLE_WARN_DEPRECATED is not set -# CONFIG_ENABLE_MUST_CHECK is not set -CONFIG_FRAME_WARN=0 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -# CONFIG_LOCKUP_DETECTOR is not set -# CONFIG_HARDLOCKUP_DETECTOR is not set -# CONFIG_DETECT_HUNG_TASK is not set -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SYSCTL_SYSCALL_CHECK is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -# CONFIG_TEST_KSTRTOX is not set -CONFIG_EARLY_PRINTK=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="bmem=112M ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs rw rootflags=sync" -CONFIG_CMDLINE_OVERRIDE=y -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_RUNTIME_DEBUG is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=m -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_PCOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_PCRYPT is not set -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -CONFIG_CRYPTO_AUTHENC=m -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -CONFIG_CRYPTO_CBC=m -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_GHASH is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_MICHAEL_MIC=m -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -CONFIG_CRYPTO_SHA1=m -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -CONFIG_CRYPTO_DEFLATE=y -# CONFIG_CRYPTO_ZLIB is not set -CONFIG_CRYPTO_LZO=y - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_CRC_CCITT=y -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -CONFIG_CRC_ITU_T=y -CONFIG_CRC32=y -CONFIG_CRC7=m -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -# CONFIG_XZ_DEC is not set -# CONFIG_XZ_DEC_BCJ is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_CPU_RMAP=y -CONFIG_NLATTR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_AVERAGE=y -# CONFIG_CORDIC is not set diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_bm750.patch b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_bm750.patch deleted file mode 100644 index e624322..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.1.1/linux_3.1.1_bm750.patch +++ /dev/null @@ -1,181 +0,0 @@ -diff --git a/arch/mips/brcmstb/board.c b/arch/mips/brcmstb/board.c -index ab1cb65..2875cf5 100644 ---- a/arch/mips/brcmstb/board.c -+++ b/arch/mips/brcmstb/board.c -@@ -311,7 +311,7 @@ void __init board_pinmux_setup(void) - PINMUX(7, gpio_035, 1); /* UARTB RX */ - PINMUX(7, gpio_038, 1); /* UARTC TX */ - PINMUX(7, gpio_039, 1); /* UARTC RX */ -- -+#if 0 - PINMUX(9, gpio_054, 3); /* MII */ - PINMUX(9, gpio_055, 3); - PINMUX(9, gpio_056, 3); -@@ -330,6 +330,7 @@ void __init board_pinmux_setup(void) - PINMUX(10, gpio_070, 3); - PINMUX(10, gpio_071, 3); - PINMUX(10, gpio_072, 3); -+#endif - - #elif defined(CONFIG_BCM7340) - -@@ -718,15 +719,13 @@ void __init board_get_ram_size(unsigned long *dram0_mb, unsigned long *dram1_mb) - - static struct mtd_partition fixed_partition_map[] = { - /* name offset size */ -- { name: "rootfs", offset: 0, size:0x1F200000 /* DEFAULT_ROOTFS_SIZE*/ }, /* rootfs is total nand size - 6 M Bytes. referr to cfe. bcm97335_devs.c */ -- { name: "kernel", offset: 0x1F200000, size: 4<<20 }, -- { name: "boot", offset: 0x1F600000, size: 4<<20 }, -- { name: "splash", offset: 0x1FA00000, size: 2<<20 }, -- { name: "cfe", offset: 0x1FC00000, size: 1<<20 }, -- { name: "mac", offset: 0x1FD00000, size: 1<<19 }, -- { name: "env", offset: 0x1FD80000, size: 1<<19 }, -- { name: "nvm", offset: 0x1FE00000, size: 1<<20 }, -- { name: "data", offset: 0x20000000, size: 0x1FC00000 }, -+ { name: "rootfs", offset: 0, size: (128-4-2-3-1)<<20 }, /* rootfs is total nand size - 6 M Bytes. referr to cfe. bcm97335_devs.c */ -+ { name: "kernel", offset: 0x07600000, size: 4<<20 }, -+ { name: "boot", offset: 0x07a00000, size: 2<<20 }, -+ { name: "cfe", offset: 0x07C00000, size: 1<<20 }, -+ { name: "mac", offset: 0x07D00000, size: 1<<19 }, -+ { name: "env", offset: 0x07D80000, size: 1<<19 }, -+ { name: "nvm", offset: 0x07E00000, size: 1<<20 }, - /* BBT 1MB not mountable by anyone */ - /* { name: "data", offset: 0x20000000, size: 0 },*/ - /* Add 1 extra place-holder partition for splash, and a safety guard element */ -diff --git a/drivers/mtd/brcmnand/brcmnand_base.c b/drivers/mtd/brcmnand/brcmnand_base.c -index 22035af..b54bc29 100644 ---- a/drivers/mtd/brcmnand/brcmnand_base.c -+++ b/drivers/mtd/brcmnand/brcmnand_base.c -@@ -226,8 +226,8 @@ static brcmnand_chip_Id brcmnand_chips[] = { - .options = NAND_USE_FLASH_BBT, /* Use BBT on flash */ - .idOptions = 0, - //| NAND_COMPLEX_OOB_WRITE /* Write data together with OOB for write_oob */ -- .timing1 = 0, //00070000, -- .timing2 = 0, -+ .timing1 = 0x4232222D, -+ .timing2 = 0x00000D94, - .nop=8, - .ctrlVersion = 0, /* THT Verified on data-sheet 7/10/08: Allows 4 on main and 4 on OOB */ - }, -@@ -7553,10 +7553,7 @@ brcmnand_decode_config(struct brcmnand_chip* chip, uint32_t nand_config) - chip->blockSize = 2048 << 10; - break; - #endif -- case BCHP_NAND_CONFIG_BLOCK_SIZE_BK_SIZE_256KB: -- chip->blockSize = 256 << 10; -- break; -- case BCHP_NAND_CONFIG_BLOCK_SIZE_BK_SIZE_512KB: -+ case BCHP_NAND_CONFIG_BLOCK_SIZE_BK_SIZE_512KB: - chip->blockSize = 512 << 10; - break; - case BCHP_NAND_CONFIG_BLOCK_SIZE_BK_SIZE_8KB: -@@ -7772,7 +7769,7 @@ is_ecc_strong(int registerEcc, int requiredEcc) - } - - -- -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - static void - brcmnand_set_acccontrol(struct brcmnand_chip * chip , unsigned int chipSelect, - uint32_t pageSize, uint16_t oobSizePerPage, int reqEcc, int codeWorkSize, int nbrBitsPerCell) -@@ -7928,7 +7925,7 @@ PRINTK("%s: gAccControl[CS=%d]=%08x, ACC=%08lx\n", - #endif - } - } -- -+#endif - - static void - brcmnand_read_id(struct mtd_info *mtd, unsigned int chipSelect, unsigned long* dev_id) -@@ -8005,6 +8002,7 @@ printk("After: NandSelect=%08x, nandConfig=%08x\n", nandSelect, nandConfig); - } - - -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - /* - * Type-1 ID string, called from brcmnand_probe with the following condition - * if ((brcmnand_chips[i].idOptions & BRCMNAND_ID_HAS_BYTE4) && -@@ -8202,7 +8200,9 @@ PRINTK("nandConfigChipSize = %04x\n", nandConfigChipSize); - - return nand_config; - } -+#endif - -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - - /* - * Type-2 ID string, called from brcmnand_probe with the following condition -@@ -8372,8 +8372,9 @@ PRINTK("Required ECC level = %d, devIdExt=%08x, eccShift=%02x, sector Size=%d\n" - - return nand_config; - } -+#endif - -- -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - /* - * Type-2 ID string, called from brcmnand_probe with the following condition - * if ((brcmnand_chips[i].idOptions & BRCMNAND_ID_EXT_BYTES_TYPE2) == -@@ -8519,6 +8520,7 @@ PRINTK("Updating Config Reg on CS%1d: Block & Page Size: After: %08x\n", chip->c - - return nand_config; - } -+#endif - - - #if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_4_0 -@@ -9074,7 +9076,7 @@ static int brcmnand_probe(struct mtd_info *mtd, unsigned int chipSelect) - for (i=0; i < BRCMNAND_MAX_CHIPS; i++) { - if (brcmnand_dev_id == brcmnand_chips[i].chipId - && brcmnand_maf_id == brcmnand_chips[i].mafId) { -- -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - /* No ambiguity in ID#3,4,5 */ - if (brcmnand_chips[i].chipId345[0] == 0x0 - && brcmnand_chips[i].chipId345[1] == 0x0 -@@ -9113,6 +9115,15 @@ static int brcmnand_probe(struct mtd_info *mtd, unsigned int chipSelect) - } - /* Else not match */ - } -+#else -+ if (brcmnand_chips[i].chipId345[0] == 0x0 -+ && brcmnand_chips[i].chipId345[1] == 0x0 -+ && brcmnand_chips[i].chipId345[2] == 0x0) { -+ foundInIdTable = 1; -+ break; -+ } -+ -+#endif - } - } - -@@ -9312,7 +9323,7 @@ static int brcmnand_probe(struct mtd_info *mtd, unsigned int chipSelect) - printk("%s: Ecc level set to %d, sectorSize=%d from ID table\n", __FUNCTION__, chip->reqEccLevel, chip->eccSectorSize); - } - } -- -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - /* ID not in table, and no CONFIG REG was passed at command line */ - else if (!skipIdLookup && !foundInIdTable) { - uint32_t acc; -@@ -9339,6 +9350,7 @@ printk("%s: Ecc level set to %d, sectorSize=%d from ID table\n", __FUNCTION__, c - printk("Spare Area Size = %dB/512B\n", chip->eccOobSize); - - } -+#endif - } - - /* -@@ -9355,10 +9367,11 @@ printk("%s: Ecc level set to %d, sectorSize=%d from ID table\n", __FUNCTION__, c - // Also works for dummy entries, but no adjustments possible - brcmnand_adjust_timings(chip, &brcmnand_chips[i]); - -+#if CONFIG_MTD_BRCMNAND_VERSION >= CONFIG_MTD_BRCMNAND_VERS_3_0 - // Adjust perchip NAND ACC CONTROL - // updateInternalData = not ONFI .or. not in ID table - brcmnand_adjust_acccontrol(chip, isONFI, foundInIdTable, i); -- -+#endif - - /* Flash device information */ - brcmnand_print_device_info(&brcmnand_chips[i], mtd); diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/bm750_defconfig b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/bm750_defconfig deleted file mode 100644 index bea60b7..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/bm750_defconfig +++ /dev/null @@ -1,3132 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/mips 3.9.6 Kernel Configuration -# -CONFIG_MIPS=y - -# -# Machine selection -# -# CONFIG_MIPS_ALCHEMY is not set -# CONFIG_AR7 is not set -# CONFIG_ATH79 is not set -# CONFIG_BCM47XX is not set -# CONFIG_BCM63XX is not set -CONFIG_BRCMSTB=y -# CONFIG_MIPS_COBALT is not set -# CONFIG_MACH_DECSTATION is not set -# CONFIG_MACH_JAZZ is not set -# CONFIG_MACH_JZ4740 is not set -# CONFIG_LANTIQ is not set -# CONFIG_LASAT is not set -# CONFIG_MACH_LOONGSON is not set -# CONFIG_MACH_LOONGSON1 is not set -# CONFIG_MIPS_MALTA is not set -# CONFIG_MIPS_SEAD3 is not set -# CONFIG_NEC_MARKEINS is not set -# CONFIG_MACH_VR41XX is not set -# CONFIG_NXP_STB220 is not set -# CONFIG_NXP_STB225 is not set -# CONFIG_PMC_MSP is not set -# CONFIG_POWERTV is not set -# CONFIG_RALINK is not set -# CONFIG_SGI_IP22 is not set -# CONFIG_SGI_IP27 is not set -# CONFIG_SGI_IP28 is not set -# CONFIG_SGI_IP32 is not set -# CONFIG_SIBYTE_CRHINE is not set -# CONFIG_SIBYTE_CARMEL is not set -# CONFIG_SIBYTE_CRHONE is not set -# CONFIG_SIBYTE_RHONE is not set -# CONFIG_SIBYTE_SWARM is not set -# CONFIG_SIBYTE_LITTLESUR is not set -# CONFIG_SIBYTE_SENTOSA is not set -# CONFIG_SIBYTE_BIGSUR is not set -# CONFIG_SNI_RM is not set -# CONFIG_MACH_TX39XX is not set -# CONFIG_MACH_TX49XX is not set -# CONFIG_MIKROTIK_RB532 is not set -# CONFIG_WR_PPMC is not set -# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set -# CONFIG_NLM_XLR_BOARD is not set -# CONFIG_NLM_XLP_BOARD is not set -# CONFIG_ALCHEMY_GPIO_INDIRECT is not set - -# -# Broadcom STB options -# -# CONFIG_BRCM_LEGACY is not set -# CONFIG_BCM7125C0 is not set -# CONFIG_BCM7231B0 is not set -# CONFIG_BCM7340B0 is not set -# CONFIG_BCM7344B0 is not set -# CONFIG_BCM7346B0 is not set -# CONFIG_BCM7358A0 is not set -# CONFIG_BCM7325B0 is not set -CONFIG_BCM7335B0=y -# CONFIG_BCM7405B0 is not set -# CONFIG_BCM7405D0 is not set -# CONFIG_BCM7408B0 is not set -# CONFIG_BCM7420C0 is not set -# CONFIG_BCM7425B0 is not set -# CONFIG_BCM7429A0 is not set -# CONFIG_BCM7435A0 is not set -# CONFIG_BCM7468B0 is not set -# CONFIG_BCM7550A0 is not set -# CONFIG_BCM7550B0 is not set -# CONFIG_BCM7552B0 is not set - -# -# Memory map -# -CONFIG_BRCM_UPPER_MEMORY=y -# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set - -# -# Onchip peripherals -# -CONFIG_BRCM_CONSOLE_DEVICE=0 -CONFIG_BRCM_FLASH=y -CONFIG_BRCM_FIXED_MTD_PARTITIONS=y -CONFIG_MTD_BRCMNAND=y -CONFIG_BRCMNAND_MTD_EXTENSION=y -# CONFIG_MTD_BRCMNAND_VERIFY_WRITE is not set -# CONFIG_MTD_BRCMNAND_CORRECTABLE_ERR_HANDLING is not set -CONFIG_BCMEMAC=y -CONFIG_SATA_BRCMSTB=y -CONFIG_BRCM_USB=y -# CONFIG_BRCM_OVERRIDE_USB is not set -CONFIG_BRCM_PM=y -CONFIG_CSRC_UPG=y - -# -# Miscellaneous options -# -# CONFIG_BRCM_FORCE_DOCSIS is not set -CONFIG_BRCM_LIBGCC=y -# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set -CONFIG_BRCM_WLAN_MODULES=y -# CONFIG_BRCM_DEBUG_OPTIONS is not set -CONFIG_BMIPS4380=y -CONFIG_BRCM_HAS_16550=y -CONFIG_BRCM_HAS_UARTA=y -CONFIG_BRCM_HAS_UARTB=y -CONFIG_BRCM_HAS_UARTC=y -CONFIG_BRCM_UARTA_IS_16550=y -CONFIG_BRCM_UARTB_IS_16550=y -CONFIG_BRCM_UARTC_IS_16550=y -CONFIG_BRCM_HAS_PCI23=y -CONFIG_BRCM_HAS_EMAC_0=y -CONFIG_BRCM_HAS_EMAC_1=y -CONFIG_BRCM_HAS_SATA=y -CONFIG_BRCM_HAS_SATA2=y -# CONFIG_BRCM_SATA_75MHZ_PLL is not set -# CONFIG_BRCM_SATA_SINGLE_PORT is not set -CONFIG_BRCM_HAS_NOR=y -CONFIG_BRCM_HAS_NAND_MINOR_1=y -CONFIG_BRCM_HAS_NAND_MAJOR_2=y -CONFIG_BRCMNAND_MAJOR_VERS=2 -CONFIG_BRCMNAND_MINOR_VERS=1 -CONFIG_BRCM_HAS_NAND=y -CONFIG_BRCM_CPU_DIV=y -CONFIG_BRCM_HAS_UPPER_MEMORY=y -CONFIG_BRCM_UPPER_256MB=y -CONFIG_BRCM_HAS_1GB_MEMC0=y -CONFIG_BRCM_PLATFORM_DEFAULTS=y -CONFIG_BCM7335=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_ARCH_HAS_ILOG2_U32 is not set -# CONFIG_ARCH_HAS_ILOG2_U64 is not set -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_SCHED_OMIT_FRAME_POINTER=y -CONFIG_BOOT_RAW=y -CONFIG_CEVT_R4K=y -CONFIG_FW_CFE=y -# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set -CONFIG_DMA_NONCOHERENT=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_SYS_HAS_EARLY_PRINTK=y -# CONFIG_HOTPLUG_CPU is not set -CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y -# CONFIG_MIPS_MACHINE is not set -# CONFIG_NO_IOPORT is not set -# CONFIG_CPU_BIG_ENDIAN is not set -CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set -CONFIG_IRQ_CPU=y -CONFIG_SWAP_IO_SPACE=y -CONFIG_MIPS_L1_CACHE_SHIFT=5 - -# -# CPU selection -# -CONFIG_CPU_MIPS32_R1=y -CONFIG_SYS_HAS_CPU_MIPS32_R1=y -CONFIG_WEAK_ORDERING=y -CONFIG_CPU_MIPS32=y -CONFIG_CPU_MIPSR1=y -CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -CONFIG_HARDWARE_WATCHPOINTS=y - -# -# Kernel type -# -CONFIG_32BIT=y -CONFIG_PAGE_SIZE_4KB=y -# CONFIG_PAGE_SIZE_16KB is not set -# CONFIG_PAGE_SIZE_64KB is not set -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_CPU_HAS_PREFETCH=y -CONFIG_CPU_GENERIC_DUMP_TLB=y -CONFIG_CPU_R4K_FPU=y -CONFIG_CPU_R4K_CACHE_TLB=y -CONFIG_MIPS_MT_DISABLED=y -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_CPU_HAS_SYNC=y -CONFIG_CPU_SUPPORTS_HIGHMEM=y -CONFIG_ARCH_FLATMEM_ENABLE=y -CONFIG_ARCH_SPARSEMEM_ENABLE=y -CONFIG_SPARSEMEM=y -CONFIG_HAVE_MEMORY_PRESENT=y -CONFIG_SPARSEMEM_STATIC=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MEMBLOCK_NODE_MAP=y -CONFIG_ARCH_DISCARD_MEMBLOCK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_COMPACTION is not set -# CONFIG_PHYS_ADDR_T_64BIT is not set -CONFIG_ZONE_DMA_FLAG=0 -CONFIG_VIRT_TO_BUS=y -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -# CONFIG_CROSS_MEMORY_ATTACH is not set -# CONFIG_CLEANCACHE is not set -# CONFIG_FRONTSWAP is not set -CONFIG_SMP=y -CONFIG_SYS_SUPPORTS_SMP=y -CONFIG_NR_CPUS=2 -# CONFIG_HZ_48 is not set -# CONFIG_HZ_100 is not set -# CONFIG_HZ_128 is not set -# CONFIG_HZ_250 is not set -# CONFIG_HZ_256 is not set -CONFIG_HZ_1000=y -# CONFIG_HZ_1024 is not set -CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -CONFIG_HZ=1000 -CONFIG_PREEMPT_NONE=y -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -# CONFIG_KEXEC is not set -# CONFIG_CRASH_DUMP is not set -# CONFIG_SECCOMP is not set -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_EXTABLE_SORT=y - -# -# General setup -# -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -CONFIG_LOCALVERSION="" -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_DEFAULT_HOSTNAME="(none)" -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_FHANDLE is not set -# CONFIG_AUDIT is not set -CONFIG_HAVE_GENERIC_HARDIRQS=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_HARDIRQS=y -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_GENERIC_CMOS_UPDATE=y - -# -# Timers subsystem -# -CONFIG_TICK_ONESHOT=y -# CONFIG_NO_HZ is not set -CONFIG_HIGH_RES_TIMERS=y - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_TREE_RCU=y -# CONFIG_PREEMPT_RCU is not set -CONFIG_RCU_STALL_COMMON=y -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RCU_FANOUT_EXACT is not set -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_NOCB_CPU is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=14 -# CONFIG_CGROUPS is not set -# CONFIG_CHECKPOINT_RESTORE is not set -# CONFIG_NAMESPACES is not set -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_SYSFS_DEPRECATED=y -CONFIG_SYSFS_DEPRECATED_V2=y -CONFIG_RELAY=y -# CONFIG_BLK_DEV_INITRD is not set -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -CONFIG_EXPERT=y -CONFIG_SYSCTL_SYSCALL=y -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -# CONFIG_PERF_EVENTS is not set -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_PCI_QUIRKS=y -CONFIG_COMPAT_BRK=y -CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_SLOB is not set -# CONFIG_PROFILING is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_KPROBES is not set -# CONFIG_JUMP_LABEL is not set -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_USE_GENERIC_SMP_HELPERS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_CLONE_BACKWARDS=y - -# -# GCOV-based kernel profiling -# -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -CONFIG_MODULE_FORCE_LOAD=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -# CONFIG_MODULE_SIG is not set -CONFIG_STOP_MACHINE=y -CONFIG_BLOCK=y -CONFIG_LBDAF=y -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -CONFIG_MAC_PARTITION=y -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -# CONFIG_IOSCHED_DEADLINE is not set -CONFIG_IOSCHED_CFQ=y -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -CONFIG_INLINE_READ_UNLOCK=y -CONFIG_INLINE_READ_UNLOCK_IRQ=y -CONFIG_INLINE_WRITE_UNLOCK=y -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -# CONFIG_FREEZER is not set - -# -# Bus options (PCI, PCMCIA, EISA, ISA, TC) -# -CONFIG_HW_HAS_PCI=y -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_IOV is not set -# CONFIG_PCI_PRI is not set -# CONFIG_PCI_PASID is not set -# CONFIG_PCIEPORTBUS is not set -CONFIG_MMU=y -# CONFIG_PCCARD is not set -# CONFIG_HOTPLUG_PCI is not set -# CONFIG_RAPIDIO is not set - -# -# Executable file formats -# -CONFIG_BINFMT_ELF=y -CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_COREDUMP=y -CONFIG_TRAD_SIGNALS=y - -# -# Power management options -# -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -# CONFIG_SUSPEND is not set -# CONFIG_HIBERNATION is not set -# CONFIG_PM_RUNTIME is not set -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=m -# CONFIG_XFRM_USER is not set -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -CONFIG_XFRM_IPCOMP=m -# CONFIG_NET_KEY is not set -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -# CONFIG_IP_ADVANCED_ROUTER is not set -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -CONFIG_IP_PNP_RARP=y -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_IP_MROUTE is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -CONFIG_INET_TUNNEL=m -# CONFIG_INET_XFRM_MODE_TRANSPORT is not set -# CONFIG_INET_XFRM_MODE_TUNNEL is not set -# CONFIG_INET_XFRM_MODE_BEET is not set -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_INET_UDP_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -CONFIG_IPV6=m -CONFIG_IPV6_PRIVACY=y -CONFIG_IPV6_ROUTER_PREF=y -# CONFIG_IPV6_ROUTE_INFO is not set -# CONFIG_IPV6_OPTIMISTIC_DAD is not set -CONFIG_INET6_AH=m -CONFIG_INET6_ESP=m -CONFIG_INET6_IPCOMP=m -CONFIG_IPV6_MIP6=m -CONFIG_INET6_XFRM_TUNNEL=m -CONFIG_INET6_TUNNEL=m -CONFIG_INET6_XFRM_MODE_TRANSPORT=m -CONFIG_INET6_XFRM_MODE_TUNNEL=m -CONFIG_INET6_XFRM_MODE_BEET=m -CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m -CONFIG_IPV6_SIT=m -# CONFIG_IPV6_SIT_6RD is not set -CONFIG_IPV6_NDISC_NODETYPE=y -CONFIG_IPV6_TUNNEL=m -# CONFIG_IPV6_GRE is not set -# CONFIG_IPV6_MULTIPLE_TABLES is not set -CONFIG_IPV6_MROUTE=y -# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set -CONFIG_IPV6_PIMSM_V2=y -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -CONFIG_STP=m -CONFIG_BRIDGE=m -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_HAVE_NET_DSA=y -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -CONFIG_LLC=m -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -CONFIG_DNS_RESOLVER=y -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_XPS=y -CONFIG_BQL=y - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -CONFIG_BT=m -CONFIG_BT_RFCOMM=m -CONFIG_BT_RFCOMM_TTY=y -CONFIG_BT_BNEP=m -# CONFIG_BT_BNEP_MC_FILTER is not set -CONFIG_BT_BNEP_PROTO_FILTER=y -CONFIG_BT_HIDP=m - -# -# Bluetooth device drivers -# -CONFIG_BT_HCIBTUSB=m -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_H4=y -CONFIG_BT_HCIUART_BCSP=y -# CONFIG_BT_HCIUART_ATH3K is not set -CONFIG_BT_HCIUART_LL=y -# CONFIG_BT_HCIUART_3WIRE is not set -CONFIG_BT_HCIBCM203X=m -CONFIG_BT_HCIBPA10X=m -CONFIG_BT_HCIBFUSB=m -CONFIG_BT_HCIVHCI=m -# CONFIG_BT_MRVL is not set -# CONFIG_BT_ATH3K is not set -# CONFIG_AF_RXRPC is not set -CONFIG_WIRELESS=y -CONFIG_WIRELESS_EXT=y -CONFIG_WEXT_CORE=y -CONFIG_WEXT_PROC=y -CONFIG_WEXT_SPY=y -CONFIG_WEXT_PRIV=y -CONFIG_CFG80211=y -# CONFIG_NL80211_TESTMODE is not set -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_REG_DEBUG is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_INTERNAL_REGDB is not set -CONFIG_CFG80211_WEXT=y -CONFIG_LIB80211=m -CONFIG_LIB80211_CRYPT_WEP=m -CONFIG_LIB80211_CRYPT_CCMP=m -CONFIG_LIB80211_CRYPT_TKIP=m -# CONFIG_LIB80211_DEBUG is not set -CONFIG_MAC80211=m -CONFIG_MAC80211_HAS_RC=y -# CONFIG_MAC80211_RC_PID is not set -CONFIG_MAC80211_RC_MINSTREL=y -CONFIG_MAC80211_RC_MINSTREL_HT=y -CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y -CONFIG_MAC80211_RC_DEFAULT="minstrel_ht" -# CONFIG_MAC80211_MESH is not set -CONFIG_MAC80211_LEDS=y -# CONFIG_MAC80211_MESSAGE_TRACING is not set -# CONFIG_MAC80211_DEBUG_MENU is not set -# CONFIG_WIMAX is not set -CONFIG_RFKILL=y -CONFIG_RFKILL_LEDS=y -CONFIG_RFKILL_INPUT=y -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_EXTRA_FIRMWARE="" -CONFIG_FW_LOADER_USER_HELPER=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_DMA_SHARED_BUFFER=y - -# -# Bus devices -# -# CONFIG_CONNECTOR is not set -CONFIG_MTD=y -# CONFIG_MTD_TESTS is not set -# CONFIG_MTD_REDBOOT_PARTS is not set -# CONFIG_MTD_CMDLINE_PARTS is not set -# CONFIG_MTD_AR7_PARTS is not set - -# -# User Modules And Translation Layers -# -CONFIG_MTD_CHAR=y -CONFIG_MTD_BLKDEVS=y -CONFIG_MTD_BLOCK=y -# CONFIG_FTL is not set -# CONFIG_NFTL is not set -# CONFIG_INFTL is not set -# CONFIG_RFD_FTL is not set -# CONFIG_SSFDC is not set -# CONFIG_SM_FTL is not set -# CONFIG_MTD_OOPS is not set -# CONFIG_MTD_SWAP is not set - -# -# RAM/ROM/Flash chip drivers -# -CONFIG_MTD_CFI=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_GEN_PROBE=y -# CONFIG_MTD_CFI_ADV_OPTIONS is not set -CONFIG_MTD_MAP_BANK_WIDTH_1=y -CONFIG_MTD_MAP_BANK_WIDTH_2=y -CONFIG_MTD_MAP_BANK_WIDTH_4=y -# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -CONFIG_MTD_CFI_I1=y -CONFIG_MTD_CFI_I2=y -# CONFIG_MTD_CFI_I4 is not set -# CONFIG_MTD_CFI_I8 is not set -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_CFI_UTIL=y -# CONFIG_MTD_RAM is not set -CONFIG_MTD_ROM=y -CONFIG_MTD_ABSENT=y - -# -# Mapping drivers for chip access -# -# CONFIG_MTD_COMPLEX_MAPPINGS is not set -CONFIG_MTD_PHYSMAP=y -# CONFIG_MTD_PHYSMAP_COMPAT is not set -# CONFIG_MTD_INTEL_VR_NOR is not set -# CONFIG_MTD_PLATRAM is not set - -# -# Self-contained MTD device drivers -# -# CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_SLRAM is not set -# CONFIG_MTD_PHRAM is not set -# CONFIG_MTD_MTDRAM is not set -# CONFIG_MTD_BLOCK2MTD is not set - -# -# Disk-On-Chip Device Drivers -# -# CONFIG_MTD_DOC2000 is not set -# CONFIG_MTD_DOC2001 is not set -# CONFIG_MTD_DOC2001PLUS is not set -# CONFIG_MTD_DOCG3 is not set -CONFIG_MTD_NAND_ECC=y -# CONFIG_MTD_NAND_ECC_SMC is not set -CONFIG_MTD_NAND=y -# CONFIG_MTD_NAND_ECC_BCH is not set -# CONFIG_MTD_SM_COMMON is not set -# CONFIG_MTD_NAND_MUSEUM_IDS is not set -# CONFIG_MTD_NAND_DENALI is not set -CONFIG_MTD_NAND_IDS=y -# CONFIG_MTD_NAND_RICOH is not set -# CONFIG_MTD_NAND_DISKONCHIP is not set -# CONFIG_MTD_NAND_DOCG4 is not set -# CONFIG_MTD_NAND_CAFE is not set -# CONFIG_MTD_NAND_NANDSIM is not set -# CONFIG_MTD_NAND_PLATFORM is not set -# CONFIG_MTD_ALAUDA is not set -# CONFIG_MTD_ONENAND is not set - -# -# LPDDR flash memory drivers -# -# CONFIG_MTD_LPDDR is not set -CONFIG_MTD_UBI=y -CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_FASTMAP is not set -# CONFIG_MTD_UBI_GLUEBI is not set -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_BLK_CPQ_DA is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_NVME is not set -# CONFIG_BLK_DEV_SX8 is not set -CONFIG_BLK_DEV_RAM=m -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=4096 -# CONFIG_BLK_DEV_XIP is not set -CONFIG_CDROM_PKTCDVD=m -CONFIG_CDROM_PKTCDVD_BUFFERS=8 -# CONFIG_CDROM_PKTCDVD_WCACHE is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_BLK_DEV_HD is not set -# CONFIG_BLK_DEV_RBD is not set -# CONFIG_BLK_DEV_RSXX is not set - -# -# Misc devices -# -# CONFIG_SENSORS_LIS3LV02D is not set -# CONFIG_AD525X_DPOT is not set -# CONFIG_ATMEL_PWM is not set -# CONFIG_PHANTOM is not set -# CONFIG_INTEL_MID_PTI is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ATMEL_SSC is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO is not set -# CONFIG_APDS9802ALS is not set -# CONFIG_ISL29003 is not set -# CONFIG_ISL29020 is not set -# CONFIG_SENSORS_TSL2550 is not set -# CONFIG_SENSORS_BH1780 is not set -# CONFIG_SENSORS_BH1770 is not set -# CONFIG_SENSORS_APDS990X is not set -# CONFIG_HMC6352 is not set -# CONFIG_DS1682 is not set -# CONFIG_BMP085_I2C is not set -# CONFIG_PCH_PHUB is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -CONFIG_EEPROM_93CX6=y -# CONFIG_CB710_CORE is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_SENSORS_LIS3_I2C is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set -CONFIG_HAVE_IDE=y -# CONFIG_IDE is not set - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_RAID_ATTRS is not set -CONFIG_SCSI=y -CONFIG_SCSI_DMA=y -# CONFIG_SCSI_TGT is not set -# CONFIG_SCSI_NETLINK is not set -CONFIG_SCSI_PROC_FS=y - -# -# SCSI support type (disk, tape, CD-ROM) -# -CONFIG_BLK_DEV_SD=y -# CONFIG_CHR_DEV_ST is not set -# CONFIG_CHR_DEV_OSST is not set -CONFIG_BLK_DEV_SR=m -# CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_CHR_DEV_SG=y -# CONFIG_CHR_DEV_SCH is not set -# CONFIG_SCSI_MULTI_LUN is not set -# CONFIG_SCSI_CONSTANTS is not set -# CONFIG_SCSI_LOGGING is not set -# CONFIG_SCSI_SCAN_ASYNC is not set - -# -# SCSI Transports -# -# CONFIG_SCSI_SPI_ATTRS is not set -# CONFIG_SCSI_FC_ATTRS is not set -# CONFIG_SCSI_ISCSI_ATTRS is not set -# CONFIG_SCSI_SAS_ATTRS is not set -# CONFIG_SCSI_SAS_LIBSAS is not set -# CONFIG_SCSI_SRP_ATTRS is not set -CONFIG_SCSI_LOWLEVEL=y -# CONFIG_ISCSI_TCP is not set -# CONFIG_ISCSI_BOOT_SYSFS is not set -# CONFIG_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_SCSI_BNX2X_FCOE is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_MVUMI is not set -# CONFIG_SCSI_DPT_I2O is not set -# CONFIG_SCSI_ADVANSYS is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_MPT3SAS is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_LIBFC is not set -# CONFIG_LIBFCOE is not set -# CONFIG_FCOE is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_PMCRAID is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_SRP is not set -# CONFIG_SCSI_BFA_FC is not set -# CONFIG_SCSI_CHELSIO_FCOE is not set -# CONFIG_SCSI_DH is not set -# CONFIG_SCSI_OSD_INITIATOR is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_ATA_VERBOSE_ERROR=y -CONFIG_SATA_PMP=y - -# -# Controllers with non-SFF native interface -# -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_AHCI_PLATFORM is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_SATA_ACARD_AHCI is not set -# CONFIG_SATA_SIL24 is not set -CONFIG_ATA_SFF=y - -# -# SFF controllers with custom DMA interface -# -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_SX4 is not set -CONFIG_ATA_BMDMA=y - -# -# SATA SFF controllers with BMDMA -# -# CONFIG_ATA_PIIX is not set -# CONFIG_SATA_HIGHBANK is not set -# CONFIG_SATA_MV is not set -# CONFIG_SATA_NV is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_SVW is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set - -# -# PATA SFF controllers with BMDMA -# -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_ATP867X is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CS5536 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_MARVELL is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RDC is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SCH is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_TOSHIBA is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set - -# -# PIO-only SFF controllers -# -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_PLATFORM is not set -# CONFIG_PATA_RZ1000 is not set - -# -# Generic fallback / legacy drivers -# -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_LEGACY is not set -# CONFIG_MD is not set -# CONFIG_TARGET_CORE is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# CONFIG_I2O is not set -CONFIG_NETDEVICES=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -# CONFIG_DUMMY is not set -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_MII=y -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_VXLAN is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -CONFIG_TUN=m -# CONFIG_VETH is not set -# CONFIG_ARCNET is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6060 is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -CONFIG_ETHERNET=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -# CONFIG_NET_VENDOR_ALTEON is not set -# CONFIG_NET_VENDOR_AMD is not set -# CONFIG_NET_VENDOR_ATHEROS is not set -# CONFIG_NET_CADENCE is not set -CONFIG_NET_VENDOR_BROADCOM=y -# CONFIG_B44 is not set -# CONFIG_BNX2 is not set -# CONFIG_CNIC is not set -# CONFIG_TIGON3 is not set -# CONFIG_BNX2X is not set -# CONFIG_NET_VENDOR_BROCADE is not set -# CONFIG_NET_CALXEDA_XGMAC is not set -# CONFIG_NET_VENDOR_CHELSIO is not set -# CONFIG_NET_VENDOR_CISCO is not set -# CONFIG_DM9000 is not set -# CONFIG_DNET is not set -# CONFIG_NET_VENDOR_DEC is not set -# CONFIG_NET_VENDOR_DLINK is not set -# CONFIG_NET_VENDOR_EMULEX is not set -# CONFIG_NET_VENDOR_EXAR is not set -# CONFIG_NET_VENDOR_HP is not set -# CONFIG_NET_VENDOR_INTEL is not set -# CONFIG_IP1000 is not set -# CONFIG_JME is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MELLANOX is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_MYRI is not set -# CONFIG_FEALNX is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NVIDIA is not set -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_ETHOC is not set -# CONFIG_NET_PACKET_ENGINE is not set -# CONFIG_NET_VENDOR_QLOGIC is not set -# CONFIG_NET_VENDOR_REALTEK is not set -# CONFIG_NET_VENDOR_RDC is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_SFC is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -# CONFIG_NET_VENDOR_TOSHIBA is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WIZNET is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PHYLIB=m - -# -# MII PHY device drivers -# -# CONFIG_AT803X_PHY is not set -# CONFIG_AMD_PHY is not set -# CONFIG_MARVELL_PHY is not set -# CONFIG_DAVICOM_PHY is not set -# CONFIG_QSEMI_PHY is not set -# CONFIG_LXT_PHY is not set -# CONFIG_CICADA_PHY is not set -# CONFIG_VITESSE_PHY is not set -# CONFIG_SMSC_PHY is not set -# CONFIG_BROADCOM_PHY is not set -# CONFIG_BCM87XX_PHY is not set -# CONFIG_ICPLUS_PHY is not set -# CONFIG_REALTEK_PHY is not set -# CONFIG_NATIONAL_PHY is not set -# CONFIG_STE10XP is not set -# CONFIG_LSI_ET1011C_PHY is not set -# CONFIG_MICREL_PHY is not set -# CONFIG_MDIO_BITBANG is not set -CONFIG_PPP=m -CONFIG_PPP_BSDCOMP=m -CONFIG_PPP_DEFLATE=m -CONFIG_PPP_FILTER=y -CONFIG_PPP_MPPE=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPPOE=m -CONFIG_PPP_ASYNC=m -CONFIG_PPP_SYNC_TTY=m -# CONFIG_SLIP is not set -CONFIG_SLHC=m - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -# CONFIG_USB_RTL8150 is not set -CONFIG_USB_USBNET=m -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_AX88179_178A=m -CONFIG_USB_NET_CDCETHER=m -# CONFIG_USB_NET_CDC_EEM is not set -CONFIG_USB_NET_CDC_NCM=m -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_GL620A is not set -CONFIG_USB_NET_NET1080=m -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -CONFIG_USB_NET_RNDIS_HOST=m -CONFIG_USB_NET_CDC_SUBSET=m -# CONFIG_USB_ALI_M5632 is not set -# CONFIG_USB_AN2720 is not set -CONFIG_USB_BELKIN=y -CONFIG_USB_ARMLINUX=y -# CONFIG_USB_EPSON2888 is not set -# CONFIG_USB_KC2190 is not set -CONFIG_USB_NET_ZAURUS=m -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_QMI_WWAN is not set -CONFIG_USB_HSO=m -# CONFIG_USB_NET_INT51X1 is not set -CONFIG_USB_IPHETH=m -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_VL600 is not set -CONFIG_WLAN=y -CONFIG_LIBERTAS_THINFIRM=m -# CONFIG_LIBERTAS_THINFIRM_DEBUG is not set -CONFIG_LIBERTAS_THINFIRM_USB=m -CONFIG_ATMEL=m -# CONFIG_PCI_ATMEL is not set -CONFIG_AT76C50X_USB=m -CONFIG_PRISM54=m -CONFIG_USB_ZD1201=y -CONFIG_USB_NET_RNDIS_WLAN=m -CONFIG_RTL8180=m -CONFIG_RTL8187=m -CONFIG_RTL8187_LEDS=y -CONFIG_ADM8211=m -CONFIG_MAC80211_HWSIM=m -CONFIG_MWL8K=m -CONFIG_ATH_COMMON=m -CONFIG_ATH_CARDS=m -# CONFIG_ATH_DEBUG is not set -CONFIG_ATH5K=m -# CONFIG_ATH5K_DEBUG is not set -CONFIG_ATH5K_PCI=y -CONFIG_ATH9K_HW=m -CONFIG_ATH9K_COMMON=m -CONFIG_ATH9K_BTCOEX_SUPPORT=y -CONFIG_ATH9K=m -CONFIG_ATH9K_PCI=y -# CONFIG_ATH9K_AHB is not set -# CONFIG_ATH9K_DEBUGFS is not set -CONFIG_ATH9K_RATE_CONTROL=y -CONFIG_ATH9K_HTC=m -CONFIG_CARL9170=m -CONFIG_CARL9170_LEDS=y -CONFIG_CARL9170_WPC=y -# CONFIG_CARL9170_HWRNG is not set -CONFIG_ATH6KL=m -CONFIG_ATH6KL_USB=m -# CONFIG_ATH6KL_DEBUG is not set -CONFIG_AR5523=m -CONFIG_WIL6210=m -CONFIG_WIL6210_ISR_COR=y -CONFIG_B43=m -CONFIG_B43_SSB=y -CONFIG_B43_PCI_AUTOSELECT=y -CONFIG_B43_PCICORE_AUTOSELECT=y -CONFIG_B43_PIO=y -CONFIG_B43_PHY_N=y -CONFIG_B43_PHY_LP=y -CONFIG_B43_PHY_HT=y -CONFIG_B43_LEDS=y -CONFIG_B43_HWRNG=y -# CONFIG_B43_DEBUG is not set -CONFIG_B43LEGACY=m -CONFIG_B43LEGACY_PCI_AUTOSELECT=y -CONFIG_B43LEGACY_PCICORE_AUTOSELECT=y -CONFIG_B43LEGACY_LEDS=y -CONFIG_B43LEGACY_HWRNG=y -# CONFIG_B43LEGACY_DEBUG is not set -CONFIG_B43LEGACY_DMA=y -CONFIG_B43LEGACY_PIO=y -CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y -# CONFIG_B43LEGACY_DMA_MODE is not set -# CONFIG_B43LEGACY_PIO_MODE is not set -CONFIG_BRCMUTIL=m -CONFIG_BRCMFMAC=m -# CONFIG_BRCMFMAC_USB is not set -# CONFIG_BRCM_TRACING is not set -# CONFIG_BRCMDBG is not set -CONFIG_HOSTAP=m -CONFIG_HOSTAP_FIRMWARE=y -# CONFIG_HOSTAP_FIRMWARE_NVRAM is not set -CONFIG_HOSTAP_PLX=m -CONFIG_HOSTAP_PCI=m -CONFIG_IPW2100=m -# CONFIG_IPW2100_MONITOR is not set -# CONFIG_IPW2100_DEBUG is not set -CONFIG_IPW2200=m -# CONFIG_IPW2200_MONITOR is not set -# CONFIG_IPW2200_QOS is not set -# CONFIG_IPW2200_DEBUG is not set -CONFIG_LIBIPW=m -# CONFIG_LIBIPW_DEBUG is not set -CONFIG_IWLWIFI=m -CONFIG_IWLDVM=m -CONFIG_IWLMVM=m - -# -# Debugging Options -# -# CONFIG_IWLWIFI_DEBUG is not set -CONFIG_IWLWIFI_P2P=y -CONFIG_IWLEGACY=m -CONFIG_IWL4965=m -CONFIG_IWL3945=m - -# -# iwl3945 / iwl4965 Debugging Options -# -# CONFIG_IWLEGACY_DEBUG is not set -CONFIG_LIBERTAS=m -CONFIG_LIBERTAS_USB=m -# CONFIG_LIBERTAS_DEBUG is not set -# CONFIG_LIBERTAS_MESH is not set -CONFIG_HERMES=m -CONFIG_HERMES_PRISM=y -CONFIG_HERMES_CACHE_FW_ON_INIT=y -# CONFIG_PLX_HERMES is not set -# CONFIG_TMD_HERMES is not set -# CONFIG_NORTEL_HERMES is not set -# CONFIG_PCI_HERMES is not set -CONFIG_ORINOCO_USB=m -CONFIG_P54_COMMON=m -CONFIG_P54_USB=m -# CONFIG_P54_PCI is not set -CONFIG_P54_LEDS=y -CONFIG_RT2X00=m -# CONFIG_RT2400PCI is not set -# CONFIG_RT2500PCI is not set -# CONFIG_RT61PCI is not set -# CONFIG_RT2800PCI is not set -CONFIG_RT2500USB=m -CONFIG_RT73USB=m -CONFIG_RT2800USB=m -CONFIG_RT2800USB_RT33XX=y -CONFIG_RT2800USB_RT35XX=y -CONFIG_RT2800USB_RT53XX=y -CONFIG_RT2800USB_UNKNOWN=y -CONFIG_RT2800_LIB=m -CONFIG_RT2X00_LIB_USB=m -CONFIG_RT2X00_LIB=m -CONFIG_RT2X00_LIB_FIRMWARE=y -CONFIG_RT2X00_LIB_CRYPTO=y -CONFIG_RT2X00_LIB_LEDS=y -# CONFIG_RT2X00_DEBUG is not set -CONFIG_RTLWIFI=m -CONFIG_RTLWIFI_DEBUG=y -CONFIG_RTL8192CE=m -CONFIG_RTL8192SE=m -CONFIG_RTL8192DE=m -CONFIG_RTL8723AE=m -CONFIG_RTL8192CU=m -CONFIG_RTL8192C_COMMON=m -CONFIG_WL_TI=y -CONFIG_WL1251=m -CONFIG_WL12XX=m -CONFIG_WL18XX=m -CONFIG_WLCORE=m -CONFIG_ZD1211RW=m -# CONFIG_ZD1211RW_DEBUG is not set -CONFIG_MWIFIEX=y -CONFIG_MWIFIEX_PCIE=m -CONFIG_MWIFIEX_USB=m - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_VMXNET3 is not set -# CONFIG_ISDN is not set - -# -# Input device support -# -CONFIG_INPUT=y -CONFIG_INPUT_FF_MEMLESS=m -CONFIG_INPUT_POLLDEV=m -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_MATRIXKMAP is not set - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# CONFIG_INPUT_JOYDEV is not set -CONFIG_INPUT_EVDEV=y -# CONFIG_INPUT_EVBUG is not set - -# -# Input Device Drivers -# -CONFIG_INPUT_KEYBOARD=y -# CONFIG_KEYBOARD_ADP5588 is not set -# CONFIG_KEYBOARD_ADP5589 is not set -# CONFIG_KEYBOARD_ATKBD is not set -# CONFIG_KEYBOARD_QT1070 is not set -# CONFIG_KEYBOARD_QT2160 is not set -# CONFIG_KEYBOARD_LKKBD is not set -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_LM8333 is not set -# CONFIG_KEYBOARD_MAX7359 is not set -# CONFIG_KEYBOARD_MCS is not set -# CONFIG_KEYBOARD_MPR121 is not set -# CONFIG_KEYBOARD_NEWTON is not set -# CONFIG_KEYBOARD_OPENCORES is not set -# CONFIG_KEYBOARD_SAMSUNG is not set -# CONFIG_KEYBOARD_STOWAWAY is not set -# CONFIG_KEYBOARD_SUNKBD is not set -# CONFIG_KEYBOARD_XTKBD is not set -CONFIG_INPUT_MOUSE=y -# CONFIG_MOUSE_PS2 is not set -# CONFIG_MOUSE_SERIAL is not set -# CONFIG_MOUSE_APPLETOUCH is not set -# CONFIG_MOUSE_BCM5974 is not set -# CONFIG_MOUSE_CYAPA is not set -# CONFIG_MOUSE_VSXXXAA is not set -# CONFIG_MOUSE_SYNAPTICS_I2C is not set -# CONFIG_MOUSE_SYNAPTICS_USB is not set -# CONFIG_INPUT_JOYSTICK is not set -# CONFIG_INPUT_TABLET is not set -# CONFIG_INPUT_TOUCHSCREEN is not set -# CONFIG_INPUT_MISC is not set - -# -# Hardware I/O ports -# -# CONFIG_SERIO is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT is not set -CONFIG_UNIX98_PTYS=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -# CONFIG_LEGACY_PTYS is not set -# CONFIG_SERIAL_NONSTANDARD is not set -# CONFIG_NOZOMI is not set -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVKMEM=y - -# -# Serial drivers -# -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_NR_UARTS=4 -CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -# CONFIG_SERIAL_8250_EXTENDED is not set -# CONFIG_SERIAL_8250_DW is not set - -# -# Non-8250 serial port support -# -# CONFIG_SERIAL_MFD_HSU is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_TIMBERDALE is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_PCH_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=y -# CONFIG_HW_RANDOM_TIMERIOMEM is not set -# CONFIG_HW_RANDOM_ATMEL is not set -# CONFIG_HW_RANDOM_EXYNOS is not set -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_ALGOBIT=m - -# -# I2C Hardware Bus support -# - -# -# PC SMBus host controller drivers -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_DESIGNWARE_PCI is not set -# CONFIG_I2C_EG20T is not set -# CONFIG_I2C_INTEL_MID is not set -# CONFIG_I2C_OCORES is not set -# CONFIG_I2C_PCA_PLATFORM is not set -# CONFIG_I2C_PXA_PCI is not set -# CONFIG_I2C_SIMTEC is not set -# CONFIG_I2C_XILINX is not set - -# -# External I2C/SMBus adapter drivers -# -# CONFIG_I2C_DIOLAN_U2C is not set -# CONFIG_I2C_PARPORT_LIGHT is not set -# CONFIG_I2C_TAOS_EVM is not set -# CONFIG_I2C_TINY_USB is not set - -# -# Other I2C/SMBus bus drivers -# -# CONFIG_I2C_STUB is not set -# CONFIG_I2C_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -# CONFIG_SPI is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -# CONFIG_PTP_1588_CLOCK_PCH is not set -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_GPIO_DEVRES=y -# CONFIG_W1 is not set -CONFIG_POWER_SUPPLY=y -# CONFIG_POWER_SUPPLY_DEBUG is not set -# CONFIG_PDA_POWER is not set -# CONFIG_TEST_POWER is not set -# CONFIG_BATTERY_DS2780 is not set -# CONFIG_BATTERY_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_BATTERY_BQ27x00 is not set -# CONFIG_BATTERY_MAX17040 is not set -# CONFIG_BATTERY_MAX17042 is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_CHARGER_SMB347 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_AVS is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -# CONFIG_WATCHDOG is not set -CONFIG_SSB_POSSIBLE=y - -# -# Sonics Silicon Backplane -# -CONFIG_SSB=m -CONFIG_SSB_SPROM=y -CONFIG_SSB_BLOCKIO=y -CONFIG_SSB_PCIHOST_POSSIBLE=y -CONFIG_SSB_PCIHOST=y -CONFIG_SSB_B43_PCI_BRIDGE=y -# CONFIG_SSB_SILENT is not set -# CONFIG_SSB_DEBUG is not set -CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y -CONFIG_SSB_DRIVER_PCICORE=y -# CONFIG_SSB_DRIVER_MIPS is not set -CONFIG_BCMA_POSSIBLE=y - -# -# Broadcom specific AMBA -# -# CONFIG_BCMA is not set - -# -# Multifunction device drivers -# -CONFIG_MFD_CORE=m -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_RTSX_PCI is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_TC3589X is not set -# CONFIG_MFD_TMIO is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_LPC_SCH is not set -# CONFIG_LPC_ICH is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_VX855 is not set -CONFIG_MFD_WL1273_CORE=m -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_AS3711 is not set -# CONFIG_REGULATOR is not set -CONFIG_MEDIA_SUPPORT=y - -# -# Multimedia core support -# -CONFIG_MEDIA_CAMERA_SUPPORT=y -CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y -CONFIG_MEDIA_RADIO_SUPPORT=y -CONFIG_MEDIA_RC_SUPPORT=y -# CONFIG_MEDIA_CONTROLLER is not set -CONFIG_VIDEO_DEV=y -CONFIG_VIDEO_V4L2=y -# CONFIG_VIDEO_ADV_DEBUG is not set -# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set -CONFIG_VIDEO_TUNER=m -CONFIG_VIDEOBUF_GEN=m -CONFIG_VIDEOBUF_DMA_SG=m -CONFIG_VIDEOBUF_VMALLOC=m -CONFIG_VIDEOBUF_DVB=m -CONFIG_VIDEOBUF2_CORE=m -CONFIG_VIDEOBUF2_MEMOPS=m -CONFIG_VIDEOBUF2_DMA_CONTIG=m -CONFIG_VIDEOBUF2_VMALLOC=m -# CONFIG_VIDEO_V4L2_INT_DEVICE is not set -CONFIG_DVB_CORE=y -CONFIG_DVB_NET=y -CONFIG_TTPCI_EEPROM=m -CONFIG_DVB_MAX_ADAPTERS=8 -CONFIG_DVB_DYNAMIC_MINORS=y - -# -# Media drivers -# -CONFIG_RC_CORE=y -CONFIG_RC_MAP=y -# CONFIG_RC_DECODERS is not set -# CONFIG_RC_DEVICES is not set -CONFIG_MEDIA_USB_SUPPORT=y - -# -# Webcam devices -# -CONFIG_USB_VIDEO_CLASS=m -CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y -CONFIG_USB_GSPCA=m -CONFIG_USB_M5602=m -CONFIG_USB_STV06XX=m -CONFIG_USB_GL860=m -CONFIG_USB_GSPCA_BENQ=m -CONFIG_USB_GSPCA_CONEX=m -CONFIG_USB_GSPCA_CPIA1=m -CONFIG_USB_GSPCA_ETOMS=m -CONFIG_USB_GSPCA_FINEPIX=m -CONFIG_USB_GSPCA_JEILINJ=m -CONFIG_USB_GSPCA_JL2005BCD=m -CONFIG_USB_GSPCA_KINECT=m -CONFIG_USB_GSPCA_KONICA=m -CONFIG_USB_GSPCA_MARS=m -CONFIG_USB_GSPCA_MR97310A=m -CONFIG_USB_GSPCA_NW80X=m -CONFIG_USB_GSPCA_OV519=m -CONFIG_USB_GSPCA_OV534=m -CONFIG_USB_GSPCA_OV534_9=m -CONFIG_USB_GSPCA_PAC207=m -CONFIG_USB_GSPCA_PAC7302=m -CONFIG_USB_GSPCA_PAC7311=m -CONFIG_USB_GSPCA_SE401=m -CONFIG_USB_GSPCA_SN9C2028=m -CONFIG_USB_GSPCA_SN9C20X=m -CONFIG_USB_GSPCA_SONIXB=m -CONFIG_USB_GSPCA_SONIXJ=m -CONFIG_USB_GSPCA_SPCA500=m -CONFIG_USB_GSPCA_SPCA501=m -CONFIG_USB_GSPCA_SPCA505=m -CONFIG_USB_GSPCA_SPCA506=m -CONFIG_USB_GSPCA_SPCA508=m -CONFIG_USB_GSPCA_SPCA561=m -CONFIG_USB_GSPCA_SPCA1528=m -CONFIG_USB_GSPCA_SQ905=m -CONFIG_USB_GSPCA_SQ905C=m -CONFIG_USB_GSPCA_SQ930X=m -CONFIG_USB_GSPCA_STK014=m -CONFIG_USB_GSPCA_STV0680=m -CONFIG_USB_GSPCA_SUNPLUS=m -CONFIG_USB_GSPCA_T613=m -CONFIG_USB_GSPCA_TOPRO=m -CONFIG_USB_GSPCA_TV8532=m -CONFIG_USB_GSPCA_VC032X=m -CONFIG_USB_GSPCA_VICAM=m -CONFIG_USB_GSPCA_XIRLINK_CIT=m -CONFIG_USB_GSPCA_ZC3XX=m -CONFIG_USB_PWC=m -# CONFIG_USB_PWC_DEBUG is not set -CONFIG_USB_PWC_INPUT_EVDEV=y -CONFIG_VIDEO_CPIA2=m -CONFIG_USB_ZR364XX=m -CONFIG_USB_STKWEBCAM=m -CONFIG_USB_S2255=m -CONFIG_USB_SN9C102=m - -# -# Analog TV USB devices -# -CONFIG_VIDEO_PVRUSB2=m -CONFIG_VIDEO_PVRUSB2_SYSFS=y -CONFIG_VIDEO_PVRUSB2_DVB=y -# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set -CONFIG_VIDEO_HDPVR=m -CONFIG_VIDEO_TLG2300=m -CONFIG_VIDEO_USBVISION=m -CONFIG_VIDEO_STK1160=m -CONFIG_VIDEO_STK1160_AC97=y - -# -# Analog/digital TV USB devices -# -CONFIG_VIDEO_AU0828=m -CONFIG_VIDEO_AU0828_V4L2=y -CONFIG_VIDEO_CX231XX=m -CONFIG_VIDEO_CX231XX_RC=y -CONFIG_VIDEO_CX231XX_ALSA=m -CONFIG_VIDEO_CX231XX_DVB=m -CONFIG_VIDEO_TM6000=m -CONFIG_VIDEO_TM6000_ALSA=m -CONFIG_VIDEO_TM6000_DVB=m - -# -# Digital TV USB devices -# -CONFIG_DVB_USB=m -# CONFIG_DVB_USB_DEBUG is not set -CONFIG_DVB_USB_A800=m -CONFIG_DVB_USB_DIBUSB_MB=m -CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y -CONFIG_DVB_USB_DIBUSB_MC=m -CONFIG_DVB_USB_DIB0700=m -CONFIG_DVB_USB_UMT_010=m -CONFIG_DVB_USB_CXUSB=m -CONFIG_DVB_USB_M920X=m -CONFIG_DVB_USB_DIGITV=m -CONFIG_DVB_USB_VP7045=m -CONFIG_DVB_USB_VP702X=m -CONFIG_DVB_USB_GP8PSK=m -CONFIG_DVB_USB_NOVA_T_USB2=m -CONFIG_DVB_USB_TTUSB2=m -CONFIG_DVB_USB_DTT200U=m -CONFIG_DVB_USB_OPERA1=m -CONFIG_DVB_USB_AF9005=m -CONFIG_DVB_USB_AF9005_REMOTE=m -CONFIG_DVB_USB_PCTV452E=m -CONFIG_DVB_USB_DW2102=m -CONFIG_DVB_USB_CINERGY_T2=m -CONFIG_DVB_USB_DTV5100=m -CONFIG_DVB_USB_FRIIO=m -CONFIG_DVB_USB_AZ6027=m -CONFIG_DVB_USB_TECHNISAT_USB2=m -CONFIG_DVB_USB_V2=m -CONFIG_DVB_USB_CYPRESS_FIRMWARE=m -CONFIG_DVB_USB_AF9015=m -CONFIG_DVB_USB_AF9035=m -CONFIG_DVB_USB_ANYSEE=m -CONFIG_DVB_USB_AU6610=m -CONFIG_DVB_USB_AZ6007=m -CONFIG_DVB_USB_CE6230=m -CONFIG_DVB_USB_EC168=m -CONFIG_DVB_USB_GL861=m -CONFIG_DVB_USB_IT913X=m -CONFIG_DVB_USB_LME2510=m -CONFIG_DVB_USB_MXL111SF=m -CONFIG_DVB_USB_RTL28XXU=m -CONFIG_DVB_TTUSB_BUDGET=m -CONFIG_DVB_TTUSB_DEC=m -CONFIG_SMS_USB_DRV=m -CONFIG_DVB_B2C2_FLEXCOP_USB=m -# CONFIG_DVB_B2C2_FLEXCOP_USB_DEBUG is not set - -# -# Webcam, TV (analog/digital) USB devices -# -CONFIG_VIDEO_EM28XX=m -CONFIG_VIDEO_EM28XX_ALSA=m -CONFIG_VIDEO_EM28XX_DVB=m -CONFIG_VIDEO_EM28XX_RC=m -# CONFIG_MEDIA_PCI_SUPPORT is not set -CONFIG_V4L_PLATFORM_DRIVERS=y -CONFIG_VIDEO_CAFE_CCIC=m -CONFIG_SOC_CAMERA=m -CONFIG_SOC_CAMERA_PLATFORM=m -CONFIG_VIDEO_SH_MOBILE_CSI2=m -CONFIG_VIDEO_SH_MOBILE_CEU=m -# CONFIG_V4L_MEM2MEM_DRIVERS is not set -# CONFIG_V4L_TEST_DRIVERS is not set - -# -# Supported MMC/SDIO adapters -# -CONFIG_RADIO_ADAPTERS=y -CONFIG_RADIO_SI470X=y -CONFIG_USB_SI470X=m -CONFIG_I2C_SI470X=m -CONFIG_USB_MR800=m -CONFIG_USB_DSBR=m -CONFIG_RADIO_MAXIRADIO=m -CONFIG_RADIO_SHARK=m -CONFIG_RADIO_SHARK2=m -CONFIG_I2C_SI4713=m -CONFIG_RADIO_SI4713=m -CONFIG_USB_KEENE=m -CONFIG_USB_MA901=m -CONFIG_RADIO_TEA5764=m -CONFIG_RADIO_SAA7706H=m -CONFIG_RADIO_TEF6862=m -CONFIG_RADIO_WL1273=m - -# -# Texas Instruments WL128x FM driver (ST based) -# -CONFIG_MEDIA_COMMON_OPTIONS=y - -# -# common driver options -# -CONFIG_VIDEO_CX2341X=m -CONFIG_VIDEO_TVEEPROM=m -CONFIG_DVB_B2C2_FLEXCOP=m -CONFIG_SMS_SIANO_MDTV=m -# CONFIG_SMS_SIANO_RC is not set - -# -# Media ancillary drivers (tuners, sensors, i2c, frontends) -# -# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set -CONFIG_VIDEO_IR_I2C=y - -# -# Encoders, decoders, sensors and other helper chips -# - -# -# Audio decoders, processors and mixers -# -# CONFIG_VIDEO_TVAUDIO is not set -# CONFIG_VIDEO_TDA7432 is not set -# CONFIG_VIDEO_TDA9840 is not set -# CONFIG_VIDEO_TEA6415C is not set -# CONFIG_VIDEO_TEA6420 is not set -CONFIG_VIDEO_MSP3400=m -# CONFIG_VIDEO_CS5345 is not set -CONFIG_VIDEO_CS53L32A=m -# CONFIG_VIDEO_TLV320AIC23B is not set -CONFIG_VIDEO_WM8775=m -# CONFIG_VIDEO_WM8739 is not set -# CONFIG_VIDEO_VP27SMPX is not set - -# -# RDS decoders -# -# CONFIG_VIDEO_SAA6588 is not set - -# -# Video decoders -# -# CONFIG_VIDEO_ADV7180 is not set -# CONFIG_VIDEO_ADV7183 is not set -# CONFIG_VIDEO_BT819 is not set -# CONFIG_VIDEO_BT856 is not set -# CONFIG_VIDEO_BT866 is not set -# CONFIG_VIDEO_KS0127 is not set -# CONFIG_VIDEO_SAA7110 is not set -CONFIG_VIDEO_SAA711X=m -# CONFIG_VIDEO_SAA7191 is not set -# CONFIG_VIDEO_TVP514X is not set -# CONFIG_VIDEO_TVP5150 is not set -# CONFIG_VIDEO_TVP7002 is not set -# CONFIG_VIDEO_VPX3220 is not set - -# -# Video and audio decoders -# -# CONFIG_VIDEO_SAA717X is not set -CONFIG_VIDEO_CX25840=m - -# -# Video encoders -# -# CONFIG_VIDEO_SAA7127 is not set -# CONFIG_VIDEO_SAA7185 is not set -# CONFIG_VIDEO_ADV7170 is not set -# CONFIG_VIDEO_ADV7175 is not set -# CONFIG_VIDEO_ADV7343 is not set -# CONFIG_VIDEO_ADV7393 is not set -# CONFIG_VIDEO_AK881X is not set - -# -# Camera sensor devices -# -CONFIG_VIDEO_OV7670=m -# CONFIG_VIDEO_VS6624 is not set -# CONFIG_VIDEO_MT9V011 is not set -# CONFIG_VIDEO_SR030PC30 is not set - -# -# Flash devices -# - -# -# Video improvement chips -# -# CONFIG_VIDEO_UPD64031A is not set -# CONFIG_VIDEO_UPD64083 is not set - -# -# Miscelaneous helper chips -# -# CONFIG_VIDEO_THS7303 is not set -# CONFIG_VIDEO_M52790 is not set - -# -# Sensors used on soc_camera driver -# - -# -# soc_camera sensor drivers -# -# CONFIG_SOC_CAMERA_IMX074 is not set -# CONFIG_SOC_CAMERA_MT9M001 is not set -# CONFIG_SOC_CAMERA_MT9M111 is not set -# CONFIG_SOC_CAMERA_MT9T031 is not set -# CONFIG_SOC_CAMERA_MT9T112 is not set -# CONFIG_SOC_CAMERA_MT9V022 is not set -# CONFIG_SOC_CAMERA_OV2640 is not set -# CONFIG_SOC_CAMERA_OV5642 is not set -# CONFIG_SOC_CAMERA_OV6650 is not set -# CONFIG_SOC_CAMERA_OV772X is not set -# CONFIG_SOC_CAMERA_OV9640 is not set -# CONFIG_SOC_CAMERA_OV9740 is not set -# CONFIG_SOC_CAMERA_RJ54N1 is not set -# CONFIG_SOC_CAMERA_TW9910 is not set -# CONFIG_MEDIA_ATTACH is not set -CONFIG_MEDIA_TUNER=y - -# -# Customize TV tuners -# -CONFIG_MEDIA_TUNER_SIMPLE=m -CONFIG_MEDIA_TUNER_TDA8290=m -CONFIG_MEDIA_TUNER_TDA827X=m -CONFIG_MEDIA_TUNER_TDA18271=m -CONFIG_MEDIA_TUNER_TDA9887=m -CONFIG_MEDIA_TUNER_TEA5761=m -CONFIG_MEDIA_TUNER_TEA5767=m -CONFIG_MEDIA_TUNER_MT20XX=m -CONFIG_MEDIA_TUNER_MT2060=m -CONFIG_MEDIA_TUNER_MT2063=m -CONFIG_MEDIA_TUNER_MT2266=m -CONFIG_MEDIA_TUNER_MT2131=m -CONFIG_MEDIA_TUNER_QT1010=m -CONFIG_MEDIA_TUNER_XC2028=m -CONFIG_MEDIA_TUNER_XC5000=m -CONFIG_MEDIA_TUNER_XC4000=m -CONFIG_MEDIA_TUNER_MXL5005S=m -CONFIG_MEDIA_TUNER_MXL5007T=m -CONFIG_MEDIA_TUNER_MC44S803=m -CONFIG_MEDIA_TUNER_MAX2165=m -CONFIG_MEDIA_TUNER_TDA18218=m -CONFIG_MEDIA_TUNER_FC0011=m -CONFIG_MEDIA_TUNER_FC0012=m -CONFIG_MEDIA_TUNER_FC0013=m -CONFIG_MEDIA_TUNER_TDA18212=m -CONFIG_MEDIA_TUNER_E4000=m -CONFIG_MEDIA_TUNER_FC2580=m -CONFIG_MEDIA_TUNER_TUA9001=m - -# -# Customise DVB Frontends -# - -# -# Multistandard (satellite) frontends -# -CONFIG_DVB_STB0899=m -CONFIG_DVB_STB6100=m -CONFIG_DVB_STV090x=m -CONFIG_DVB_STV6110x=m - -# -# Multistandard (cable + terrestrial) frontends -# -CONFIG_DVB_DRXK=m -CONFIG_DVB_TDA18271C2DD=m - -# -# DVB-S (satellite) frontends -# -CONFIG_DVB_CX24110=m -CONFIG_DVB_CX24123=m -CONFIG_DVB_MT312=m -CONFIG_DVB_ZL10036=m -CONFIG_DVB_ZL10039=m -CONFIG_DVB_S5H1420=m -CONFIG_DVB_STV0288=m -CONFIG_DVB_STB6000=m -CONFIG_DVB_STV0299=m -CONFIG_DVB_STV6110=m -CONFIG_DVB_STV0900=m -CONFIG_DVB_TDA8083=m -CONFIG_DVB_TDA10086=m -CONFIG_DVB_TDA8261=m -CONFIG_DVB_VES1X93=m -CONFIG_DVB_TUNER_ITD1000=m -CONFIG_DVB_TUNER_CX24113=m -CONFIG_DVB_TDA826X=m -CONFIG_DVB_TUA6100=m -CONFIG_DVB_CX24116=m -CONFIG_DVB_SI21XX=m -CONFIG_DVB_TS2020=m -CONFIG_DVB_DS3000=m -CONFIG_DVB_MB86A16=m -CONFIG_DVB_TDA10071=m - -# -# DVB-T (terrestrial) frontends -# -CONFIG_DVB_SP8870=m -CONFIG_DVB_SP887X=m -CONFIG_DVB_CX22700=m -CONFIG_DVB_CX22702=m -CONFIG_DVB_S5H1432=m -CONFIG_DVB_DRXD=m -CONFIG_DVB_L64781=m -CONFIG_DVB_TDA1004X=m -CONFIG_DVB_NXT6000=m -CONFIG_DVB_MT352=m -CONFIG_DVB_ZL10353=m -CONFIG_DVB_DIB3000MB=m -CONFIG_DVB_DIB3000MC=m -CONFIG_DVB_DIB7000M=m -CONFIG_DVB_DIB7000P=m -CONFIG_DVB_DIB9000=m -CONFIG_DVB_TDA10048=m -CONFIG_DVB_AF9013=m -CONFIG_DVB_EC100=m -CONFIG_DVB_HD29L2=m -CONFIG_DVB_STV0367=m -CONFIG_DVB_CXD2820R=m -CONFIG_DVB_RTL2830=m -CONFIG_DVB_RTL2832=m - -# -# DVB-C (cable) frontends -# -CONFIG_DVB_VES1820=m -CONFIG_DVB_TDA10021=m -CONFIG_DVB_TDA10023=m -CONFIG_DVB_STV0297=m - -# -# ATSC (North American/Korean Terrestrial/Cable DTV) frontends -# -CONFIG_DVB_NXT200X=m -CONFIG_DVB_OR51211=m -CONFIG_DVB_OR51132=m -CONFIG_DVB_BCM3510=m -CONFIG_DVB_LGDT330X=m -CONFIG_DVB_LGDT3305=m -CONFIG_DVB_LG2160=m -CONFIG_DVB_S5H1409=m -CONFIG_DVB_AU8522=m -CONFIG_DVB_AU8522_DTV=m -CONFIG_DVB_AU8522_V4L=m -CONFIG_DVB_S5H1411=m - -# -# ISDB-T (terrestrial) frontends -# -CONFIG_DVB_S921=m -CONFIG_DVB_DIB8000=m -CONFIG_DVB_MB86A20S=m - -# -# Digital terrestrial only tuners/PLL -# -CONFIG_DVB_PLL=m -CONFIG_DVB_TUNER_DIB0070=m -CONFIG_DVB_TUNER_DIB0090=m - -# -# SEC control devices for DVB-S -# -CONFIG_DVB_LNBP21=m -CONFIG_DVB_LNBP22=m -CONFIG_DVB_ISL6405=m -CONFIG_DVB_ISL6421=m -CONFIG_DVB_ISL6423=m -CONFIG_DVB_A8293=m -CONFIG_DVB_LGS8GL5=m -CONFIG_DVB_LGS8GXX=m -CONFIG_DVB_ATBM8830=m -CONFIG_DVB_TDA665x=m -CONFIG_DVB_IX2505V=m -CONFIG_DVB_IT913X_FE=m -CONFIG_DVB_M88RS2000=m -CONFIG_DVB_AF9033=m - -# -# Tools to develop new frontends -# -# CONFIG_DVB_DUMMY_FE is not set - -# -# Graphics support -# -# CONFIG_VGA_ARB is not set -# CONFIG_DRM is not set -# CONFIG_VGASTATE is not set -# CONFIG_VIDEO_OUTPUT_CONTROL is not set -CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -# CONFIG_FB_DDC is not set -# CONFIG_FB_BOOT_VESA_SUPPORT is not set -# CONFIG_FB_CFB_FILLRECT is not set -# CONFIG_FB_CFB_COPYAREA is not set -# CONFIG_FB_CFB_IMAGEBLIT is not set -# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set -# CONFIG_FB_SYS_FILLRECT is not set -# CONFIG_FB_SYS_COPYAREA is not set -# CONFIG_FB_SYS_IMAGEBLIT is not set -# CONFIG_FB_FOREIGN_ENDIAN is not set -# CONFIG_FB_SYS_FOPS is not set -# CONFIG_FB_WMT_GE_ROPS is not set -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_I740 is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_TMIO is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_GOLDFISH is not set -# CONFIG_FB_VIRTUAL is not set -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_EXYNOS_VIDEO is not set -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -# CONFIG_LOGO is not set -CONFIG_SOUND=y -CONFIG_SOUND_OSS_CORE=y -CONFIG_SOUND_OSS_CORE_PRECLAIM=y -CONFIG_SND=y -CONFIG_SND_TIMER=y -CONFIG_SND_PCM=y -CONFIG_SND_SEQUENCER=y -# CONFIG_SND_SEQ_DUMMY is not set -CONFIG_SND_OSSEMUL=y -CONFIG_SND_MIXER_OSS=y -CONFIG_SND_PCM_OSS=y -# CONFIG_SND_PCM_OSS_PLUGINS is not set -# CONFIG_SND_SEQUENCER_OSS is not set -# CONFIG_SND_HRTIMER is not set -# CONFIG_SND_DYNAMIC_MINORS is not set -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -CONFIG_SND_VMASTER=y -# CONFIG_SND_RAWMIDI_SEQ is not set -# CONFIG_SND_OPL3_LIB_SEQ is not set -# CONFIG_SND_OPL4_LIB_SEQ is not set -# CONFIG_SND_SBAWE_SEQ is not set -# CONFIG_SND_EMU10K1_SEQ is not set -CONFIG_SND_AC97_CODEC=m -# CONFIG_SND_DRIVERS is not set -CONFIG_SND_TEA575X=m -# CONFIG_SND_PCI is not set -# CONFIG_SND_MIPS is not set -# CONFIG_SND_USB is not set -# CONFIG_SND_SOC is not set -# CONFIG_SOUND_PRIME is not set -CONFIG_AC97_BUS=m - -# -# HID support -# -CONFIG_HID=y -# CONFIG_HID_BATTERY_STRENGTH is not set -CONFIG_HIDRAW=y -# CONFIG_UHID is not set -CONFIG_HID_GENERIC=y - -# -# Special HID drivers -# -# CONFIG_HID_A4TECH is not set -# CONFIG_HID_ACRUX is not set -CONFIG_HID_APPLE=m -# CONFIG_HID_AUREAL is not set -CONFIG_HID_BELKIN=m -CONFIG_HID_CHERRY=m -# CONFIG_HID_CHICONY is not set -# CONFIG_HID_PRODIKEYS is not set -# CONFIG_HID_CYPRESS is not set -# CONFIG_HID_DRAGONRISE is not set -# CONFIG_HID_EMS_FF is not set -# CONFIG_HID_ELECOM is not set -# CONFIG_HID_EZKEY is not set -# CONFIG_HID_HOLTEK is not set -# CONFIG_HID_KEYTOUCH is not set -# CONFIG_HID_KYE is not set -# CONFIG_HID_UCLOGIC is not set -# CONFIG_HID_WALTOP is not set -# CONFIG_HID_GYRATION is not set -# CONFIG_HID_ICADE is not set -# CONFIG_HID_TWINHAN is not set -# CONFIG_HID_KENSINGTON is not set -# CONFIG_HID_LCPOWER is not set -# CONFIG_HID_LENOVO_TPKBD is not set -CONFIG_HID_LOGITECH=m -CONFIG_HID_LOGITECH_DJ=m -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -# CONFIG_LOGIG940_FF is not set -# CONFIG_LOGIWHEELS_FF is not set -CONFIG_HID_MAGICMOUSE=m -CONFIG_HID_MICROSOFT=m -CONFIG_HID_MONTEREY=m -# CONFIG_HID_MULTITOUCH is not set -# CONFIG_HID_NTRIG is not set -CONFIG_HID_ORTEK=m -# CONFIG_HID_PANTHERLORD is not set -# CONFIG_HID_PETALYNX is not set -# CONFIG_HID_PICOLCD is not set -# CONFIG_HID_PRIMAX is not set -CONFIG_HID_PS3REMOTE=m -# CONFIG_HID_ROCCAT is not set -# CONFIG_HID_SAITEK is not set -# CONFIG_HID_SAMSUNG is not set -CONFIG_HID_SONY=m -# CONFIG_HID_SPEEDLINK is not set -# CONFIG_HID_STEELSERIES is not set -CONFIG_HID_SUNPLUS=m -# CONFIG_HID_GREENASIA is not set -# CONFIG_HID_SMARTJOYPLUS is not set -# CONFIG_HID_TIVO is not set -# CONFIG_HID_TOPSEED is not set -# CONFIG_HID_THINGM is not set -# CONFIG_HID_THRUSTMASTER is not set -CONFIG_HID_WACOM=m -CONFIG_HID_WIIMOTE=m -# CONFIG_HID_WIIMOTE_EXT is not set -# CONFIG_HID_ZEROPLUS is not set -# CONFIG_HID_ZYDACRON is not set -# CONFIG_HID_SENSOR_HUB is not set - -# -# USB HID support -# -CONFIG_USB_HID=y -# CONFIG_HID_PID is not set -CONFIG_USB_HIDDEV=y - -# -# I2C HID support -# -# CONFIG_I2C_HID is not set -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB_ARCH_HAS_XHCI=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set - -# -# Miscellaneous USB options -# -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_DWC3 is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -# CONFIG_USB_XHCI_HCD is not set -# CONFIG_USB_EHCI_HCD is not set -# CONFIG_USB_OXU210HP_HCD is not set -# CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_ISP1760_HCD is not set -# CONFIG_USB_ISP1362_HCD is not set -# CONFIG_USB_OHCI_HCD is not set -# CONFIG_USB_UHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_HCD_SSB is not set -# CONFIG_USB_CHIPIDEA is not set - -# -# USB Device Class drivers -# -CONFIG_USB_ACM=m -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set - -# -# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -# - -# -# also be needed; see USB_STORAGE Help for more info -# -CONFIG_USB_STORAGE=y -# CONFIG_USB_STORAGE_DEBUG is not set -# CONFIG_USB_STORAGE_REALTEK is not set -# CONFIG_USB_STORAGE_DATAFAB is not set -# CONFIG_USB_STORAGE_FREECOM is not set -# CONFIG_USB_STORAGE_ISD200 is not set -# CONFIG_USB_STORAGE_USBAT is not set -# CONFIG_USB_STORAGE_SDDR09 is not set -# CONFIG_USB_STORAGE_SDDR55 is not set -# CONFIG_USB_STORAGE_JUMPSHOT is not set -# CONFIG_USB_STORAGE_ALAUDA is not set -# CONFIG_USB_STORAGE_ONETOUCH is not set -# CONFIG_USB_STORAGE_KARMA is not set -# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -# CONFIG_USB_STORAGE_ENE_UB6250 is not set - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set - -# -# USB port drivers -# -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -CONFIG_USB_SERIAL_AIRCABLE=m -CONFIG_USB_SERIAL_ARK3116=m -CONFIG_USB_SERIAL_BELKIN=m -CONFIG_USB_SERIAL_CH341=m -CONFIG_USB_SERIAL_WHITEHEAT=m -CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m -CONFIG_USB_SERIAL_CP210X=m -CONFIG_USB_SERIAL_CYPRESS_M8=m -CONFIG_USB_SERIAL_EMPEG=m -CONFIG_USB_SERIAL_FTDI_SIO=m -CONFIG_USB_SERIAL_FUNSOFT=m -CONFIG_USB_SERIAL_VISOR=m -CONFIG_USB_SERIAL_IPAQ=m -CONFIG_USB_SERIAL_IR=m -CONFIG_USB_SERIAL_EDGEPORT=m -CONFIG_USB_SERIAL_EDGEPORT_TI=m -CONFIG_USB_SERIAL_F81232=m -CONFIG_USB_SERIAL_GARMIN=m -CONFIG_USB_SERIAL_IPW=m -CONFIG_USB_SERIAL_IUU=m -CONFIG_USB_SERIAL_KEYSPAN_PDA=m -CONFIG_USB_SERIAL_KEYSPAN=m -CONFIG_USB_SERIAL_KEYSPAN_MPR=y -CONFIG_USB_SERIAL_KEYSPAN_USA28=y -CONFIG_USB_SERIAL_KEYSPAN_USA28X=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y -CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y -CONFIG_USB_SERIAL_KEYSPAN_USA19=y -CONFIG_USB_SERIAL_KEYSPAN_USA18X=y -CONFIG_USB_SERIAL_KEYSPAN_USA19W=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y -CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y -CONFIG_USB_SERIAL_KEYSPAN_USA49W=y -CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y -CONFIG_USB_SERIAL_KLSI=m -CONFIG_USB_SERIAL_KOBIL_SCT=m -CONFIG_USB_SERIAL_MCT_U232=m -CONFIG_USB_SERIAL_METRO=m -CONFIG_USB_SERIAL_MOS7720=m -CONFIG_USB_SERIAL_MOS7840=m -CONFIG_USB_SERIAL_MOTOROLA=m -CONFIG_USB_SERIAL_NAVMAN=m -CONFIG_USB_SERIAL_PL2303=m -CONFIG_USB_SERIAL_OTI6858=m -CONFIG_USB_SERIAL_QCAUX=m -CONFIG_USB_SERIAL_QUALCOMM=m -CONFIG_USB_SERIAL_SPCP8X5=m -CONFIG_USB_SERIAL_HP4X=m -CONFIG_USB_SERIAL_SAFE=m -CONFIG_USB_SERIAL_SAFE_PADDED=y -CONFIG_USB_SERIAL_SIEMENS_MPI=m -CONFIG_USB_SERIAL_SIERRAWIRELESS=m -CONFIG_USB_SERIAL_SYMBOL=m -CONFIG_USB_SERIAL_TI=m -CONFIG_USB_SERIAL_CYBERJACK=m -CONFIG_USB_SERIAL_XIRCOM=m -CONFIG_USB_SERIAL_WWAN=m -CONFIG_USB_SERIAL_OPTION=m -CONFIG_USB_SERIAL_OMNINET=m -CONFIG_USB_SERIAL_OPTICON=m -CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m -CONFIG_USB_SERIAL_XSENS_MT=m -CONFIG_USB_SERIAL_ZIO=m -CONFIG_USB_SERIAL_ZTE=m -CONFIG_USB_SERIAL_SSU100=m -CONFIG_USB_SERIAL_QT2=m -# CONFIG_USB_SERIAL_DEBUG is not set - -# -# USB Miscellaneous drivers -# -# CONFIG_USB_EMI62 is not set -# CONFIG_USB_EMI26 is not set -# CONFIG_USB_ADUTUX is not set -# CONFIG_USB_SEVSEG is not set -# CONFIG_USB_RIO500 is not set -# CONFIG_USB_LEGOTOWER is not set -# CONFIG_USB_LCD is not set -# CONFIG_USB_LED is not set -# CONFIG_USB_CYPRESS_CY7C63 is not set -# CONFIG_USB_CYTHERM is not set -# CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set -# CONFIG_USB_APPLEDISPLAY is not set -# CONFIG_USB_LD is not set -# CONFIG_USB_TRANCEVIBRATOR is not set -# CONFIG_USB_IOWARRIOR is not set -# CONFIG_USB_TEST is not set -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -CONFIG_USB_EZUSB_FX2=m -# CONFIG_USB_HSIC_USB3503 is not set - -# -# USB Physical Layer drivers -# -# CONFIG_OMAP_USB3 is not set -# CONFIG_OMAP_CONTROL_USB is not set -# CONFIG_USB_ISP1301 is not set -# CONFIG_USB_RCAR_PHY is not set -# CONFIG_USB_GADGET is not set - -# -# OTG and related infrastructure -# -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_UWB is not set -# CONFIG_MMC is not set -# CONFIG_MEMSTICK is not set -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y - -# -# LED drivers -# -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_LM3642 is not set -# CONFIG_LEDS_PCA9532 is not set -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP5521 is not set -# CONFIG_LEDS_LP5523 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_PCA9633 is not set -# CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_TCA6507 is not set -# CONFIG_LEDS_LM355x is not set -# CONFIG_LEDS_OT200 is not set -# CONFIG_LEDS_BLINKM is not set -CONFIG_LEDS_TRIGGERS=y - -# -# LED Triggers -# -# CONFIG_LEDS_TRIGGER_TIMER is not set -# CONFIG_LEDS_TRIGGER_ONESHOT is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set -# CONFIG_LEDS_TRIGGER_CPU is not set -# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set - -# -# iptables trigger is under Netfilter config (LED target) -# -# CONFIG_LEDS_TRIGGER_TRANSIENT is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_INFINIBAND is not set -CONFIG_RTC_LIB=y -# CONFIG_RTC_CLASS is not set -# CONFIG_DMADEVICES is not set -# CONFIG_AUXDISPLAY is not set -# CONFIG_UIO is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -CONFIG_STAGING=y -# CONFIG_ET131X is not set -# CONFIG_USBIP_CORE is not set -CONFIG_W35UND=m -CONFIG_PRISM2_USB=m -# CONFIG_ECHO is not set -# CONFIG_COMEDI is not set -# CONFIG_ASUS_OLED is not set -CONFIG_R8187SE=m -CONFIG_RTL8192U=m -CONFIG_RTLLIB=m -CONFIG_RTLLIB_CRYPTO_CCMP=m -CONFIG_RTLLIB_CRYPTO_TKIP=m -CONFIG_RTLLIB_CRYPTO_WEP=m -# CONFIG_RTL8192E is not set -CONFIG_R8712U=m -# CONFIG_RTS5139 is not set -# CONFIG_TRANZPORT is not set -# CONFIG_IDE_PHISON is not set -# CONFIG_LINE6_USB is not set -# CONFIG_USB_SERIAL_QUATECH2 is not set -# CONFIG_VT6655 is not set -# CONFIG_VT6656 is not set -# CONFIG_DX_SEP is not set -CONFIG_ZRAM=m -# CONFIG_ZRAM_DEBUG is not set -CONFIG_ZSMALLOC=y -# CONFIG_FB_SM7XX is not set -# CONFIG_CRYSTALHD is not set -# CONFIG_FB_XGI is not set -# CONFIG_USB_ENESTORAGE is not set -# CONFIG_BCM_WIMAX is not set -# CONFIG_FT1000 is not set - -# -# Speakup console speech -# -# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -CONFIG_STAGING_MEDIA=y -CONFIG_DVB_AS102=m -CONFIG_DVB_CXD2099=m -CONFIG_VIDEO_DT3155=m -CONFIG_DT3155_CCIR=y -CONFIG_DT3155_STREAMING=y -CONFIG_VIDEO_GO7007=m -CONFIG_VIDEO_GO7007_USB=m -CONFIG_VIDEO_GO7007_USB_S2250_BOARD=m -CONFIG_VIDEO_GO7007_OV7640=m -CONFIG_VIDEO_GO7007_SAA7113=m -CONFIG_VIDEO_GO7007_SAA7115=m -CONFIG_VIDEO_GO7007_TW9903=m -CONFIG_VIDEO_GO7007_UDA1342=m -CONFIG_VIDEO_GO7007_SONY_TUNER=m -CONFIG_VIDEO_GO7007_TW2804=m -CONFIG_SOLO6X10=m - -# -# Android -# -# CONFIG_ANDROID is not set -CONFIG_USB_WPAN_HCD=m -CONFIG_WIMAX_GDM72XX=m -# CONFIG_WIMAX_GDM72XX_QOS is not set -# CONFIG_WIMAX_GDM72XX_K_MODE is not set -# CONFIG_WIMAX_GDM72XX_WIMAX2 is not set -CONFIG_WIMAX_GDM72XX_USB=y -# CONFIG_NET_VENDOR_SILICOM is not set -# CONFIG_CED1401 is not set -# CONFIG_DGRP is not set - -# -# Hardware Spinlock drivers -# -# CONFIG_MAILBOX is not set -# CONFIG_IOMMU_SUPPORT is not set - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# -# CONFIG_VIRT_DRIVERS is not set -# CONFIG_PM_DEVFREQ is not set -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_VME_BUS is not set -# CONFIG_PWM is not set -# CONFIG_IPACK_BUS is not set - -# -# Firmware Drivers -# -# CONFIG_FIRMWARE_MEMMAP is not set - -# -# File systems -# -CONFIG_EXT2_FS=m -# CONFIG_EXT2_FS_XATTR is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set -# CONFIG_EXT3_FS_XATTR is not set -CONFIG_EXT4_FS=m -# CONFIG_EXT4_FS_POSIX_ACL is not set -# CONFIG_EXT4_FS_SECURITY is not set -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD=y -CONFIG_JBD2=m -CONFIG_FS_MBCACHE=m -CONFIG_REISERFS_FS=m -# CONFIG_REISERFS_CHECK is not set -# CONFIG_REISERFS_PROC_INFO is not set -# CONFIG_REISERFS_FS_XATTR is not set -# CONFIG_JFS_FS is not set -CONFIG_XFS_FS=m -# CONFIG_XFS_QUOTA is not set -# CONFIG_XFS_POSIX_ACL is not set -CONFIG_XFS_RT=y -# CONFIG_XFS_DEBUG is not set -# CONFIG_GFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_FS_POSIX_ACL is not set -CONFIG_EXPORTFS=m -CONFIG_FILE_LOCKING=y -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -# CONFIG_QUOTA is not set -# CONFIG_QUOTACTL is not set -CONFIG_AUTOFS4_FS=m -CONFIG_FUSE_FS=m -# CONFIG_CUSE is not set - -# -# Caches -# -CONFIG_FSCACHE=y -# CONFIG_FSCACHE_STATS is not set -# CONFIG_FSCACHE_HISTOGRAM is not set -# CONFIG_FSCACHE_DEBUG is not set -# CONFIG_FSCACHE_OBJECT_LIST is not set -# CONFIG_CACHEFILES is not set - -# -# CD-ROM/DVD Filesystems -# -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -# CONFIG_ZISOFS is not set -CONFIG_UDF_FS=m -CONFIG_UDF_NLS=y - -# -# DOS/FAT/NT Filesystems -# -CONFIG_FAT_FS=y -CONFIG_MSDOS_FS=m -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_CODEPAGE=437 -CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -CONFIG_NTFS_FS=m -# CONFIG_NTFS_DEBUG is not set -# CONFIG_NTFS_RW is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_TMPFS_XATTR is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_FS is not set -CONFIG_HFS_FS=m -CONFIG_HFSPLUS_FS=m -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -CONFIG_JFFS2_FS=m -CONFIG_JFFS2_FS_DEBUG=0 -CONFIG_JFFS2_FS_WRITEBUFFER=y -# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -CONFIG_JFFS2_SUMMARY=y -# CONFIG_JFFS2_FS_XATTR is not set -CONFIG_JFFS2_COMPRESSION_OPTIONS=y -CONFIG_JFFS2_ZLIB=y -CONFIG_JFFS2_LZO=y -CONFIG_JFFS2_RTIME=y -CONFIG_JFFS2_RUBIN=y -# CONFIG_JFFS2_CMODE_NONE is not set -# CONFIG_JFFS2_CMODE_PRIORITY is not set -# CONFIG_JFFS2_CMODE_SIZE is not set -CONFIG_JFFS2_CMODE_FAVOURLZO=y -CONFIG_UBIFS_FS=y -# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -CONFIG_SQUASHFS=m -# CONFIG_SQUASHFS_XATTR is not set -CONFIG_SQUASHFS_ZLIB=y -# CONFIG_SQUASHFS_LZO is not set -# CONFIG_SQUASHFS_XZ is not set -# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -# CONFIG_SQUASHFS_EMBEDDED is not set -CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -# CONFIG_F2FS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -CONFIG_NFS_FS=y -CONFIG_NFS_V2=y -CONFIG_NFS_V3=y -# CONFIG_NFS_V3_ACL is not set -CONFIG_NFS_V4=y -CONFIG_NFS_SWAP=y -CONFIG_NFS_V4_1=y -CONFIG_PNFS_FILE_LAYOUT=m -CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" -CONFIG_ROOT_NFS=y -# CONFIG_NFS_FSCACHE is not set -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_USE_KERNEL_DNS=y -CONFIG_NFSD=m -CONFIG_NFSD_V3=y -# CONFIG_NFSD_V3_ACL is not set -# CONFIG_NFSD_V4 is not set -CONFIG_LOCKD=y -CONFIG_LOCKD_V4=y -CONFIG_NFS_COMMON=y -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y -CONFIG_SUNRPC_BACKCHANNEL=y -CONFIG_SUNRPC_SWAP=y -# CONFIG_SUNRPC_DEBUG is not set -# CONFIG_CEPH_FS is not set -CONFIG_CIFS=m -# CONFIG_CIFS_STATS is not set -# CONFIG_CIFS_WEAK_PW_HASH is not set -# CONFIG_CIFS_UPCALL is not set -# CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_DEBUG is not set -# CONFIG_CIFS_DFS_UPCALL is not set -CONFIG_CIFS_SMB2=y -# CONFIG_CIFS_FSCACHE is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-15" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m -CONFIG_NLS_ISO8859_8=m -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m -CONFIG_NLS_ASCII=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=y -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -CONFIG_NLS_UTF8=y - -# -# Kernel hacking -# -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -# CONFIG_PRINTK_TIME is not set -CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 -# CONFIG_ENABLE_WARN_DEPRECATED is not set -# CONFIG_ENABLE_MUST_CHECK is not set -CONFIG_FRAME_WARN=0 -# CONFIG_MAGIC_SYSRQ is not set -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_HEADERS_CHECK is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -# CONFIG_LOCKUP_DETECTOR is not set -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_SCHED_DEBUG is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_SLAB is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_DEBUG_LOCK_ALLOC is not set -# CONFIG_PROVE_LOCKING is not set -# CONFIG_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_KOBJECT is not set -# CONFIG_DEBUG_INFO is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -# CONFIG_DEBUG_MEMORY_INIT is not set -# CONFIG_DEBUG_LIST is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set -# CONFIG_BOOT_PRINTK_DELAY is not set - -# -# RCU Debugging -# -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=60 -# CONFIG_RCU_CPU_STALL_INFO is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# CONFIG_DEBUG_PER_CPU_MAPS is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACING_SUPPORT=y -# CONFIG_FTRACE is not set -# CONFIG_RBTREE_TEST is not set -# CONFIG_INTERVAL_TREE_TEST is not set -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_KGDB is not set -# CONFIG_TEST_KSTRTOX is not set -CONFIG_EARLY_PRINTK=y -CONFIG_CMDLINE_BOOL=y -CONFIG_CMDLINE="bmem=118M ubi.mtd=0 root=ubi0:rootfs rootfstype=ubifs rw rootflags=sync" -CONFIG_CMDLINE_OVERRIDE=y -# CONFIG_DEBUG_STACKOVERFLOW is not set -# CONFIG_RUNTIME_DEBUG is not set - -# -# Security options -# -CONFIG_KEYS=y -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_KEYS_DEBUG_PROC_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_PCOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_PCRYPT is not set -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -CONFIG_CRYPTO_AUTHENC=m -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -CONFIG_CRYPTO_CCM=y -# CONFIG_CRYPTO_GCM is not set -CONFIG_CRYPTO_SEQIV=y - -# -# Block modes -# -CONFIG_CRYPTO_CBC=m -CONFIG_CRYPTO_CTR=y -# CONFIG_CRYPTO_CTS is not set -CONFIG_CRYPTO_ECB=y -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -CONFIG_CRYPTO_HMAC=y -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -CONFIG_CRYPTO_CRC32C=y -# CONFIG_CRYPTO_CRC32 is not set -# CONFIG_CRYPTO_GHASH is not set -CONFIG_CRYPTO_MD4=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_MICHAEL_MIC=m -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -CONFIG_CRYPTO_SHA1=m -CONFIG_CRYPTO_SHA256=y -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=y -# CONFIG_CRYPTO_ANUBIS is not set -CONFIG_CRYPTO_ARC4=y -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -CONFIG_CRYPTO_DES=y -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set - -# -# Compression -# -CONFIG_CRYPTO_DEFLATE=y -# CONFIG_CRYPTO_ZLIB is not set -CONFIG_CRYPTO_LZO=y - -# -# Random Number Generation -# -# CONFIG_CRYPTO_ANSI_CPRNG is not set -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=y -CONFIG_CRC_CCITT=y -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -CONFIG_CRC_ITU_T=y -CONFIG_CRC32=y -# CONFIG_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -CONFIG_CRC7=m -CONFIG_LIBCRC32C=m -# CONFIG_CRC8 is not set -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -# CONFIG_XZ_DEC is not set -# CONFIG_XZ_DEC_BCJ is not set -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y -CONFIG_HAS_DMA=y -CONFIG_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_NLATTR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -CONFIG_AVERAGE=y -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch b/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch deleted file mode 100644 index cbfc4b7..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus-3.9.6/linux-sata_bcm.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c -index 7ba20e0..1e2e947 100644 ---- a/drivers/ata/sata_brcmstb.c -+++ b/drivers/ata/sata_brcmstb.c -@@ -330,6 +330,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port) - mdio_write_reg(mmio_base, port, 0x0D, sval); - } - -+static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port) -+{ -+ uint32_t tmp32; -+ void __iomem *port_mmio; -+ -+ port_mmio = PORT_BASE(mmio_base, port); -+ -+ tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET); -+ tmp32 |= 0x08000000; -+ writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET); -+ -+ tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET); -+ tmp32 |= 0x00800000; -+ writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET); -+} -+ - static void brcm_AnalogReset(void __iomem *mmio_base, int port) - { - /* do analog reset */ -@@ -385,6 +401,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port) - brcm_SetPllTxRxCtrl(mmio_base, port); - brcm_EnableOOBWindowFix(mmio_base, port); - -+ brcm_Enable256AlignDetection(mmio_base, port); -+ - if (!port) { - #ifdef CONFIG_BRCM_SATA_75MHZ_PLL - /* use 75Mhz PLL clock */ -@@ -446,6 +464,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port) - brcm_SetPllTxRxCtrl(mmio_base, port); - brcm_EnableOOBWindowFix(mmio_base, port); - -+ brcm_Enable256AlignDetection(mmio_base, port); -+ - if (!port) { - #ifdef CONFIG_BRCM_SATA_75MHZ_PLL - /* use 75Mhz PLL clock */ -@@ -1135,7 +1155,9 @@ static int k2_sata_resume(struct device *dev) - ap = host->ports[i]; - - ata_for_each_link(link, ap, EDGE) { -+ spin_unlock_irqrestore(&hp->lock, flags); - sata_std_hardreset(link, NULL, 1000); -+ spin_lock_irqsave(&hp->lock, flags); - } - } - diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus_3.1.1.bbappend b/meta-bsp/bm750/recipes/linux/linux-vuplus_3.1.1.bbappend deleted file mode 100644 index 1018335..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus_3.1.1.bbappend +++ /dev/null @@ -1,8 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" - -PR .= "-bsp13" - -SRC_URI += "\ - file://linux_3.1.1_bm750.patch \ - file://linux-sata_brcm.patch \ -" diff --git a/meta-bsp/bm750/recipes/linux/linux-vuplus_3.9.6.bbappend b/meta-bsp/bm750/recipes/linux/linux-vuplus_3.9.6.bbappend deleted file mode 100644 index 000b73e..0000000 --- a/meta-bsp/bm750/recipes/linux/linux-vuplus_3.9.6.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -FILESEXTRAPATHS_prepend := "${THISDIR}/${P}:" - -PR .= "-bsp5" -SRC_URI += "\ - file://linux-sata_bcm.patch \ -" diff --git a/meta-bsp/bm750/recipes/vuplus/vuplus-dvb-modules.bbappend b/meta-bsp/bm750/recipes/vuplus/vuplus-dvb-modules.bbappend deleted file mode 100644 index f6c42f8..0000000 --- a/meta-bsp/bm750/recipes/vuplus/vuplus-dvb-modules.bbappend +++ /dev/null @@ -1,6 +0,0 @@ -SRCDATE = "20150317" - -MODULES_NAME = "procmk\ndvb-bcm7335\nbrcmfb" - -SRC_URI[md5sum] = "400ec6413597f8096bba506496422f6d" -SRC_URI[sha256sum] = "f5762df3a4c1281be8ac3aa87c8937b85573b60902b376b3c79a7f468face5aa" diff --git a/meta-bsp/classes/image_types_ubi.bbclass b/meta-bsp/classes/image_types_ubi.bbclass new file mode 100644 index 0000000..c8dd97b --- /dev/null +++ b/meta-bsp/classes/image_types_ubi.bbclass @@ -0,0 +1,29 @@ +inherit image_types + +UBI_VOLNAME = "rootfs" + +MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" +EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" + +IMAGE_CMD_ubi_prepend = " \ + cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ + rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ + mkfs.jffs2 --root=${IMAGE_ROOTFS}/boot --faketime \ + --disable-compressor=lzo --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + ${EXTRA_IMAGECMD_COMPAT}; rm -rf ${IMAGE_ROOTFS}/boot/*; \ +" + +IMAGE_CMD_ubi_append = " \ + vfi3 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.jffs2; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/boot_cfe_auto.jffs2; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ + rm -rf vuplus; \ +" diff --git a/meta-bsp/classes/image_types_ubi_initrd.bbclass b/meta-bsp/classes/image_types_ubi_initrd.bbclass new file mode 100644 index 0000000..360e621 --- /dev/null +++ b/meta-bsp/classes/image_types_ubi_initrd.bbclass @@ -0,0 +1,28 @@ +inherit image_types + +UBI_VOLNAME = "rootfs" +MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" +EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" + +IMAGE_CMD_ubi_prepend = " \ + cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ + cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ + cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ + rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ +" + +IMAGE_CMD_ubi_append = " \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ + touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/reboot.update; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ + rm -rf vuplus; \ +" diff --git a/meta-bsp/classes/image_types_ubi_splash.bbclass b/meta-bsp/classes/image_types_ubi_splash.bbclass new file mode 100644 index 0000000..4045781 --- /dev/null +++ b/meta-bsp/classes/image_types_ubi_splash.bbclass @@ -0,0 +1,31 @@ +inherit image_types + +UBI_VOLNAME = "rootfs" +MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" +EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" + +IMAGE_CMD_ubi_prepend = " \ + cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ + cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ + rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ + mkfs.jffs2 --root=${IMAGE_ROOTFS}/boot --faketime \ + --disable-compressor=lzo --compression-mode=size \ + --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ + ${EXTRA_IMAGECMD_COMPAT}; rm -rf ${IMAGE_ROOTFS}/boot/*; \ +" + +IMAGE_CMD_ubi_append = " \ + vfi3 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.jffs2; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/boot_cfe_auto.jffs2; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ + rm -rf vuplus; \ +" diff --git a/meta-bsp/classes/image_types_ubi_splash_initrd.bbclass b/meta-bsp/classes/image_types_ubi_splash_initrd.bbclass new file mode 100644 index 0000000..23a3409 --- /dev/null +++ b/meta-bsp/classes/image_types_ubi_splash_initrd.bbclass @@ -0,0 +1,29 @@ +inherit image_types + +UBI_VOLNAME = "rootfs" +MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT}" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" +EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" + +IMAGE_CMD_ubi_prepend = " \ + cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ + cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ + cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ + rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ +" + +IMAGE_CMD_ubi_append = " \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ + touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/reboot.update; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ + rm -rf vuplus; \ +" diff --git a/meta-bsp/classes/image_types_ubi_splash_initrd_forceupdate.bbclass b/meta-bsp/classes/image_types_ubi_splash_initrd_forceupdate.bbclass new file mode 100644 index 0000000..88bf14c --- /dev/null +++ b/meta-bsp/classes/image_types_ubi_splash_initrd_forceupdate.bbclass @@ -0,0 +1,29 @@ +inherit image_types + +UBI_VOLNAME = "rootfs" +MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT}" +UBINIZE_ARGS = "-m 2048 -p 128KiB" + +IMAGEDIR ?= "${MACHINE}" +EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" + +IMAGE_CMD_ubi_prepend = " \ + cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ + cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ + cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ + rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ + rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ +" + +IMAGE_CMD_ubi_append = " \ + mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ + cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ + touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/force.update; \ + cd ${DEPLOY_DIR_IMAGE}; \ + zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ + rm -rf vuplus; \ +" diff --git a/meta-bsp/common/classes/image_types_ubi.bbclass b/meta-bsp/common/classes/image_types_ubi.bbclass deleted file mode 100644 index c8dd97b..0000000 --- a/meta-bsp/common/classes/image_types_ubi.bbclass +++ /dev/null @@ -1,29 +0,0 @@ -inherit image_types - -UBI_VOLNAME = "rootfs" - -MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" -UBINIZE_ARGS = "-m 2048 -p 128KiB" - -IMAGEDIR ?= "${MACHINE}" -EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" - -IMAGE_CMD_ubi_prepend = " \ - cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ - rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ - mkfs.jffs2 --root=${IMAGE_ROOTFS}/boot --faketime \ - --disable-compressor=lzo --compression-mode=size \ - --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ - ${EXTRA_IMAGECMD_COMPAT}; rm -rf ${IMAGE_ROOTFS}/boot/*; \ -" - -IMAGE_CMD_ubi_append = " \ - vfi3 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ - mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.jffs2; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/boot_cfe_auto.jffs2; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ - cd ${DEPLOY_DIR_IMAGE}; \ - zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ - rm -rf vuplus; \ -" diff --git a/meta-bsp/common/classes/image_types_ubi_initrd.bbclass b/meta-bsp/common/classes/image_types_ubi_initrd.bbclass deleted file mode 100644 index 360e621..0000000 --- a/meta-bsp/common/classes/image_types_ubi_initrd.bbclass +++ /dev/null @@ -1,28 +0,0 @@ -inherit image_types - -UBI_VOLNAME = "rootfs" -MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" -UBINIZE_ARGS = "-m 2048 -p 128KiB" - -IMAGEDIR ?= "${MACHINE}" -EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" - -IMAGE_CMD_ubi_prepend = " \ - cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ - cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ - cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ - rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ -" - -IMAGE_CMD_ubi_append = " \ - mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ - touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/reboot.update; \ - cd ${DEPLOY_DIR_IMAGE}; \ - zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ - rm -rf vuplus; \ -" diff --git a/meta-bsp/common/classes/image_types_ubi_splash.bbclass b/meta-bsp/common/classes/image_types_ubi_splash.bbclass deleted file mode 100644 index 4045781..0000000 --- a/meta-bsp/common/classes/image_types_ubi_splash.bbclass +++ /dev/null @@ -1,31 +0,0 @@ -inherit image_types - -UBI_VOLNAME = "rootfs" -MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT} -F" -UBINIZE_ARGS = "-m 2048 -p 128KiB" - -IMAGEDIR ?= "${MACHINE}" -EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" - -IMAGE_CMD_ubi_prepend = " \ - cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ - cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ - rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ - mkfs.jffs2 --root=${IMAGE_ROOTFS}/boot --faketime \ - --disable-compressor=lzo --compression-mode=size \ - --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 \ - ${EXTRA_IMAGECMD_COMPAT}; rm -rf ${IMAGE_ROOTFS}/boot/*; \ -" - -IMAGE_CMD_ubi_append = " \ - vfi3 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz > ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.nfi; \ - mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.jffs2; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.boot.jffs2 ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/boot_cfe_auto.jffs2; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ - cd ${DEPLOY_DIR_IMAGE}; \ - zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ - rm -rf vuplus; \ -" diff --git a/meta-bsp/common/classes/image_types_ubi_splash_initrd.bbclass b/meta-bsp/common/classes/image_types_ubi_splash_initrd.bbclass deleted file mode 100644 index 23a3409..0000000 --- a/meta-bsp/common/classes/image_types_ubi_splash_initrd.bbclass +++ /dev/null @@ -1,29 +0,0 @@ -inherit image_types - -UBI_VOLNAME = "rootfs" -MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT}" -UBINIZE_ARGS = "-m 2048 -p 128KiB" - -IMAGEDIR ?= "${MACHINE}" -EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" - -IMAGE_CMD_ubi_prepend = " \ - cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ - cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ - cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ - rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ -" - -IMAGE_CMD_ubi_append = " \ - mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ - touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/reboot.update; \ - cd ${DEPLOY_DIR_IMAGE}; \ - zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ - rm -rf vuplus; \ -" diff --git a/meta-bsp/common/classes/image_types_ubi_splash_initrd_forceupdate.bbclass b/meta-bsp/common/classes/image_types_ubi_splash_initrd_forceupdate.bbclass deleted file mode 100644 index 88bf14c..0000000 --- a/meta-bsp/common/classes/image_types_ubi_splash_initrd_forceupdate.bbclass +++ /dev/null @@ -1,29 +0,0 @@ -inherit image_types - -UBI_VOLNAME = "rootfs" -MKUBIFS_ARGS = "-m 2048 -e 126976 -c ${MKFS_UBI_MAX_ERASE_BLK_COUNT}" -UBINIZE_ARGS = "-m 2048 -p 128KiB" - -IMAGEDIR ?= "${MACHINE}" -EXTRA_IMAGECMD_COMPAT = "--eraseblock=0x20000 -n -l" - -IMAGE_CMD_ubi_prepend = " \ - cp ${IMAGE_ROOTFS}/tmp/vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz; \ - cp ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin; \ - cp ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/tmp/vmlinux.gz; \ - rm -f ${IMAGE_ROOTFS}/boot/initrd_cfe_auto.bin; \ - rm -f ${IMAGE_ROOTFS}/boot/splash_cfe_auto.bin; \ -" - -IMAGE_CMD_ubi_append = " \ - mkdir -p ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubi ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/root_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmlinux.gz ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/kernel_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.initrd_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/initrd_cfe_auto.bin; \ - cp ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.splash_cfe_auto.bin ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/splash_cfe_auto.bin; \ - touch ${DEPLOY_DIR_IMAGE}/${IMAGE_UNPACK_PATH}/force.update; \ - cd ${DEPLOY_DIR_IMAGE}; \ - zip ${IMAGE_NAME}_usb.zip ${IMAGE_UNPACK_PATH}/*; \ - rm -rf vuplus; \ -" diff --git a/meta-bsp/common/conf/layer.conf b/meta-bsp/common/conf/layer.conf deleted file mode 100644 index b5d52e3..0000000 --- a/meta-bsp/common/conf/layer.conf +++ /dev/null @@ -1,10 +0,0 @@ -BBFILES += "${LAYERDIR}/recipes/*/*.bb" -#BBFILES += "${LAYERDIR}/recipes/*/*.bbappend" -BBPATH .= ":${LAYERDIR}" -BBFILE_COLLECTIONS += "bsp-common" -BBFILE_PRIORITY_bsp-common = "30" -BBFILE_PATTERN_bsp-common := "^${LAYERDIR}/" - -SIGGEN_EXCLUDERECIPES_ABISAFE += " \ - vuplus-bootlogo \ -" diff --git a/meta-bsp/common/conf/machine/include/vuplus-mips32el.inc b/meta-bsp/common/conf/machine/include/vuplus-mips32el.inc deleted file mode 100644 index 1652438..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-mips32el.inc +++ /dev/null @@ -1,9 +0,0 @@ -# vuplus-mips32el.inc - -VUPLUS_KERNEL_VERSION ?= "3.13.5" - -TARGET_ARCH = "mipsel" -DEFAULTTUNE = "mips32el" - -require conf/machine/include/vuplus.inc -require conf/machine/include/tune-mips32.inc diff --git a/meta-bsp/common/conf/machine/include/vuplus-ubi-initrd.inc b/meta-bsp/common/conf/machine/include/vuplus-ubi-initrd.inc deleted file mode 100644 index c284c7e..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-ubi-initrd.inc +++ /dev/null @@ -1,4 +0,0 @@ -inherit image_types_ubi_initrd - -IMAGE_FSTYPES ?= "ubi" - diff --git a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd-forceupdate.inc b/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd-forceupdate.inc deleted file mode 100644 index 282bae1..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd-forceupdate.inc +++ /dev/null @@ -1,4 +0,0 @@ -inherit image_types_ubi_splash_initrd_forceupdate - -IMAGE_FSTYPES ?= "ubi" - diff --git a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd.inc b/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd.inc deleted file mode 100644 index 8432d44..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash-initrd.inc +++ /dev/null @@ -1,4 +0,0 @@ -inherit image_types_ubi_splash_initrd - -IMAGE_FSTYPES ?= "ubi" - diff --git a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash.inc b/meta-bsp/common/conf/machine/include/vuplus-ubi-splash.inc deleted file mode 100644 index 6a12348..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-ubi-splash.inc +++ /dev/null @@ -1,4 +0,0 @@ -inherit image_types_ubi_splash - -IMAGE_FSTYPES ?= "ubi" - diff --git a/meta-bsp/common/conf/machine/include/vuplus-ubi.inc b/meta-bsp/common/conf/machine/include/vuplus-ubi.inc deleted file mode 100644 index 9207e42..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus-ubi.inc +++ /dev/null @@ -1,4 +0,0 @@ -inherit image_types_ubi - -IMAGE_FSTYPES ?= "ubi" - diff --git a/meta-bsp/common/conf/machine/include/vuplus.inc b/meta-bsp/common/conf/machine/include/vuplus.inc deleted file mode 100644 index 6d12c46..0000000 --- a/meta-bsp/common/conf/machine/include/vuplus.inc +++ /dev/null @@ -1,20 +0,0 @@ -# vuplus.inc - -GLIBC_EXTRA_OECONF = "--with-tls --with-__thread" - -MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-image" -MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "vuplus-bootlogo" -MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "${@base_contains("VUPLUS_FEATURES", "dvbproxy", "vuplus-dvb-proxy", "vuplus-dvb-modules", d)}" -MACHINE_FEATURES += "kernel26 alsa pci wifi" - -MACHINE_FEATURES_BACKFILL_CONSIDERED = "rtc" - -PREFERRED_PROVIDER_virtual/kernel = "linux-vuplus" - -PREFERRED_VERSION_linux-vuplus = "${VUPLUS_KERNEL_VERSION}" - -KERNEL_IMAGETYPE = "vmlinux" -KERNEL_OUTPUT = "${KERNEL_IMAGETYPE}" - -EXTRA_IMAGEDEPENDS += "vuplus-makenfi-native" - diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/bcmgenet_oobctrl.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/bcmgenet_oobctrl.patch deleted file mode 100644 index 80183f9..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/bcmgenet_oobctrl.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/drivers/net/bcmgenet/bcmmii.c b/drivers/net/bcmgenet/bcmmii.c -index 7e2027a..127d2d0 100755 ---- a/drivers/net/bcmgenet/bcmmii.c -+++ b/drivers/net/bcmgenet/bcmmii.c -@@ -229,7 +229,7 @@ int mii_init(struct net_device *dev) - case BRCM_PHY_TYPE_EXT_RGMII: - GENET_RGMII_OOB_CTRL(pDevCtrl) |= RGMII_MODE_EN; - /* Don't shift tx clock by 90 degree, does it still needed? */ -- GENET_RGMII_OOB_CTRL(pDevCtrl) |= (1 << 16); -+ //csh GENET_RGMII_OOB_CTRL(pDevCtrl) |= (1 << 16); - pDevCtrl->mii.supports_gmii = 1; - pDevCtrl->sys->sys_port_ctrl = PORT_MODE_EXT_GPHY; - mii_write(dev, pDevCtrl->phyAddr, MII_BMCR, bmcr|MII_BMCR); diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_disable_enet1.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_disable_enet1.patch deleted file mode 100644 index 700c596..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_disable_enet1.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/arch/mips/brcmstb/Kconfig b/arch/mips/brcmstb/Kconfig -index 86ba4c6..8bde45e 100644 ---- a/arch/mips/brcmstb/Kconfig -+++ b/arch/mips/brcmstb/Kconfig -@@ -293,7 +293,6 @@ config BCM7425B0 - select BRCM_UARTC_IS_16550 - select BRCM_HAS_PCIE - select BRCM_HAS_GENET_0 -- select BRCM_HAS_MOCA_20 - select BRCM_MOCA_ON_GENET_1 - select BRCM_GENET_V3 - select BRCM_HAS_NOR -@@ -1008,15 +1007,6 @@ config BRCM_HAS_GENET_0 - bool - select BRCM_HAS_GENET - --# select for standalone GENET_1 --config BRCM_HAS_GENET_1 -- bool -- select BRCM_HAS_GENET -- --# MoCA controller --config BRCM_HAS_MOCA -- bool -- - # Original MoCA 1.1 - config BRCM_HAS_MOCA_11 - bool diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_mtd_mac.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_mtd_mac.patch deleted file mode 100644 index d4bc17f..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/brcm_mtd_mac.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/arch/mips/brcmstb/board.c b/arch/mips/brcmstb/board.c -index f64b8bd..ab1b2d2 100644 ---- a/arch/mips/brcmstb/board.c -+++ b/arch/mips/brcmstb/board.c -@@ -40,6 +40,8 @@ unsigned long brcm_mtd_rootfs_start; - unsigned long brcm_mtd_rootfs_len; - unsigned long brcm_mtd_kernel_start; - unsigned long brcm_mtd_kernel_len; -+unsigned long brcm_mtd_macaddr_start; -+unsigned long brcm_mtd_macaddr_len; - unsigned long brcm_mtd_ocap_start; - unsigned long brcm_mtd_ocap_len; - unsigned long brcm_mtd_flash_size_mb; -@@ -795,7 +797,7 @@ int __init board_get_partition_map(struct mtd_partition **p) - if (brcm_mtd_rootfs_len == 0) - return -ENODEV; - -- nr_parts = 2; -+ nr_parts = 3; - if (brcm_mtd_kernel_len != 0) - nr_parts++; - -@@ -816,6 +818,11 @@ int __init board_get_partition_map(struct mtd_partition **p) - ret[2].size = brcm_mtd_kernel_len; - ret[2].name = "kernel"; - } -+ if (brcm_mtd_macaddr_len != 0) { -+ ret[3].offset = brcm_mtd_macaddr_start; -+ ret[3].size = brcm_mtd_macaddr_len; -+ ret[3].name = "mac"; -+ } - - *p = ret; - return nr_parts; -diff --git a/arch/mips/brcmstb/prom.c b/arch/mips/brcmstb/prom.c -index 4f4f5ca..a8282b7 100644 ---- a/arch/mips/brcmstb/prom.c -+++ b/arch/mips/brcmstb/prom.c -@@ -275,6 +275,8 @@ static void __init __maybe_unused cfe_read_configuration(void) - FETCH("LINUX_FFS_SIZE", parse_hex, &brcm_mtd_rootfs_len); - FETCH("LINUX_PART_STARTAD", parse_hex, &brcm_mtd_kernel_start); - FETCH("LINUX_PART_SIZE", parse_hex, &brcm_mtd_kernel_len); -+ FETCH("LINUX_MACADDR_STARTAD", parse_hex, &brcm_mtd_macaddr_start); -+ FETCH("LINUX_MACADDR_SIZE", parse_hex, &brcm_mtd_macaddr_len); - FETCH("OCAP_PART_STARTAD", parse_hex, &brcm_mtd_ocap_start); - FETCH("OCAP_PART_SIZE", parse_hex, &brcm_mtd_ocap_len); - FETCH("FLASH_SIZE", parse_ulong, &brcm_mtd_flash_size_mb); -diff --git a/arch/mips/include/asm/brcmstb/brcmstb.h b/arch/mips/include/asm/brcmstb/brcmstb.h -index 244c59e..02de9f7 100644 ---- a/arch/mips/include/asm/brcmstb/brcmstb.h -+++ b/arch/mips/include/asm/brcmstb/brcmstb.h -@@ -789,6 +789,8 @@ extern unsigned long brcm_mtd_rootfs_start; - extern unsigned long brcm_mtd_rootfs_len; - extern unsigned long brcm_mtd_kernel_start; - extern unsigned long brcm_mtd_kernel_len; -+extern unsigned long brcm_mtd_macaddr_start; -+extern unsigned long brcm_mtd_macaddr_len; - extern unsigned long brcm_mtd_ocap_start; - extern unsigned long brcm_mtd_ocap_len; - extern unsigned long brcm_mtd_flash_size_mb; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/dvb-core.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/dvb-core.patch deleted file mode 100644 index 87b1738..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/dvb-core.patch +++ /dev/null @@ -1,1330 +0,0 @@ -diff --git a/drivers/media/dvb/dvb-core/Makefile b/drivers/media/dvb/dvb-core/Makefile -index 0b51828..8f22bcd 100644 ---- a/drivers/media/dvb/dvb-core/Makefile -+++ b/drivers/media/dvb/dvb-core/Makefile -@@ -2,8 +2,10 @@ - # Makefile for the kernel DVB device drivers. - # - -+dvb-net-$(CONFIG_DVB_NET) := dvb_net.o -+ - dvb-core-objs := dvbdev.o dmxdev.o dvb_demux.o dvb_filter.o \ - dvb_ca_en50221.o dvb_frontend.o \ -- dvb_net.o dvb_ringbuffer.o dvb_math.o -+ $(dvb-net-y) dvb_ringbuffer.o dvb_math.o - - obj-$(CONFIG_DVB_CORE) += dvb-core.o -diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c -index ad1f61d..cb59681 100644 ---- a/drivers/media/dvb/dvb-core/dmxdev.c -+++ b/drivers/media/dvb/dvb-core/dmxdev.c -@@ -83,7 +83,11 @@ static ssize_t dvb_dmxdev_buffer_read(struct dvb_ringbuffer *src, - - ret = wait_event_interruptible(src->queue, - !dvb_ringbuffer_empty(src) || -- (src->error != 0)); -+ (src->error != 0) || -+ (src->do_wait != 1)); -+ if (src->do_wait != 1) -+ ret = -EINTR; -+ - if (ret < 0) - break; - -@@ -572,13 +576,13 @@ static int dvb_dmxdev_start_feed(struct dmxdev *dmxdev, - dmx_output_t otype; - int ret; - int ts_type; -- enum dmx_ts_pes ts_pes; -+ dmx_pes_type_t ts_pes; - struct dmx_ts_feed *tsfeed; - - feed->ts = NULL; - otype = para->output; - -- ts_pes = (enum dmx_ts_pes)para->pes_type; -+ ts_pes = para->pes_type; - - if (ts_pes < DMX_PES_OTHER) - ts_type = TS_DECODER; -@@ -963,6 +967,22 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, - return ret; - } - -+static int dvb_demux_lock_filter(struct dmxdev_filter *dmxdevfilter) -+{ -+ int ret; -+ -+ dmxdevfilter->buffer.do_wait = 0; -+ -+ if (waitqueue_active(&dmxdevfilter->buffer.queue)) -+ wake_up(&dmxdevfilter->buffer.queue); -+ -+ ret = mutex_lock_interruptible(&dmxdevfilter->mutex); -+ -+ dmxdevfilter->buffer.do_wait = 1; -+ -+ return ret; -+} -+ - static int dvb_demux_do_ioctl(struct file *file, - unsigned int cmd, void *parg) - { -@@ -976,7 +996,7 @@ static int dvb_demux_do_ioctl(struct file *file, - - switch (cmd) { - case DMX_START: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -988,7 +1008,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_STOP: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -997,7 +1017,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_FILTER: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1006,7 +1026,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_PES_FILTER: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1015,7 +1035,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_BUFFER_SIZE: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1059,7 +1079,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_ADD_PID: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - ret = -ERESTARTSYS; - break; - } -@@ -1068,7 +1088,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_REMOVE_PID: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - ret = -ERESTARTSYS; - break; - } -diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c -index 4a88a3e..faa3671 100644 ---- a/drivers/media/dvb/dvb-core/dvb_demux.c -+++ b/drivers/media/dvb/dvb-core/dvb_demux.c -@@ -478,97 +478,94 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, - - EXPORT_SYMBOL(dvb_dmx_swfilter_packets); - --void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count) -+static inline int find_next_packet(const u8 *buf, int pos, size_t count, -+ const int pktsize) - { -- int p = 0, i, j; -+ int start = pos, lost; - -- spin_lock(&demux->lock); -- -- if (demux->tsbufp) { -- i = demux->tsbufp; -- j = 188 - i; -- if (count < j) { -- memcpy(&demux->tsbuf[i], buf, count); -- demux->tsbufp += count; -- goto bailout; -- } -- memcpy(&demux->tsbuf[i], buf, j); -- if (demux->tsbuf[0] == 0x47) -- dvb_dmx_swfilter_packet(demux, demux->tsbuf); -- demux->tsbufp = 0; -- p += j; -+ while (pos < count) { -+ if (buf[pos] == 0x47 || -+ (pktsize == 204 && buf[pos] == 0xB8)) -+ break; -+ pos++; - } - -- while (p < count) { -- if (buf[p] == 0x47) { -- if (count - p >= 188) { -- dvb_dmx_swfilter_packet(demux, &buf[p]); -- p += 188; -- } else { -- i = count - p; -- memcpy(demux->tsbuf, &buf[p], i); -- demux->tsbufp = i; -- goto bailout; -- } -- } else -- p++; -+ lost = pos - start; -+ if (lost) { -+ /* This garbage is part of a valid packet? */ -+ int backtrack = pos - pktsize; -+ if (backtrack >= 0 && (buf[backtrack] == 0x47 || -+ (pktsize == 204 && buf[backtrack] == 0xB8))) -+ return backtrack; - } - --bailout: -- spin_unlock(&demux->lock); -+ return pos; - } - --EXPORT_SYMBOL(dvb_dmx_swfilter); -- --void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) -+/* Filter all pktsize= 188 or 204 sized packets and skip garbage. */ -+static inline void _dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, -+ size_t count, const int pktsize) - { - int p = 0, i, j; -- u8 tmppack[188]; -+ const u8 *q; - - spin_lock(&demux->lock); - -- if (demux->tsbufp) { -+ if (demux->tsbufp) { /* tsbuf[0] is now 0x47. */ - i = demux->tsbufp; -- j = 204 - i; -+ j = pktsize - i; - if (count < j) { - memcpy(&demux->tsbuf[i], buf, count); - demux->tsbufp += count; - goto bailout; - } - memcpy(&demux->tsbuf[i], buf, j); -- if ((demux->tsbuf[0] == 0x47) || (demux->tsbuf[0] == 0xB8)) { -- memcpy(tmppack, demux->tsbuf, 188); -- if (tmppack[0] == 0xB8) -- tmppack[0] = 0x47; -- dvb_dmx_swfilter_packet(demux, tmppack); -- } -+ if (demux->tsbuf[0] == 0x47) /* double check */ -+ dvb_dmx_swfilter_packet(demux, demux->tsbuf); - demux->tsbufp = 0; - p += j; - } - -- while (p < count) { -- if ((buf[p] == 0x47) || (buf[p] == 0xB8)) { -- if (count - p >= 204) { -- memcpy(tmppack, &buf[p], 188); -- if (tmppack[0] == 0xB8) -- tmppack[0] = 0x47; -- dvb_dmx_swfilter_packet(demux, tmppack); -- p += 204; -- } else { -- i = count - p; -- memcpy(demux->tsbuf, &buf[p], i); -- demux->tsbufp = i; -- goto bailout; -- } -- } else { -- p++; -+ while (1) { -+ p = find_next_packet(buf, p, count, pktsize); -+ if (p >= count) -+ break; -+ if (count - p < pktsize) -+ break; -+ -+ q = &buf[p]; -+ -+ if (pktsize == 204 && (*q == 0xB8)) { -+ memcpy(demux->tsbuf, q, 188); -+ demux->tsbuf[0] = 0x47; -+ q = demux->tsbuf; - } -+ dvb_dmx_swfilter_packet(demux, q); -+ p += pktsize; -+ } -+ -+ i = count - p; -+ if (i) { -+ memcpy(demux->tsbuf, &buf[p], i); -+ demux->tsbufp = i; -+ if (pktsize == 204 && demux->tsbuf[0] == 0xB8) -+ demux->tsbuf[0] = 0x47; - } - - bailout: - spin_unlock(&demux->lock); - } - -+void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count) -+{ -+ _dvb_dmx_swfilter(demux, buf, count, 188); -+} -+EXPORT_SYMBOL(dvb_dmx_swfilter); -+ -+void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) -+{ -+ _dvb_dmx_swfilter(demux, buf, count, 204); -+} - EXPORT_SYMBOL(dvb_dmx_swfilter_204); - - static struct dvb_demux_filter *dvb_dmx_filter_alloc(struct dvb_demux *demux) -diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c -index cad6634..efe9c30 100644 ---- a/drivers/media/dvb/dvb-core/dvb_frontend.c -+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c -@@ -105,7 +105,8 @@ struct dvb_frontend_private { - - /* thread/frontend values */ - struct dvb_device *dvbdev; -- struct dvb_frontend_parameters parameters; -+ struct dvb_frontend_parameters parameters_in; -+ struct dvb_frontend_parameters parameters_out; - struct dvb_fe_events events; - struct semaphore sem; - struct list_head list_head; -@@ -160,12 +161,11 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status) - - e = &events->events[events->eventw]; - -- memcpy (&e->parameters, &fepriv->parameters, -- sizeof (struct dvb_frontend_parameters)); -- - if (status & FE_HAS_LOCK) - if (fe->ops.get_frontend) -- fe->ops.get_frontend(fe, &e->parameters); -+ fe->ops.get_frontend(fe, &fepriv->parameters_out); -+ -+ e->parameters = fepriv->parameters_out; - - events->eventw = wp; - -@@ -277,12 +277,12 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra - int ready = 0; - int fe_set_err = 0; - struct dvb_frontend_private *fepriv = fe->frontend_priv; -- int original_inversion = fepriv->parameters.inversion; -- u32 original_frequency = fepriv->parameters.frequency; -+ int original_inversion = fepriv->parameters_in.inversion; -+ u32 original_frequency = fepriv->parameters_in.frequency; - - /* are we using autoinversion? */ - autoinversion = ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) && -- (fepriv->parameters.inversion == INVERSION_AUTO)); -+ (fepriv->parameters_in.inversion == INVERSION_AUTO)); - - /* setup parameters correctly */ - while(!ready) { -@@ -348,18 +348,19 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra - fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step); - - /* set the frontend itself */ -- fepriv->parameters.frequency += fepriv->lnb_drift; -+ fepriv->parameters_in.frequency += fepriv->lnb_drift; - if (autoinversion) -- fepriv->parameters.inversion = fepriv->inversion; -+ fepriv->parameters_in.inversion = fepriv->inversion; - if (fe->ops.set_frontend) -- fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters); -+ fe_set_err = fe->ops.set_frontend(fe, &fepriv->parameters_in); -+ fepriv->parameters_out = fepriv->parameters_in; - if (fe_set_err < 0) { - fepriv->state = FESTATE_ERROR; - return fe_set_err; - } - -- fepriv->parameters.frequency = original_frequency; -- fepriv->parameters.inversion = original_inversion; -+ fepriv->parameters_in.frequency = original_frequency; -+ fepriv->parameters_in.inversion = original_inversion; - - fepriv->auto_sub_step++; - return 0; -@@ -383,7 +384,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) - if (fepriv->state & FESTATE_RETUNE) { - if (fe->ops.set_frontend) - retval = fe->ops.set_frontend(fe, -- &fepriv->parameters); -+ &fepriv->parameters_in); -+ fepriv->parameters_out = fepriv->parameters_in; - if (retval < 0) - fepriv->state = FESTATE_ERROR; - else -@@ -413,8 +415,8 @@ static void dvb_frontend_swzigzag(struct dvb_frontend *fe) - - /* if we're tuned, then we have determined the correct inversion */ - if ((!(fe->ops.info.caps & FE_CAN_INVERSION_AUTO)) && -- (fepriv->parameters.inversion == INVERSION_AUTO)) { -- fepriv->parameters.inversion = fepriv->inversion; -+ (fepriv->parameters_in.inversion == INVERSION_AUTO)) { -+ fepriv->parameters_in.inversion = fepriv->inversion; - } - return; - } -@@ -594,12 +596,14 @@ restart: - - if (fepriv->state & FESTATE_RETUNE) { - dprintk("%s: Retune requested, FESTATE_RETUNE\n", __func__); -- params = &fepriv->parameters; -+ params = &fepriv->parameters_in; - fepriv->state = FESTATE_TUNED; - } - - if (fe->ops.tune) - fe->ops.tune(fe, params, fepriv->tune_mode_flags, &fepriv->delay, &s); -+ if (params) -+ fepriv->parameters_out = *params; - - if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) { - dprintk("%s: state changed, adding current state\n", __func__); -@@ -612,11 +616,9 @@ restart: - dvb_frontend_swzigzag(fe); - break; - case DVBFE_ALGO_CUSTOM: -- params = NULL; /* have we been asked to RETUNE ? */ - dprintk("%s: Frontend ALGO = DVBFE_ALGO_CUSTOM, state=%d\n", __func__, fepriv->state); - if (fepriv->state & FESTATE_RETUNE) { - dprintk("%s: Retune requested, FESTAT_RETUNE\n", __func__); -- params = &fepriv->parameters; - fepriv->state = FESTATE_TUNED; - } - /* Case where we are going to search for a carrier -@@ -625,7 +627,7 @@ restart: - */ - if (fepriv->algo_status & DVBFE_ALGO_SEARCH_AGAIN) { - if (fe->ops.search) { -- fepriv->algo_status = fe->ops.search(fe, &fepriv->parameters); -+ fepriv->algo_status = fe->ops.search(fe, &fepriv->parameters_in); - /* We did do a search as was requested, the flags are - * now unset as well and has the flags wrt to search. - */ -@@ -636,11 +638,12 @@ restart: - /* Track the carrier if the search was successful */ - if (fepriv->algo_status == DVBFE_ALGO_SEARCH_SUCCESS) { - if (fe->ops.track) -- fe->ops.track(fe, &fepriv->parameters); -+ fe->ops.track(fe, &fepriv->parameters_in); - } else { - fepriv->algo_status |= DVBFE_ALGO_SEARCH_AGAIN; - fepriv->delay = HZ / 2; - } -+ fepriv->parameters_out = fepriv->parameters_in; - fe->ops.read_status(fe, &s); - if (s != fepriv->status) { - dvb_frontend_add_event(fe, s); /* update event list */ -@@ -860,34 +863,34 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe, - - static int dvb_frontend_clear_cache(struct dvb_frontend *fe) - { -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; - int i; - -- memset(&(fe->dtv_property_cache), 0, -- sizeof(struct dtv_frontend_properties)); -- -- fe->dtv_property_cache.state = DTV_CLEAR; -- fe->dtv_property_cache.delivery_system = SYS_UNDEFINED; -- fe->dtv_property_cache.inversion = INVERSION_AUTO; -- fe->dtv_property_cache.fec_inner = FEC_AUTO; -- fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_AUTO; -- fe->dtv_property_cache.bandwidth_hz = BANDWIDTH_AUTO; -- fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_AUTO; -- fe->dtv_property_cache.hierarchy = HIERARCHY_AUTO; -- fe->dtv_property_cache.symbol_rate = QAM_AUTO; -- fe->dtv_property_cache.code_rate_HP = FEC_AUTO; -- fe->dtv_property_cache.code_rate_LP = FEC_AUTO; -- -- fe->dtv_property_cache.isdbt_partial_reception = -1; -- fe->dtv_property_cache.isdbt_sb_mode = -1; -- fe->dtv_property_cache.isdbt_sb_subchannel = -1; -- fe->dtv_property_cache.isdbt_sb_segment_idx = -1; -- fe->dtv_property_cache.isdbt_sb_segment_count = -1; -- fe->dtv_property_cache.isdbt_layer_enabled = 0x7; -+ memset(c, 0, sizeof(struct dtv_frontend_properties)); -+ -+ c->state = DTV_CLEAR; -+ c->delivery_system = SYS_UNDEFINED; -+ c->inversion = INVERSION_AUTO; -+ c->fec_inner = FEC_AUTO; -+ c->transmission_mode = TRANSMISSION_MODE_AUTO; -+ c->bandwidth_hz = BANDWIDTH_AUTO; -+ c->guard_interval = GUARD_INTERVAL_AUTO; -+ c->hierarchy = HIERARCHY_AUTO; -+ c->symbol_rate = QAM_AUTO; -+ c->code_rate_HP = FEC_AUTO; -+ c->code_rate_LP = FEC_AUTO; -+ -+ c->isdbt_partial_reception = -1; -+ c->isdbt_sb_mode = -1; -+ c->isdbt_sb_subchannel = -1; -+ c->isdbt_sb_segment_idx = -1; -+ c->isdbt_sb_segment_count = -1; -+ c->isdbt_layer_enabled = 0x7; - for (i = 0; i < 3; i++) { -- fe->dtv_property_cache.layer[i].fec = FEC_AUTO; -- fe->dtv_property_cache.layer[i].modulation = QAM_AUTO; -- fe->dtv_property_cache.layer[i].interleaving = -1; -- fe->dtv_property_cache.layer[i].segment_count = -1; -+ c->layer[i].fec = FEC_AUTO; -+ c->layer[i].modulation = QAM_AUTO; -+ c->layer[i].interleaving = -1; -+ c->layer[i].segment_count = -1; - } - - return 0; -@@ -901,7 +904,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) - .buffer = b \ - } - --static struct dtv_cmds_h dtv_cmds[] = { -+static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = { - _DTV_CMD(DTV_TUNE, 1, 0), - _DTV_CMD(DTV_CLEAR, 1, 0), - -@@ -963,6 +966,7 @@ static struct dtv_cmds_h dtv_cmds[] = { - _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 0, 0), - - _DTV_CMD(DTV_ISDBS_TS_ID, 1, 0), -+ _DTV_CMD(DTV_DVBT2_PLP_ID, 1, 0), - - /* Get */ - _DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1), -@@ -1020,10 +1024,9 @@ static int is_legacy_delivery_system(fe_delivery_system_t s) - * it's being used for the legacy or new API, reducing code and complexity. - */ - static void dtv_property_cache_sync(struct dvb_frontend *fe, -- struct dvb_frontend_parameters *p) -+ struct dtv_frontend_properties *c, -+ const struct dvb_frontend_parameters *p) - { -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -- - c->frequency = p->frequency; - c->inversion = p->inversion; - -@@ -1074,9 +1077,9 @@ static void dtv_property_cache_sync(struct dvb_frontend *fe, - */ - static void dtv_property_legacy_params_sync(struct dvb_frontend *fe) - { -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ const struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct dvb_frontend_private *fepriv = fe->frontend_priv; -- struct dvb_frontend_parameters *p = &fepriv->parameters; -+ struct dvb_frontend_parameters *p = &fepriv->parameters_in; - - p->frequency = c->frequency; - p->inversion = c->inversion; -@@ -1086,14 +1089,12 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe) - dprintk("%s() Preparing QPSK req\n", __func__); - p->u.qpsk.symbol_rate = c->symbol_rate; - p->u.qpsk.fec_inner = c->fec_inner; -- c->delivery_system = SYS_DVBS; - break; - case FE_QAM: - dprintk("%s() Preparing QAM req\n", __func__); - p->u.qam.symbol_rate = c->symbol_rate; - p->u.qam.fec_inner = c->fec_inner; - p->u.qam.modulation = c->modulation; -- c->delivery_system = SYS_DVBC_ANNEX_AC; - break; - case FE_OFDM: - dprintk("%s() Preparing OFDM req\n", __func__); -@@ -1111,15 +1112,10 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe) - p->u.ofdm.transmission_mode = c->transmission_mode; - p->u.ofdm.guard_interval = c->guard_interval; - p->u.ofdm.hierarchy_information = c->hierarchy; -- c->delivery_system = SYS_DVBT; - break; - case FE_ATSC: - dprintk("%s() Preparing VSB req\n", __func__); - p->u.vsb.modulation = c->modulation; -- if ((c->modulation == VSB_8) || (c->modulation == VSB_16)) -- c->delivery_system = SYS_ATSC; -- else -- c->delivery_system = SYS_DVBC_ANNEX_B; - break; - } - } -@@ -1129,9 +1125,9 @@ static void dtv_property_legacy_params_sync(struct dvb_frontend *fe) - */ - static void dtv_property_adv_params_sync(struct dvb_frontend *fe) - { -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ const struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct dvb_frontend_private *fepriv = fe->frontend_priv; -- struct dvb_frontend_parameters *p = &fepriv->parameters; -+ struct dvb_frontend_parameters *p = &fepriv->parameters_in; - - p->frequency = c->frequency; - p->inversion = c->inversion; -@@ -1148,10 +1144,9 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) - break; - } - -- if(c->delivery_system == SYS_ISDBT) { -- /* Fake out a generic DVB-T request so we pass validation in the ioctl */ -- p->frequency = c->frequency; -- p->inversion = c->inversion; -+ /* Fake out a generic DVB-T request so we pass validation in the ioctl */ -+ if ((c->delivery_system == SYS_ISDBT) || -+ (c->delivery_system == SYS_DVBT2)) { - p->u.ofdm.constellation = QAM_AUTO; - p->u.ofdm.code_rate_HP = FEC_AUTO; - p->u.ofdm.code_rate_LP = FEC_AUTO; -@@ -1171,7 +1166,7 @@ static void dtv_property_adv_params_sync(struct dvb_frontend *fe) - - static void dtv_property_cache_submit(struct dvb_frontend *fe) - { -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ const struct dtv_frontend_properties *c = &fe->dtv_property_cache; - - /* For legacy delivery systems we don't need the delivery_system to - * be specified, but we populate the older structures from the cache -@@ -1204,133 +1199,149 @@ static int dtv_property_process_get(struct dvb_frontend *fe, - struct dtv_property *tvp, - struct file *file) - { -- int r = 0; -- -- /* Allow the frontend to validate incoming properties */ -- if (fe->ops.get_property) -- r = fe->ops.get_property(fe, tvp); -+ const struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ struct dvb_frontend_private *fepriv = fe->frontend_priv; -+ struct dtv_frontend_properties cdetected; -+ int r; - -- if (r < 0) -- return r; -+ /* -+ * If the driver implements a get_frontend function, then convert -+ * detected parameters to S2API properties. -+ */ -+ if (fe->ops.get_frontend) { -+ cdetected = *c; -+ dtv_property_cache_sync(fe, &cdetected, &fepriv->parameters_out); -+ c = &cdetected; -+ } - - switch(tvp->cmd) { - case DTV_FREQUENCY: -- tvp->u.data = fe->dtv_property_cache.frequency; -+ tvp->u.data = c->frequency; - break; - case DTV_MODULATION: -- tvp->u.data = fe->dtv_property_cache.modulation; -+ tvp->u.data = c->modulation; - break; - case DTV_BANDWIDTH_HZ: -- tvp->u.data = fe->dtv_property_cache.bandwidth_hz; -+ tvp->u.data = c->bandwidth_hz; - break; - case DTV_INVERSION: -- tvp->u.data = fe->dtv_property_cache.inversion; -+ tvp->u.data = c->inversion; - break; - case DTV_SYMBOL_RATE: -- tvp->u.data = fe->dtv_property_cache.symbol_rate; -+ tvp->u.data = c->symbol_rate; - break; - case DTV_INNER_FEC: -- tvp->u.data = fe->dtv_property_cache.fec_inner; -+ tvp->u.data = c->fec_inner; - break; - case DTV_PILOT: -- tvp->u.data = fe->dtv_property_cache.pilot; -+ tvp->u.data = c->pilot; - break; - case DTV_ROLLOFF: -- tvp->u.data = fe->dtv_property_cache.rolloff; -+ tvp->u.data = c->rolloff; - break; - case DTV_DELIVERY_SYSTEM: -- tvp->u.data = fe->dtv_property_cache.delivery_system; -+ tvp->u.data = c->delivery_system; - break; - case DTV_VOLTAGE: -- tvp->u.data = fe->dtv_property_cache.voltage; -+ tvp->u.data = c->voltage; - break; - case DTV_TONE: -- tvp->u.data = fe->dtv_property_cache.sectone; -+ tvp->u.data = c->sectone; - break; - case DTV_API_VERSION: - tvp->u.data = (DVB_API_VERSION << 8) | DVB_API_VERSION_MINOR; - break; - case DTV_CODE_RATE_HP: -- tvp->u.data = fe->dtv_property_cache.code_rate_HP; -+ tvp->u.data = c->code_rate_HP; - break; - case DTV_CODE_RATE_LP: -- tvp->u.data = fe->dtv_property_cache.code_rate_LP; -+ tvp->u.data = c->code_rate_LP; - break; - case DTV_GUARD_INTERVAL: -- tvp->u.data = fe->dtv_property_cache.guard_interval; -+ tvp->u.data = c->guard_interval; - break; - case DTV_TRANSMISSION_MODE: -- tvp->u.data = fe->dtv_property_cache.transmission_mode; -+ tvp->u.data = c->transmission_mode; - break; - case DTV_HIERARCHY: -- tvp->u.data = fe->dtv_property_cache.hierarchy; -+ tvp->u.data = c->hierarchy; - break; - - /* ISDB-T Support here */ - case DTV_ISDBT_PARTIAL_RECEPTION: -- tvp->u.data = fe->dtv_property_cache.isdbt_partial_reception; -+ tvp->u.data = c->isdbt_partial_reception; - break; - case DTV_ISDBT_SOUND_BROADCASTING: -- tvp->u.data = fe->dtv_property_cache.isdbt_sb_mode; -+ tvp->u.data = c->isdbt_sb_mode; - break; - case DTV_ISDBT_SB_SUBCHANNEL_ID: -- tvp->u.data = fe->dtv_property_cache.isdbt_sb_subchannel; -+ tvp->u.data = c->isdbt_sb_subchannel; - break; - case DTV_ISDBT_SB_SEGMENT_IDX: -- tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_idx; -+ tvp->u.data = c->isdbt_sb_segment_idx; - break; - case DTV_ISDBT_SB_SEGMENT_COUNT: -- tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_count; -+ tvp->u.data = c->isdbt_sb_segment_count; - break; - case DTV_ISDBT_LAYER_ENABLED: -- tvp->u.data = fe->dtv_property_cache.isdbt_layer_enabled; -+ tvp->u.data = c->isdbt_layer_enabled; - break; - case DTV_ISDBT_LAYERA_FEC: -- tvp->u.data = fe->dtv_property_cache.layer[0].fec; -+ tvp->u.data = c->layer[0].fec; - break; - case DTV_ISDBT_LAYERA_MODULATION: -- tvp->u.data = fe->dtv_property_cache.layer[0].modulation; -+ tvp->u.data = c->layer[0].modulation; - break; - case DTV_ISDBT_LAYERA_SEGMENT_COUNT: -- tvp->u.data = fe->dtv_property_cache.layer[0].segment_count; -+ tvp->u.data = c->layer[0].segment_count; - break; - case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: -- tvp->u.data = fe->dtv_property_cache.layer[0].interleaving; -+ tvp->u.data = c->layer[0].interleaving; - break; - case DTV_ISDBT_LAYERB_FEC: -- tvp->u.data = fe->dtv_property_cache.layer[1].fec; -+ tvp->u.data = c->layer[1].fec; - break; - case DTV_ISDBT_LAYERB_MODULATION: -- tvp->u.data = fe->dtv_property_cache.layer[1].modulation; -+ tvp->u.data = c->layer[1].modulation; - break; - case DTV_ISDBT_LAYERB_SEGMENT_COUNT: -- tvp->u.data = fe->dtv_property_cache.layer[1].segment_count; -+ tvp->u.data = c->layer[1].segment_count; - break; - case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: -- tvp->u.data = fe->dtv_property_cache.layer[1].interleaving; -+ tvp->u.data = c->layer[1].interleaving; - break; - case DTV_ISDBT_LAYERC_FEC: -- tvp->u.data = fe->dtv_property_cache.layer[2].fec; -+ tvp->u.data = c->layer[2].fec; - break; - case DTV_ISDBT_LAYERC_MODULATION: -- tvp->u.data = fe->dtv_property_cache.layer[2].modulation; -+ tvp->u.data = c->layer[2].modulation; - break; - case DTV_ISDBT_LAYERC_SEGMENT_COUNT: -- tvp->u.data = fe->dtv_property_cache.layer[2].segment_count; -+ tvp->u.data = c->layer[2].segment_count; - break; - case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: -- tvp->u.data = fe->dtv_property_cache.layer[2].interleaving; -+ tvp->u.data = c->layer[2].interleaving; - break; - case DTV_ISDBS_TS_ID: -- tvp->u.data = fe->dtv_property_cache.isdbs_ts_id; -+ tvp->u.data = c->isdbs_ts_id; -+ break; -+ case DTV_DVBT2_PLP_ID: -+ tvp->u.data = c->dvbt2_plp_id; - break; - default: -- r = -1; -+ return -EINVAL; -+ } -+ -+ /* Allow the frontend to override outgoing properties */ -+ if (fe->ops.get_property) { -+ r = fe->ops.get_property(fe, tvp); -+ if (r < 0) -+ return r; - } - - dtv_property_dump(tvp); - -- return r; -+ return 0; - } - - static int dtv_property_process_set(struct dvb_frontend *fe, -@@ -1338,15 +1349,16 @@ static int dtv_property_process_set(struct dvb_frontend *fe, - struct file *file) - { - int r = 0; -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct dvb_frontend_private *fepriv = fe->frontend_priv; - dtv_property_dump(tvp); - - /* Allow the frontend to validate incoming properties */ -- if (fe->ops.set_property) -+ if (fe->ops.set_property) { - r = fe->ops.set_property(fe, tvp); -- -- if (r < 0) -- return r; -+ if (r < 0) -+ return r; -+ } - - switch(tvp->cmd) { - case DTV_CLEAR: -@@ -1361,126 +1373,129 @@ static int dtv_property_process_set(struct dvb_frontend *fe, - * tunerequest so we can pass validation in the FE_SET_FRONTEND - * ioctl. - */ -- fe->dtv_property_cache.state = tvp->cmd; -+ c->state = tvp->cmd; - dprintk("%s() Finalised property cache\n", __func__); - dtv_property_cache_submit(fe); - -- r |= dvb_frontend_ioctl_legacy(file, FE_SET_FRONTEND, -- &fepriv->parameters); -+ r = dvb_frontend_ioctl_legacy(file, FE_SET_FRONTEND, -+ &fepriv->parameters_in); - break; - case DTV_FREQUENCY: -- fe->dtv_property_cache.frequency = tvp->u.data; -+ c->frequency = tvp->u.data; - break; - case DTV_MODULATION: -- fe->dtv_property_cache.modulation = tvp->u.data; -+ c->modulation = tvp->u.data; - break; - case DTV_BANDWIDTH_HZ: -- fe->dtv_property_cache.bandwidth_hz = tvp->u.data; -+ c->bandwidth_hz = tvp->u.data; - break; - case DTV_INVERSION: -- fe->dtv_property_cache.inversion = tvp->u.data; -+ c->inversion = tvp->u.data; - break; - case DTV_SYMBOL_RATE: -- fe->dtv_property_cache.symbol_rate = tvp->u.data; -+ c->symbol_rate = tvp->u.data; - break; - case DTV_INNER_FEC: -- fe->dtv_property_cache.fec_inner = tvp->u.data; -+ c->fec_inner = tvp->u.data; - break; - case DTV_PILOT: -- fe->dtv_property_cache.pilot = tvp->u.data; -+ c->pilot = tvp->u.data; - break; - case DTV_ROLLOFF: -- fe->dtv_property_cache.rolloff = tvp->u.data; -+ c->rolloff = tvp->u.data; - break; - case DTV_DELIVERY_SYSTEM: -- fe->dtv_property_cache.delivery_system = tvp->u.data; -+ c->delivery_system = tvp->u.data; - break; - case DTV_VOLTAGE: -- fe->dtv_property_cache.voltage = tvp->u.data; -+ c->voltage = tvp->u.data; - r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE, -- (void *)fe->dtv_property_cache.voltage); -+ (void *)c->voltage); - break; - case DTV_TONE: -- fe->dtv_property_cache.sectone = tvp->u.data; -+ c->sectone = tvp->u.data; - r = dvb_frontend_ioctl_legacy(file, FE_SET_TONE, -- (void *)fe->dtv_property_cache.sectone); -+ (void *)c->sectone); - break; - case DTV_CODE_RATE_HP: -- fe->dtv_property_cache.code_rate_HP = tvp->u.data; -+ c->code_rate_HP = tvp->u.data; - break; - case DTV_CODE_RATE_LP: -- fe->dtv_property_cache.code_rate_LP = tvp->u.data; -+ c->code_rate_LP = tvp->u.data; - break; - case DTV_GUARD_INTERVAL: -- fe->dtv_property_cache.guard_interval = tvp->u.data; -+ c->guard_interval = tvp->u.data; - break; - case DTV_TRANSMISSION_MODE: -- fe->dtv_property_cache.transmission_mode = tvp->u.data; -+ c->transmission_mode = tvp->u.data; - break; - case DTV_HIERARCHY: -- fe->dtv_property_cache.hierarchy = tvp->u.data; -+ c->hierarchy = tvp->u.data; - break; - - /* ISDB-T Support here */ - case DTV_ISDBT_PARTIAL_RECEPTION: -- fe->dtv_property_cache.isdbt_partial_reception = tvp->u.data; -+ c->isdbt_partial_reception = tvp->u.data; - break; - case DTV_ISDBT_SOUND_BROADCASTING: -- fe->dtv_property_cache.isdbt_sb_mode = tvp->u.data; -+ c->isdbt_sb_mode = tvp->u.data; - break; - case DTV_ISDBT_SB_SUBCHANNEL_ID: -- fe->dtv_property_cache.isdbt_sb_subchannel = tvp->u.data; -+ c->isdbt_sb_subchannel = tvp->u.data; - break; - case DTV_ISDBT_SB_SEGMENT_IDX: -- fe->dtv_property_cache.isdbt_sb_segment_idx = tvp->u.data; -+ c->isdbt_sb_segment_idx = tvp->u.data; - break; - case DTV_ISDBT_SB_SEGMENT_COUNT: -- fe->dtv_property_cache.isdbt_sb_segment_count = tvp->u.data; -+ c->isdbt_sb_segment_count = tvp->u.data; - break; - case DTV_ISDBT_LAYER_ENABLED: -- fe->dtv_property_cache.isdbt_layer_enabled = tvp->u.data; -+ c->isdbt_layer_enabled = tvp->u.data; - break; - case DTV_ISDBT_LAYERA_FEC: -- fe->dtv_property_cache.layer[0].fec = tvp->u.data; -+ c->layer[0].fec = tvp->u.data; - break; - case DTV_ISDBT_LAYERA_MODULATION: -- fe->dtv_property_cache.layer[0].modulation = tvp->u.data; -+ c->layer[0].modulation = tvp->u.data; - break; - case DTV_ISDBT_LAYERA_SEGMENT_COUNT: -- fe->dtv_property_cache.layer[0].segment_count = tvp->u.data; -+ c->layer[0].segment_count = tvp->u.data; - break; - case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: -- fe->dtv_property_cache.layer[0].interleaving = tvp->u.data; -+ c->layer[0].interleaving = tvp->u.data; - break; - case DTV_ISDBT_LAYERB_FEC: -- fe->dtv_property_cache.layer[1].fec = tvp->u.data; -+ c->layer[1].fec = tvp->u.data; - break; - case DTV_ISDBT_LAYERB_MODULATION: -- fe->dtv_property_cache.layer[1].modulation = tvp->u.data; -+ c->layer[1].modulation = tvp->u.data; - break; - case DTV_ISDBT_LAYERB_SEGMENT_COUNT: -- fe->dtv_property_cache.layer[1].segment_count = tvp->u.data; -+ c->layer[1].segment_count = tvp->u.data; - break; - case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: -- fe->dtv_property_cache.layer[1].interleaving = tvp->u.data; -+ c->layer[1].interleaving = tvp->u.data; - break; - case DTV_ISDBT_LAYERC_FEC: -- fe->dtv_property_cache.layer[2].fec = tvp->u.data; -+ c->layer[2].fec = tvp->u.data; - break; - case DTV_ISDBT_LAYERC_MODULATION: -- fe->dtv_property_cache.layer[2].modulation = tvp->u.data; -+ c->layer[2].modulation = tvp->u.data; - break; - case DTV_ISDBT_LAYERC_SEGMENT_COUNT: -- fe->dtv_property_cache.layer[2].segment_count = tvp->u.data; -+ c->layer[2].segment_count = tvp->u.data; - break; - case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: -- fe->dtv_property_cache.layer[2].interleaving = tvp->u.data; -+ c->layer[2].interleaving = tvp->u.data; - break; - case DTV_ISDBS_TS_ID: -- fe->dtv_property_cache.isdbs_ts_id = tvp->u.data; -+ c->isdbs_ts_id = tvp->u.data; -+ break; -+ case DTV_DVBT2_PLP_ID: -+ c->dvbt2_plp_id = tvp->u.data; - break; - default: -- r = -1; -+ return -EINVAL; - } - - return r; -@@ -1491,6 +1506,7 @@ static int dvb_frontend_ioctl(struct file *file, - { - struct dvb_device *dvbdev = file->private_data; - struct dvb_frontend *fe = dvbdev->priv; -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct dvb_frontend_private *fepriv = fe->frontend_priv; - int err = -EOPNOTSUPP; - -@@ -1510,7 +1526,7 @@ static int dvb_frontend_ioctl(struct file *file, - if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) - err = dvb_frontend_ioctl_properties(file, cmd, parg); - else { -- fe->dtv_property_cache.state = DTV_UNDEFINED; -+ c->state = DTV_UNDEFINED; - err = dvb_frontend_ioctl_legacy(file, cmd, parg); - } - -@@ -1523,6 +1539,7 @@ static int dvb_frontend_ioctl_properties(struct file *file, - { - struct dvb_device *dvbdev = file->private_data; - struct dvb_frontend *fe = dvbdev->priv; -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; - int err = 0; - - struct dtv_properties *tvps = NULL; -@@ -1554,11 +1571,13 @@ static int dvb_frontend_ioctl_properties(struct file *file, - } - - for (i = 0; i < tvps->num; i++) { -- (tvp + i)->result = dtv_property_process_set(fe, tvp + i, file); -- err |= (tvp + i)->result; -+ err = dtv_property_process_set(fe, tvp + i, file); -+ if (err < 0) -+ goto out; -+ (tvp + i)->result = err; - } - -- if(fe->dtv_property_cache.state == DTV_TUNE) -+ if (c->state == DTV_TUNE) - dprintk("%s() Property cache is full, tuning\n", __func__); - - } else -@@ -1586,8 +1605,10 @@ static int dvb_frontend_ioctl_properties(struct file *file, - } - - for (i = 0; i < tvps->num; i++) { -- (tvp + i)->result = dtv_property_process_get(fe, tvp + i, file); -- err |= (tvp + i)->result; -+ err = dtv_property_process_get(fe, tvp + i, file); -+ if (err < 0) -+ goto out; -+ (tvp + i)->result = err; - } - - if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct dtv_property))) { -@@ -1638,7 +1659,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - case FE_READ_STATUS: { - fe_status_t* status = parg; - -- /* if retune was requested but hasn't occured yet, prevent -+ /* if retune was requested but hasn't occurred yet, prevent - * that user get signal state from previous tuning */ - if (fepriv->state == FESTATE_RETUNE || - fepriv->state == FESTATE_ERROR) { -@@ -1729,7 +1750,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - * Dish network legacy switches (as used by Dish500) - * are controlled by sending 9-bit command words - * spaced 8msec apart. -- * the actual command word is switch/port dependant -+ * the actual command word is switch/port dependent - * so it is up to the userspace application to send - * the right command. - * The command must always start with a '0' after -@@ -1787,10 +1808,11 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - break; - - case FE_SET_FRONTEND: { -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; - struct dvb_frontend_tune_settings fetunesettings; - -- if(fe->dtv_property_cache.state == DTV_TUNE) { -- if (dvb_frontend_check_parameters(fe, &fepriv->parameters) < 0) { -+ if (c->state == DTV_TUNE) { -+ if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0) { - err = -EINVAL; - break; - } -@@ -1800,9 +1822,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - break; - } - -- memcpy (&fepriv->parameters, parg, -+ memcpy (&fepriv->parameters_in, parg, - sizeof (struct dvb_frontend_parameters)); -- dtv_property_cache_sync(fe, &fepriv->parameters); -+ dtv_property_cache_sync(fe, c, &fepriv->parameters_in); - } - - memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings)); -@@ -1811,15 +1833,15 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - - /* force auto frequency inversion if requested */ - if (dvb_force_auto_inversion) { -- fepriv->parameters.inversion = INVERSION_AUTO; -+ fepriv->parameters_in.inversion = INVERSION_AUTO; - fetunesettings.parameters.inversion = INVERSION_AUTO; - } - if (fe->ops.info.type == FE_OFDM) { - /* without hierarchical coding code_rate_LP is irrelevant, - * so we tolerate the otherwise invalid FEC_NONE setting */ -- if (fepriv->parameters.u.ofdm.hierarchy_information == HIERARCHY_NONE && -- fepriv->parameters.u.ofdm.code_rate_LP == FEC_NONE) -- fepriv->parameters.u.ofdm.code_rate_LP = FEC_AUTO; -+ if (fepriv->parameters_in.u.ofdm.hierarchy_information == HIERARCHY_NONE && -+ fepriv->parameters_in.u.ofdm.code_rate_LP == FEC_NONE) -+ fepriv->parameters_in.u.ofdm.code_rate_LP = FEC_AUTO; - } - - /* get frontend-specific tuning settings */ -@@ -1832,8 +1854,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - switch(fe->ops.info.type) { - case FE_QPSK: - fepriv->min_delay = HZ/20; -- fepriv->step_size = fepriv->parameters.u.qpsk.symbol_rate / 16000; -- fepriv->max_drift = fepriv->parameters.u.qpsk.symbol_rate / 2000; -+ fepriv->step_size = fepriv->parameters_in.u.qpsk.symbol_rate / 16000; -+ fepriv->max_drift = fepriv->parameters_in.u.qpsk.symbol_rate / 2000; - break; - - case FE_QAM: -@@ -1875,8 +1897,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file, - - case FE_GET_FRONTEND: - if (fe->ops.get_frontend) { -- memcpy (parg, &fepriv->parameters, sizeof (struct dvb_frontend_parameters)); -- err = fe->ops.get_frontend(fe, (struct dvb_frontend_parameters*) parg); -+ err = fe->ops.get_frontend(fe, &fepriv->parameters_out); -+ memcpy(parg, &fepriv->parameters_out, sizeof(struct dvb_frontend_parameters)); - } - break; - -@@ -1967,6 +1989,14 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) - if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) { - if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0) - goto err0; -+ -+ /* If we took control of the bus, we need to force -+ reinitialization. This is because many ts_bus_ctrl() -+ functions strobe the RESET pin on the demod, and if the -+ frontend thread already exists then the dvb_init() routine -+ won't get called (which is what usually does initial -+ register configuration). */ -+ fepriv->reinitialise = 1; - } - - if ((ret = dvb_generic_open (inode, file)) < 0) -diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h -index f9f19be..5590eb6 100644 ---- a/drivers/media/dvb/dvb-core/dvb_frontend.h -+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h -@@ -239,7 +239,6 @@ struct analog_demod_ops { - void (*set_params)(struct dvb_frontend *fe, - struct analog_parameters *params); - int (*has_signal)(struct dvb_frontend *fe); -- int (*is_stereo)(struct dvb_frontend *fe); - int (*get_afc)(struct dvb_frontend *fe); - void (*tuner_status)(struct dvb_frontend *fe); - void (*standby)(struct dvb_frontend *fe); -@@ -359,6 +358,9 @@ struct dtv_frontend_properties { - - /* ISDB-T specifics */ - u32 isdbs_ts_id; -+ -+ /* DVB-T2 specifics */ -+ u32 dvbt2_plp_id; - }; - - struct dvb_frontend { -diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c -index 4df42aa..51752a9 100644 ---- a/drivers/media/dvb/dvb-core/dvb_net.c -+++ b/drivers/media/dvb/dvb-core/dvb_net.c -@@ -1329,7 +1329,8 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num) - return -EBUSY; - - dvb_net_stop(net); -- flush_scheduled_work(); -+ flush_work_sync(&priv->set_multicast_list_wq); -+ flush_work_sync(&priv->restart_net_feed_wq); - printk("dvb_net: removed network interface %s\n", net->name); - unregister_netdev(net); - dvbnet->state[num]=0; -diff --git a/drivers/media/dvb/dvb-core/dvb_net.h b/drivers/media/dvb/dvb-core/dvb_net.h -index 3a3126c..1e53acd 100644 ---- a/drivers/media/dvb/dvb-core/dvb_net.h -+++ b/drivers/media/dvb/dvb-core/dvb_net.h -@@ -32,6 +32,8 @@ - - #define DVB_NET_DEVICES_MAX 10 - -+#ifdef CONFIG_DVB_NET -+ - struct dvb_net { - struct dvb_device *dvbdev; - struct net_device *device[DVB_NET_DEVICES_MAX]; -@@ -40,8 +42,25 @@ struct dvb_net { - struct dmx_demux *demux; - }; - -- - void dvb_net_release(struct dvb_net *); - int dvb_net_init(struct dvb_adapter *, struct dvb_net *, struct dmx_demux *); - -+#else -+ -+struct dvb_net { -+ struct dvb_device *dvbdev; -+}; -+ -+static inline void dvb_net_release(struct dvb_net *dvbnet) -+{ -+} -+ -+static inline int dvb_net_init(struct dvb_adapter *adap, -+ struct dvb_net *dvbnet, struct dmx_demux *dmx) -+{ -+ return 0; -+} -+ -+#endif /* ifdef CONFIG_DVB_NET */ -+ - #endif -diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -index a5712cd..d5333f3 100644 ---- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -@@ -45,6 +45,7 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) - rbuf->data=data; - rbuf->size=len; - rbuf->error=0; -+ rbuf->do_wait=1; - - init_waitqueue_head(&rbuf->queue); - -diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -index 41f04da..6951dd3 100644 ---- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -@@ -39,6 +39,7 @@ struct dvb_ringbuffer { - - wait_queue_head_t queue; - spinlock_t lock; -+ int do_wait; - }; - - #define DVB_RINGBUFFER_PKTHDRSIZE 3 -diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h -index fec66bd..d47bccd 100644 ---- a/include/linux/dvb/audio.h -+++ b/include/linux/dvb/audio.h -@@ -67,7 +67,7 @@ typedef struct audio_status { - - - typedef --struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ -+struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */ - int vocal1; /* into left and right t at 70% each */ - int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ - int melody; /* mixed into the left channel and */ -diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h -index 493a2bf..36a3ed6 100644 ---- a/include/linux/dvb/frontend.h -+++ b/include/linux/dvb/frontend.h -@@ -175,14 +175,20 @@ typedef enum fe_transmit_mode { - TRANSMISSION_MODE_2K, - TRANSMISSION_MODE_8K, - TRANSMISSION_MODE_AUTO, -- TRANSMISSION_MODE_4K -+ TRANSMISSION_MODE_4K, -+ TRANSMISSION_MODE_1K, -+ TRANSMISSION_MODE_16K, -+ TRANSMISSION_MODE_32K, - } fe_transmit_mode_t; - - typedef enum fe_bandwidth { - BANDWIDTH_8_MHZ, - BANDWIDTH_7_MHZ, - BANDWIDTH_6_MHZ, -- BANDWIDTH_AUTO -+ BANDWIDTH_AUTO, -+ BANDWIDTH_5_MHZ, -+ BANDWIDTH_10_MHZ, -+ BANDWIDTH_1_712_MHZ, - } fe_bandwidth_t; - - -@@ -191,7 +197,10 @@ typedef enum fe_guard_interval { - GUARD_INTERVAL_1_16, - GUARD_INTERVAL_1_8, - GUARD_INTERVAL_1_4, -- GUARD_INTERVAL_AUTO -+ GUARD_INTERVAL_AUTO, -+ GUARD_INTERVAL_1_128, -+ GUARD_INTERVAL_19_128, -+ GUARD_INTERVAL_19_256, - } fe_guard_interval_t; - - -@@ -305,7 +314,9 @@ struct dvb_frontend_event { - - #define DTV_ISDBS_TS_ID 42 - --#define DTV_MAX_COMMAND DTV_ISDBS_TS_ID -+#define DTV_DVBT2_PLP_ID 43 -+ -+#define DTV_MAX_COMMAND DTV_DVBT2_PLP_ID - - typedef enum fe_pilot { - PILOT_ON, -@@ -337,6 +348,7 @@ typedef enum fe_delivery_system { - SYS_DMBTH, - SYS_CMMB, - SYS_DAB, -+ SYS_DVBT2, - } fe_delivery_system_t; - - struct dtv_cmds_h { -diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h -index 5a7546c..1421cc8 100644 ---- a/include/linux/dvb/version.h -+++ b/include/linux/dvb/version.h -@@ -24,6 +24,6 @@ - #define _DVBVERSION_H_ - - #define DVB_API_VERSION 5 --#define DVB_API_VERSION_MINOR 2 -+#define DVB_API_VERSION_MINOR 3 - - #endif /*_DVBVERSION_H_*/ diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/fix_cpu_proc.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/fix_cpu_proc.patch deleted file mode 100644 index 2074d6a..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/fix_cpu_proc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c -index e56931e..b740915 100644 ---- a/arch/mips/kernel/cpu-probe.c -+++ b/arch/mips/kernel/cpu-probe.c -@@ -936,7 +936,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - case PRID_IMP_BMIPS5000: - case PRID_IMP_BMIPS5200: - c->cputype = CPU_BMIPS5000; -- __cpu_name[cpu] = "Broadcom BMIPS5000"; -+ __cpu_name[cpu] = "Brcm4380"; - set_elf_platform(cpu, "bmips5000"); - c->options |= MIPS_CPU_ULRI; - break; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/pinmux.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/pinmux.patch deleted file mode 100644 index 7c564b7..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/pinmux.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/arch/mips/brcmstb/board.c b/arch/mips/brcmstb/board.c -index 6825ef1..f64b8bd 100644 ---- a/arch/mips/brcmstb/board.c -+++ b/arch/mips/brcmstb/board.c -@@ -567,6 +567,10 @@ void board_pinmux_setup(void) - - PINMUX(18, sgpio_00, 1); /* MoCA I2C */ - PINMUX(19, sgpio_01, 1); -+ -+ PINMUX(6, gpio_006, 2); -+ PINMUX(6, gpio_007, 2); -+ - #if defined(CONFIG_BCM7425B0) - brcm_moca_i2c_base = BPHYSADDR(BCHP_BSCC_REG_START); - #else diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/serial.patch b/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/serial.patch deleted file mode 100644 index 9a96395..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-2.6.37/serial.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c -index d75f8c7..49e0930 100644 ---- a/drivers/serial/8250.c -+++ b/drivers/serial/8250.c -@@ -1696,6 +1696,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up) - i->head = &up->list; - spin_unlock_irq(&i->lock); - irq_flags |= up->port.irqflags; -+ printk("request_irq %d %d %p\n", irq_flags, up->port.irq, i); - ret = request_irq(up->port.irq, serial8250_interrupt, - irq_flags, "serial", i); - if (ret < 0) diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/fix_cpu_proc.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/fix_cpu_proc.patch deleted file mode 100644 index 3025fec..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/fix_cpu_proc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c -index ebc0cd2..35f32ae 100644 ---- a/arch/mips/kernel/cpu-probe.c -+++ b/arch/mips/kernel/cpu-probe.c -@@ -941,7 +941,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - if (rev >= PRID_REV_BMIPS4380_LO && - rev <= PRID_REV_BMIPS4380_HI) { - c->cputype = CPU_BMIPS4380; -- __cpu_name[cpu] = "Broadcom BMIPS4380"; -+ __cpu_name[cpu] = "Brcm4380"; - set_elf_platform(cpu, "bmips4380"); - } else { - c->cputype = CPU_BMIPS4350; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/igmp.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/igmp.patch deleted file mode 100644 index e2e648c..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/igmp.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c -index d577199..e0d42db 100644 ---- a/net/ipv4/igmp.c -+++ b/net/ipv4/igmp.c -@@ -875,6 +875,8 @@ static void igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb, - * to be intended in a v3 query. - */ - max_delay = IGMPV3_MRC(ih3->code)*(HZ/IGMP_TIMER_SCALE); -+ if (!max_delay) -+ max_delay = 1; /* can't mod w/ 0 */ - } else { /* v3 */ - if (!pskb_may_pull(skb, sizeof(struct igmpv3_query))) - return; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/kernel_miscompilation_with_gcc_4_8.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/kernel_miscompilation_with_gcc_4_8.patch deleted file mode 100644 index 013384b..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/kernel_miscompilation_with_gcc_4_8.patch +++ /dev/null @@ -1,251 +0,0 @@ -commit 8511b7b083db01ad0538bea6a8af79f88fe02a8b -Author: hschang -Date: Wed Jan 8 20:32:42 2014 +0900 - - MIPS: Refactor 'clear_page' and 'copy_page' functions. - - Remove usage of the '__attribute__((alias("...")))' hack that aliased - to integer arrays containing micro-assembled instructions. This hack - breaks when building a microMIPS kernel. It also makes the code much - easier to understand. - - [ralf@linux-mips.org: Added back export of the clear_page and copy_page - symbols so certain modules will work again. Also fixed build with - CONFIG_SIBYTE_DMA_PAGEOPS enabled.] - - Signed-off-by: Steven J. Hill - Cc: linux-mips@linux-mips.org - Patchwork: https://patchwork.linux-mips.org/patch/3866/ - Acked-by: David Daney - Signed-off-by: Ralf Baechle - -diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c -index 1d04807..17160bf 100644 ---- a/arch/mips/kernel/mips_ksyms.c -+++ b/arch/mips/kernel/mips_ksyms.c -@@ -5,7 +5,7 @@ - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * -- * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05 by Ralf Baechle -+ * Copyright (C) 1996, 97, 98, 99, 2000, 01, 03, 04, 05, 12 by Ralf Baechle - * Copyright (C) 1999, 2000, 01 Silicon Graphics, Inc. - */ - #include -@@ -35,6 +35,13 @@ EXPORT_SYMBOL(memmove); - EXPORT_SYMBOL(kernel_thread); - - /* -+ * Functions that operate on entire pages. Mostly used by memory management. -+ */ -+ -+EXPORT_SYMBOL(clear_page); -+EXPORT_SYMBOL(copy_page); -+ -+/* - * Userspace access stuff. - */ - EXPORT_SYMBOL(__copy_user); -diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile -index 95e5ccb..2f2dc25 100644 ---- a/arch/mips/mm/Makefile -+++ b/arch/mips/mm/Makefile -@@ -4,7 +4,7 @@ - - obj-y += cache.o dma-default.o extable.o fault.o \ - init.o mmap.o tlbex.o tlbex-fault.o uasm.o \ -- page.o -+ page.o page-funcs.o - - obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o - obj-$(CONFIG_64BIT) += pgtable-64.o -diff --git a/arch/mips/mm/page-funcs.S b/arch/mips/mm/page-funcs.S -new file mode 100644 -index 0000000..48a6b38 ---- /dev/null -+++ b/arch/mips/mm/page-funcs.S -@@ -0,0 +1,50 @@ -+/* -+ * This file is subject to the terms and conditions of the GNU General Public -+ * License. See the file "COPYING" in the main directory of this archive -+ * for more details. -+ * -+ * Micro-assembler generated clear_page/copy_page functions. -+ * -+ * Copyright (C) 2012 MIPS Technologies, Inc. -+ * Copyright (C) 2012 Ralf Baechle -+ */ -+#include -+#include -+ -+#ifdef CONFIG_SIBYTE_DMA_PAGEOPS -+#define cpu_clear_page_function_name clear_page_cpu -+#define cpu_copy_page_function_name copy_page_cpu -+#else -+#define cpu_clear_page_function_name clear_page -+#define cpu_copy_page_function_name copy_page -+#endif -+ -+/* -+ * Maximum sizes: -+ * -+ * R4000 128 bytes S-cache: 0x058 bytes -+ * R4600 v1.7: 0x05c bytes -+ * R4600 v2.0: 0x060 bytes -+ * With prefetching, 16 word strides 0x120 bytes -+ */ -+EXPORT(__clear_page_start) -+LEAF(cpu_clear_page_function_name) -+1: j 1b /* Dummy, will be replaced. */ -+ .space 288 -+END(cpu_clear_page_function_name) -+EXPORT(__clear_page_end) -+ -+/* -+ * Maximum sizes: -+ * -+ * R4000 128 bytes S-cache: 0x11c bytes -+ * R4600 v1.7: 0x080 bytes -+ * R4600 v2.0: 0x07c bytes -+ * With prefetching, 16 word strides 0x540 bytes -+ */ -+EXPORT(__copy_page_start) -+LEAF(cpu_copy_page_function_name) -+1: j 1b /* Dummy, will be replaced. */ -+ .space 1344 -+END(cpu_copy_page_function_name) -+EXPORT(__copy_page_end) -diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c -index 36272f7..a22bd40 100644 ---- a/arch/mips/mm/page.c -+++ b/arch/mips/mm/page.c -@@ -6,6 +6,7 @@ - * Copyright (C) 2003, 04, 05 Ralf Baechle (ralf@linux-mips.org) - * Copyright (C) 2007 Maciej W. Rozycki - * Copyright (C) 2008 Thiemo Seufer -+ * Copyright (C) 2012 MIPS Technologies, Inc. - */ - #include - #include -@@ -72,45 +73,6 @@ static struct uasm_reloc __cpuinitdata relocs[5]; - #define cpu_is_r4600_v1_x() ((read_c0_prid() & 0xfffffff0) == 0x00002010) - #define cpu_is_r4600_v2_x() ((read_c0_prid() & 0xfffffff0) == 0x00002020) - --/* -- * Maximum sizes: -- * -- * R4000 128 bytes S-cache: 0x058 bytes -- * R4600 v1.7: 0x05c bytes -- * R4600 v2.0: 0x060 bytes -- * With prefetching, 16 word strides 0x120 bytes -- */ -- --static u32 clear_page_array[0x120 / 4]; -- --#ifdef CONFIG_SIBYTE_DMA_PAGEOPS --void clear_page_cpu(void *page) __attribute__((alias("clear_page_array"))); --#else --void clear_page(void *page) __attribute__((alias("clear_page_array"))); --#endif -- --EXPORT_SYMBOL(clear_page); -- --/* -- * Maximum sizes: -- * -- * R4000 128 bytes S-cache: 0x11c bytes -- * R4600 v1.7: 0x080 bytes -- * R4600 v2.0: 0x07c bytes -- * With prefetching, 16 word strides 0x540 bytes -- */ --static u32 copy_page_array[0x540 / 4]; -- --#ifdef CONFIG_SIBYTE_DMA_PAGEOPS --void --copy_page_cpu(void *to, void *from) __attribute__((alias("copy_page_array"))); --#else --void copy_page(void *to, void *from) __attribute__((alias("copy_page_array"))); --#endif -- --EXPORT_SYMBOL(copy_page); -- -- - static int pref_bias_clear_store __cpuinitdata; - static int pref_bias_copy_load __cpuinitdata; - static int pref_bias_copy_store __cpuinitdata; -@@ -283,10 +245,15 @@ static inline void __cpuinit build_clear_pref(u32 **buf, int off) - } - } - -+extern u32 __clear_page_start; -+extern u32 __clear_page_end; -+extern u32 __copy_page_start; -+extern u32 __copy_page_end; -+ - void __cpuinit build_clear_page(void) - { - int off; -- u32 *buf = (u32 *)&clear_page_array; -+ u32 *buf = &__clear_page_start; - struct uasm_label *l = labels; - struct uasm_reloc *r = relocs; - int i; -@@ -357,17 +324,17 @@ void __cpuinit build_clear_page(void) - uasm_i_jr(&buf, RA); - uasm_i_nop(&buf); - -- BUG_ON(buf > clear_page_array + ARRAY_SIZE(clear_page_array)); -+ BUG_ON(buf > &__clear_page_end); - - uasm_resolve_relocs(relocs, labels); - - pr_debug("Synthesized clear page handler (%u instructions).\n", -- (u32)(buf - clear_page_array)); -+ (u32)(buf - &__clear_page_start)); - - pr_debug("\t.set push\n"); - pr_debug("\t.set noreorder\n"); -- for (i = 0; i < (buf - clear_page_array); i++) -- pr_debug("\t.word 0x%08x\n", clear_page_array[i]); -+ for (i = 0; i < (buf - &__clear_page_start); i++) -+ pr_debug("\t.word 0x%08x\n", (&__clear_page_start)[i]); - pr_debug("\t.set pop\n"); - } - -@@ -428,7 +395,7 @@ static inline void build_copy_store_pref(u32 **buf, int off) - void __cpuinit build_copy_page(void) - { - int off; -- u32 *buf = (u32 *)©_page_array; -+ u32 *buf = &__copy_page_start; - struct uasm_label *l = labels; - struct uasm_reloc *r = relocs; - int i; -@@ -596,21 +563,23 @@ void __cpuinit build_copy_page(void) - uasm_i_jr(&buf, RA); - uasm_i_nop(&buf); - -- BUG_ON(buf > copy_page_array + ARRAY_SIZE(copy_page_array)); -+ BUG_ON(buf > &__copy_page_end); - - uasm_resolve_relocs(relocs, labels); - - pr_debug("Synthesized copy page handler (%u instructions).\n", -- (u32)(buf - copy_page_array)); -+ (u32)(buf - &__copy_page_start)); - - pr_debug("\t.set push\n"); - pr_debug("\t.set noreorder\n"); -- for (i = 0; i < (buf - copy_page_array); i++) -- pr_debug("\t.word 0x%08x\n", copy_page_array[i]); -+ for (i = 0; i < (buf - &__copy_page_start); i++) -+ pr_debug("\t.word 0x%08x\n", (&__copy_page_start)[i]); - pr_debug("\t.set pop\n"); - } - - #ifdef CONFIG_SIBYTE_DMA_PAGEOPS -+extern void clear_page_cpu(void *page); -+extern void copy_page_cpu(void *to, void *from); - - /* - * Pad descriptors to cacheline, since each is exclusively owned by a diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/linux-sata_brcm.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/linux-sata_brcm.patch deleted file mode 100644 index 9216bad..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/linux-sata_brcm.patch +++ /dev/null @@ -1,243 +0,0 @@ -diff --git a/drivers/ata/sata_brcmstb.c b/drivers/ata/sata_brcmstb.c -index 7ba20e0..ca02cdf 100644 ---- a/drivers/ata/sata_brcmstb.c -+++ b/drivers/ata/sata_brcmstb.c -@@ -53,9 +53,7 @@ - #include - #include - #include --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - #include --#endif - - #ifdef CONFIG_PPC_OF - #include -@@ -127,7 +125,7 @@ enum { - K2_SATA_TF_LBAM_OFFSET = 0x10, - K2_SATA_TF_LBAH_OFFSET = 0x14, - K2_SATA_TF_DEVICE_OFFSET = 0x18, -- K2_SATA_TF_CMDSTAT_OFFSET = 0x1c, -+ K2_SATA_TF_CMDSTAT_OFFSET = 0x1c, - K2_SATA_TF_CTL_OFFSET = 0x20, - - /* DMA base */ -@@ -142,7 +140,7 @@ enum { - /* Others */ - K2_SATA_SICR1_OFFSET = 0x80, - K2_SATA_SICR2_OFFSET = 0x84, -- K2_SATA_SIMR_OFFSET = 0x88, /* SATA interrupt mask register */ -+ K2_SATA_SIMR_OFFSET = 0x88, /* SATA intr mask register */ - K2_SATA_MDIO_OFFSET = 0x8c, /* SATA MDIO access register */ - K2_SATA_SCQR_OFFSET = 0x94, /* SATA command queue depth */ - K2_SATA_QAL_OFFSET = 0xa0, /* QDMA ring address lower */ -@@ -330,6 +328,22 @@ static void brcm_EnableOOBWindowFix(void __iomem *mmio_base, int port) - mdio_write_reg(mmio_base, port, 0x0D, sval); - } - -+static void brcm_Enable256AlignDetection(void __iomem *mmio_base, int port) -+{ -+ uint32_t tmp32; -+ void __iomem *port_mmio; -+ -+ port_mmio = PORT_BASE(mmio_base, port); -+ -+ tmp32 = readl(port_mmio + K2_SATA_SICR1_OFFSET); -+ tmp32 |= 0x08000000; -+ writel(tmp32, port_mmio + K2_SATA_SICR1_OFFSET); -+ -+ tmp32 = readl(port_mmio + K2_SATA_SICR2_OFFSET); -+ tmp32 |= 0x00800000; -+ writel(tmp32, port_mmio + K2_SATA_SICR2_OFFSET); -+} -+ - static void brcm_AnalogReset(void __iomem *mmio_base, int port) - { - /* do analog reset */ -@@ -385,6 +399,8 @@ static void brcm_InitSata_1_5Gb(void __iomem *mmio_base, int port) - brcm_SetPllTxRxCtrl(mmio_base, port); - brcm_EnableOOBWindowFix(mmio_base, port); - -+ brcm_Enable256AlignDetection(mmio_base, port); -+ - if (!port) { - #ifdef CONFIG_BRCM_SATA_75MHZ_PLL - /* use 75Mhz PLL clock */ -@@ -446,6 +462,8 @@ static void brcm_InitSata2_3Gb(void __iomem *mmio_base, int port) - brcm_SetPllTxRxCtrl(mmio_base, port); - brcm_EnableOOBWindowFix(mmio_base, port); - -+ brcm_Enable256AlignDetection(mmio_base, port); -+ - if (!port) { - #ifdef CONFIG_BRCM_SATA_75MHZ_PLL - /* use 75Mhz PLL clock */ -@@ -758,11 +776,7 @@ static void k2_bmdma_setup_mmio(struct ata_queued_cmd *qc) - void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr; - /* load PRD table addr. */ - mb(); /* make sure PRD table writes are visible to controller */ --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - writel(ap->bmdma_prd_dma, mmio + ATA_DMA_TABLE_OFS); --#else -- writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS); --#endif - - /* specify data direction, triple-check start bit is clear */ - dmactl = readb(mmio + ATA_DMA_CMD); -@@ -819,11 +833,7 @@ static void k2_bmdma_start_mmio(struct ata_queued_cmd *qc) - - static int k2_sata_port_start(struct ata_port *ap) - { --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - ata_bmdma_port_start(ap); --#else -- ata_port_start(ap); --#endif - return 0; - } - -@@ -848,8 +858,7 @@ static irqreturn_t k2_sata_interrupt(int irq, void *dev_instance) - - ap = host->ports[i]; - -- ata_for_each_link(link, ap, EDGE) -- { -+ ata_for_each_link(link, ap, EDGE) { - int rc; - unsigned int serror; - -@@ -887,11 +896,7 @@ static irqreturn_t k2_sata_interrupt(int irq, void *dev_instance) - if (handled & IRQ_HANDLED) - return handled; - --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - return ata_bmdma_interrupt(irq, dev_instance); --#else -- return ata_sff_interrupt(irq, dev_instance); --#endif - } - - /* -@@ -1044,10 +1049,7 @@ static void k2_sata_remove_one(struct pci_dev *pdev) - struct k2_host_priv *hp = host->private_data; - - brcm_pm_unregister_cb("sata"); -- --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - pm_runtime_get_noresume(&pdev->dev); --#endif - - K2_POWER_ON(host); - ata_pci_remove_one(pdev); -@@ -1135,7 +1137,9 @@ static int k2_sata_resume(struct device *dev) - ap = host->ports[i]; - - ata_for_each_link(link, ap, EDGE) { -+ spin_unlock_irqrestore(&hp->lock, flags); - sata_std_hardreset(link, NULL, 1000); -+ spin_lock_irqsave(&hp->lock, flags); - } - } - -@@ -1144,7 +1148,6 @@ static int k2_sata_resume(struct device *dev) - return 0; - } - --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - static int k2_sata_runtime_suspend(struct device *dev) - { - return k2_sata_suspend(dev); -@@ -1162,8 +1165,6 @@ static int k2_sata_runtime_idle(struct device *dev) - return 0; /* ignored by pm core */ - } - --#endif -- - /* - * Driver initialization - */ -@@ -1206,25 +1207,25 @@ static struct ata_port_operations k2_sata_ops = { - }; - - static const struct ata_port_info k2_port_info[] = { -- /* chip_sata1 */ -- { -- .flags = ATA_FLAG_SATA | -- K2_FLAG_NO_ATAPI_DMA, -- .pio_mask = 0x1f, -- .mwdma_mask = 0x07, -- .udma_mask = ATA_UDMA7, -- .port_ops = &k2_sata_ops, -- }, -- /* chip_sata2 */ -- { -- .flags = ATA_FLAG_SATA | -- K2_FLAG_NO_ATAPI_DMA | -- K2_FLAG_BRCM_SATA2, -- .pio_mask = 0x1f, -- .mwdma_mask = 0x07, -- .udma_mask = ATA_UDMA7, -- .port_ops = &k2_sata_ops, -- }, -+ /* chip_sata1 */ -+ { -+ .flags = ATA_FLAG_SATA | -+ K2_FLAG_NO_ATAPI_DMA, -+ .pio_mask = 0x1f, -+ .mwdma_mask = 0x07, -+ .udma_mask = ATA_UDMA7, -+ .port_ops = &k2_sata_ops, -+ }, -+ /* chip_sata2 */ -+ { -+ .flags = ATA_FLAG_SATA | -+ K2_FLAG_NO_ATAPI_DMA | -+ K2_FLAG_BRCM_SATA2, -+ .pio_mask = 0x1f, -+ .mwdma_mask = 0x07, -+ .udma_mask = ATA_UDMA7, -+ .port_ops = &k2_sata_ops, -+ }, - }; - - static void k2_sata_setup_port(struct ata_ioports *port, void __iomem *base) -@@ -1250,8 +1251,8 @@ static int k2_sata_init_one(struct pci_dev *pdev, - const struct pci_device_id *ent) - { - static int printed_version; -- const struct ata_port_info *ppi[] = -- { &k2_port_info[ent->driver_data], NULL }; -+ const struct ata_port_info *ppi[] = { -+ &k2_port_info[ent->driver_data], NULL }; - struct ata_host *host; - void __iomem *mmio_base; - int n_ports, i, rc, bar_pos; -@@ -1358,13 +1359,10 @@ static int k2_sata_init_one(struct pci_dev *pdev, - - brcm_pm_register_cb("sata", k2_sata_pm_cb, host); - --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - /* pci core incremented pm counter before calling probe, - * we are decrementing it to enable runtime pm */ - pm_runtime_put_noidle(&pdev->dev); - --#endif -- - return 0; - } - -@@ -1374,14 +1372,12 @@ static const struct pci_device_id k2_sata_pci_tbl[] = { - { } - }; - --static struct dev_pm_ops k2_sata_pm_ops = { -+static const struct dev_pm_ops k2_sata_pm_ops = { - .suspend_noirq = k2_sata_suspend, - .resume_noirq = k2_sata_resume, --#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - .runtime_suspend = k2_sata_runtime_suspend, - .runtime_resume = k2_sata_runtime_resume, - .runtime_idle = k2_sata_runtime_idle, --#endif - }; - - static struct pci_driver k2_sata_pci_driver = { diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/rt5372_kernel_3.1.1.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/rt5372_kernel_3.1.1.patch deleted file mode 100644 index d70c5c6..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.1.1/rt5372_kernel_3.1.1.patch +++ /dev/null @@ -1,437 +0,0 @@ -diff -Naur linux.orig/drivers/net/wireless/rt2x00/rt2800.h linux/drivers/net/wireless/rt2x00/rt2800.h ---- linux.orig/drivers/net/wireless/rt2x00/rt2800.h 2011-11-11 21:19:27.000000000 +0100 -+++ linux/drivers/net/wireless/rt2x00/rt2800.h 2014-02-23 20:21:13.000000000 +0100 -@@ -68,6 +68,7 @@ - #define RF3322 0x000c - #define RF3853 0x000d - #define RF5370 0x5370 -+#define RF5372 0x5372 - #define RF5390 0x5390 - - /* -diff -Naur linux.orig/drivers/net/wireless/rt2x00/rt2800lib.c linux/drivers/net/wireless/rt2x00/rt2800lib.c ---- linux.orig/drivers/net/wireless/rt2x00/rt2800lib.c 2011-11-11 21:19:27.000000000 +0100 -+++ linux/drivers/net/wireless/rt2x00/rt2800lib.c 2014-02-23 20:25:27.000000000 +0100 -@@ -402,7 +402,8 @@ - - if (rt2x00_is_pci(rt2x00dev)) { - if (rt2x00_rt(rt2x00dev, RT3572) || -- rt2x00_rt(rt2x00dev, RT5390)) { -+ rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_register_read(rt2x00dev, AUX_CTRL, ®); - rt2x00_set_field32(®, AUX_CTRL_FORCE_PCIE_CLK, 1); - rt2x00_set_field32(®, AUX_CTRL_WAKE_PCIE_EN, 1); -@@ -1128,8 +1129,10 @@ - !(filter_flags & FIF_CONTROL)); - rt2x00_set_field32(®, RX_FILTER_CFG_DROP_PSPOLL, - !(filter_flags & FIF_PSPOLL)); -- rt2x00_set_field32(®, RX_FILTER_CFG_DROP_BA, 1); -- rt2x00_set_field32(®, RX_FILTER_CFG_DROP_BAR, 0); -+ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_BA, -+ !(filter_flags & FIF_CONTROL)); -+ rt2x00_set_field32(®, RX_FILTER_CFG_DROP_BAR, -+ !(filter_flags & FIF_CONTROL)); - rt2x00_set_field32(®, RX_FILTER_CFG_DROP_CNTL, - !(filter_flags & FIF_CONTROL)); - rt2800_register_write(rt2x00dev, RX_FILTER_CFG, reg); -@@ -1867,19 +1870,25 @@ - info->default_power2 = TXPOWER_A_TO_DEV(info->default_power2); - } - -- if (rt2x00_rf(rt2x00dev, RF2020) || -- rt2x00_rf(rt2x00dev, RF3020) || -- rt2x00_rf(rt2x00dev, RF3021) || -- rt2x00_rf(rt2x00dev, RF3022) || -- rt2x00_rf(rt2x00dev, RF3320)) -+ switch (rt2x00dev->chip.rf) { -+ case RF2020: -+ case RF3020: -+ case RF3021: -+ case RF3022: -+ case RF3320: - rt2800_config_channel_rf3xxx(rt2x00dev, conf, rf, info); -- else if (rt2x00_rf(rt2x00dev, RF3052)) -+ break; -+ case RF3052: - rt2800_config_channel_rf3052(rt2x00dev, conf, rf, info); -- else if (rt2x00_rf(rt2x00dev, RF5370) || -- rt2x00_rf(rt2x00dev, RF5390)) -+ break; -+ case RF5370: -+ case RF5372: -+ case RF5390: - rt2800_config_channel_rf53xx(rt2x00dev, conf, rf, info); -- else -+ break; -+ default: - rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); -+ } - - /* - * Change BBP settings -@@ -1890,7 +1899,8 @@ - rt2800_bbp_write(rt2x00dev, 86, 0); - - if (rf->channel <= 14) { -- if (!rt2x00_rt(rt2x00dev, RT5390)) { -+ if (!rt2x00_rt(rt2x00dev, RT5390) && -+ !rt2x00_rt(rt2x00dev, RT5392)) { - if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, - &rt2x00dev->cap_flags)) { - rt2800_bbp_write(rt2x00dev, 82, 0x62); -@@ -2420,7 +2430,8 @@ - rt2x00_rt(rt2x00dev, RT3071) || - rt2x00_rt(rt2x00dev, RT3090) || - rt2x00_rt(rt2x00dev, RT3390) || -- rt2x00_rt(rt2x00dev, RT5390)) -+ rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - return 0x1c + (2 * rt2x00dev->lna_gain); - else - return 0x2e + rt2x00dev->lna_gain; -@@ -2555,7 +2566,8 @@ - } else if (rt2x00_rt(rt2x00dev, RT3572)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400); - rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); -- } else if (rt2x00_rt(rt2x00dev, RT5390)) { -+ } else if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); - rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); - rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); -@@ -2934,7 +2946,8 @@ - rt2800_wait_bbp_ready(rt2x00dev))) - return -EACCES; - -- if (rt2x00_rt(rt2x00dev, RT5390)) { -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_bbp_read(rt2x00dev, 4, &value); - rt2x00_set_field8(&value, BBP4_MAC_IF_CTRL, 1); - rt2800_bbp_write(rt2x00dev, 4, value); -@@ -2942,19 +2955,22 @@ - - if (rt2800_is_305x_soc(rt2x00dev) || - rt2x00_rt(rt2x00dev, RT3572) || -- rt2x00_rt(rt2x00dev, RT5390)) -+ rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 31, 0x08); - - rt2800_bbp_write(rt2x00dev, 65, 0x2c); - rt2800_bbp_write(rt2x00dev, 66, 0x38); - -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 68, 0x0b); - - if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860C)) { - rt2800_bbp_write(rt2x00dev, 69, 0x16); - rt2800_bbp_write(rt2x00dev, 73, 0x12); -- } else if (rt2x00_rt(rt2x00dev, RT5390)) { -+ } else if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_bbp_write(rt2x00dev, 69, 0x12); - rt2800_bbp_write(rt2x00dev, 73, 0x13); - rt2800_bbp_write(rt2x00dev, 75, 0x46); -@@ -2972,7 +2988,8 @@ - rt2x00_rt(rt2x00dev, RT3090) || - rt2x00_rt(rt2x00dev, RT3390) || - rt2x00_rt(rt2x00dev, RT3572) || -- rt2x00_rt(rt2x00dev, RT5390)) { -+ rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_bbp_write(rt2x00dev, 79, 0x13); - rt2800_bbp_write(rt2x00dev, 80, 0x05); - rt2800_bbp_write(rt2x00dev, 81, 0x33); -@@ -2984,64 +3001,88 @@ - } - - rt2800_bbp_write(rt2x00dev, 82, 0x62); -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 83, 0x7a); - else - rt2800_bbp_write(rt2x00dev, 83, 0x6a); - - if (rt2x00_rt_rev(rt2x00dev, RT2860, REV_RT2860D)) - rt2800_bbp_write(rt2x00dev, 84, 0x19); -- else if (rt2x00_rt(rt2x00dev, RT5390)) -+ else if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 84, 0x9a); - else - rt2800_bbp_write(rt2x00dev, 84, 0x99); - -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 86, 0x38); - else - rt2800_bbp_write(rt2x00dev, 86, 0x00); - -+ if (rt2x00_rt(rt2x00dev, RT5392)) -+ rt2800_bbp_write(rt2x00dev, 88, 0x90); -+ - rt2800_bbp_write(rt2x00dev, 91, 0x04); - -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 92, 0x02); - else - rt2800_bbp_write(rt2x00dev, 92, 0x00); - -+ if (rt2x00_rt(rt2x00dev, RT5392)) { -+ rt2800_bbp_write(rt2x00dev, 95, 0x9a); -+ rt2800_bbp_write(rt2x00dev, 98, 0x12); -+ } -+ - if (rt2x00_rt_rev_gte(rt2x00dev, RT3070, REV_RT3070F) || - rt2x00_rt_rev_gte(rt2x00dev, RT3071, REV_RT3071E) || - rt2x00_rt_rev_gte(rt2x00dev, RT3090, REV_RT3090E) || - rt2x00_rt_rev_gte(rt2x00dev, RT3390, REV_RT3390E) || - rt2x00_rt(rt2x00dev, RT3572) || - rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392) || - rt2800_is_305x_soc(rt2x00dev)) - rt2800_bbp_write(rt2x00dev, 103, 0xc0); - else - rt2800_bbp_write(rt2x00dev, 103, 0x00); - -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 104, 0x92); - - if (rt2800_is_305x_soc(rt2x00dev)) - rt2800_bbp_write(rt2x00dev, 105, 0x01); -- else if (rt2x00_rt(rt2x00dev, RT5390)) -+ else if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 105, 0x3c); - else - rt2800_bbp_write(rt2x00dev, 105, 0x05); - - if (rt2x00_rt(rt2x00dev, RT5390)) - rt2800_bbp_write(rt2x00dev, 106, 0x03); -+ else if (rt2x00_rt(rt2x00dev, RT5392)) -+ rt2800_bbp_write(rt2x00dev, 106, 0x12); - else - rt2800_bbp_write(rt2x00dev, 106, 0x35); - -- if (rt2x00_rt(rt2x00dev, RT5390)) -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) - rt2800_bbp_write(rt2x00dev, 128, 0x12); - -+ if (rt2x00_rt(rt2x00dev, RT5392)) { -+ rt2800_bbp_write(rt2x00dev, 134, 0xd0); -+ rt2800_bbp_write(rt2x00dev, 135, 0xf6); -+ } -+ - if (rt2x00_rt(rt2x00dev, RT3071) || - rt2x00_rt(rt2x00dev, RT3090) || - rt2x00_rt(rt2x00dev, RT3390) || - rt2x00_rt(rt2x00dev, RT3572) || -- rt2x00_rt(rt2x00dev, RT5390)) { -+ rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_bbp_read(rt2x00dev, 138, &value); - - rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0, &eeprom); -@@ -3053,7 +3094,8 @@ - rt2800_bbp_write(rt2x00dev, 138, value); - } - -- if (rt2x00_rt(rt2x00dev, RT5390)) { -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - int ant, div_mode; - - rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1, &eeprom); -@@ -3179,13 +3221,15 @@ - !rt2x00_rt(rt2x00dev, RT3390) && - !rt2x00_rt(rt2x00dev, RT3572) && - !rt2x00_rt(rt2x00dev, RT5390) && -+ !rt2x00_rt(rt2x00dev, RT5392) && - !rt2800_is_305x_soc(rt2x00dev)) - return 0; - - /* - * Init RF calibration. - */ -- if (rt2x00_rt(rt2x00dev, RT5390)) { -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_rfcsr_read(rt2x00dev, 2, &rfcsr); - rt2x00_set_field8(&rfcsr, RFCSR2_RESCAL_EN, 1); - rt2800_rfcsr_write(rt2x00dev, 2, rfcsr); -@@ -3403,6 +3447,66 @@ - rt2800_rfcsr_write(rt2x00dev, 61, 0xdd); - rt2800_rfcsr_write(rt2x00dev, 62, 0x00); - rt2800_rfcsr_write(rt2x00dev, 63, 0x00); -+ } else if (rt2x00_rt(rt2x00dev, RT5392)) { -+ rt2800_rfcsr_write(rt2x00dev, 1, 0x17); -+ rt2800_rfcsr_write(rt2x00dev, 2, 0x80); -+ rt2800_rfcsr_write(rt2x00dev, 3, 0x88); -+ rt2800_rfcsr_write(rt2x00dev, 5, 0x10); -+ rt2800_rfcsr_write(rt2x00dev, 6, 0xe0); -+ rt2800_rfcsr_write(rt2x00dev, 7, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 10, 0x53); -+ rt2800_rfcsr_write(rt2x00dev, 11, 0x4a); -+ rt2800_rfcsr_write(rt2x00dev, 12, 0x46); -+ rt2800_rfcsr_write(rt2x00dev, 13, 0x9f); -+ rt2800_rfcsr_write(rt2x00dev, 14, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 15, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 16, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 18, 0x03); -+ rt2800_rfcsr_write(rt2x00dev, 19, 0x4d); -+ rt2800_rfcsr_write(rt2x00dev, 20, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 21, 0x8d); -+ rt2800_rfcsr_write(rt2x00dev, 22, 0x20); -+ rt2800_rfcsr_write(rt2x00dev, 23, 0x0b); -+ rt2800_rfcsr_write(rt2x00dev, 24, 0x44); -+ rt2800_rfcsr_write(rt2x00dev, 25, 0x80); -+ rt2800_rfcsr_write(rt2x00dev, 26, 0x82); -+ rt2800_rfcsr_write(rt2x00dev, 27, 0x09); -+ rt2800_rfcsr_write(rt2x00dev, 28, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 29, 0x10); -+ rt2800_rfcsr_write(rt2x00dev, 30, 0x10); -+ rt2800_rfcsr_write(rt2x00dev, 31, 0x80); -+ rt2800_rfcsr_write(rt2x00dev, 32, 0x20); -+ rt2800_rfcsr_write(rt2x00dev, 33, 0xC0); -+ rt2800_rfcsr_write(rt2x00dev, 34, 0x07); -+ rt2800_rfcsr_write(rt2x00dev, 35, 0x12); -+ rt2800_rfcsr_write(rt2x00dev, 36, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 37, 0x08); -+ rt2800_rfcsr_write(rt2x00dev, 38, 0x89); -+ rt2800_rfcsr_write(rt2x00dev, 39, 0x1b); -+ rt2800_rfcsr_write(rt2x00dev, 40, 0x0f); -+ rt2800_rfcsr_write(rt2x00dev, 41, 0xbb); -+ rt2800_rfcsr_write(rt2x00dev, 42, 0xd5); -+ rt2800_rfcsr_write(rt2x00dev, 43, 0x9b); -+ rt2800_rfcsr_write(rt2x00dev, 44, 0x0e); -+ rt2800_rfcsr_write(rt2x00dev, 45, 0xa2); -+ rt2800_rfcsr_write(rt2x00dev, 46, 0x73); -+ rt2800_rfcsr_write(rt2x00dev, 47, 0x0c); -+ rt2800_rfcsr_write(rt2x00dev, 48, 0x10); -+ rt2800_rfcsr_write(rt2x00dev, 49, 0x94); -+ rt2800_rfcsr_write(rt2x00dev, 50, 0x94); -+ rt2800_rfcsr_write(rt2x00dev, 51, 0x3a); -+ rt2800_rfcsr_write(rt2x00dev, 52, 0x48); -+ rt2800_rfcsr_write(rt2x00dev, 53, 0x44); -+ rt2800_rfcsr_write(rt2x00dev, 54, 0x38); -+ rt2800_rfcsr_write(rt2x00dev, 55, 0x43); -+ rt2800_rfcsr_write(rt2x00dev, 56, 0xa1); -+ rt2800_rfcsr_write(rt2x00dev, 57, 0x00); -+ rt2800_rfcsr_write(rt2x00dev, 58, 0x39); -+ rt2800_rfcsr_write(rt2x00dev, 59, 0x07); -+ rt2800_rfcsr_write(rt2x00dev, 60, 0x45); -+ rt2800_rfcsr_write(rt2x00dev, 61, 0x91); -+ rt2800_rfcsr_write(rt2x00dev, 62, 0x39); -+ rt2800_rfcsr_write(rt2x00dev, 63, 0x07); - } - - if (rt2x00_rt_rev_lt(rt2x00dev, RT3070, REV_RT3070F)) { -@@ -3470,7 +3574,8 @@ - rt2800_init_rx_filter(rt2x00dev, true, 0x27, 0x15); - } - -- if (!rt2x00_rt(rt2x00dev, RT5390)) { -+ if (!rt2x00_rt(rt2x00dev, RT5390) && -+ !rt2x00_rt(rt2x00dev, RT5392)) { - /* - * Set back to initial state - */ -@@ -3498,7 +3603,8 @@ - rt2x00_set_field32(®, OPT_14_CSR_BIT0, 1); - rt2800_register_write(rt2x00dev, OPT_14_CSR, reg); - -- if (!rt2x00_rt(rt2x00dev, RT5390)) { -+ if (!rt2x00_rt(rt2x00dev, RT5390) && -+ !rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_rfcsr_read(rt2x00dev, 17, &rfcsr); - rt2x00_set_field8(&rfcsr, RFCSR17_TX_LO1_EN, 0); - if (rt2x00_rt(rt2x00dev, RT3070) || -@@ -3566,7 +3672,8 @@ - rt2800_rfcsr_write(rt2x00dev, 27, rfcsr); - } - -- if (rt2x00_rt(rt2x00dev, RT5390)) { -+ if (rt2x00_rt(rt2x00dev, RT5390) || -+ rt2x00_rt(rt2x00dev, RT5392)) { - rt2800_rfcsr_read(rt2x00dev, 38, &rfcsr); - rt2x00_set_field8(&rfcsr, RFCSR38_RX_LO1_EN, 0); - rt2800_rfcsr_write(rt2x00dev, 38, rfcsr); -@@ -3850,7 +3957,8 @@ - * RT53xx: defined in "EEPROM_CHIP_ID" field - */ - rt2800_register_read(rt2x00dev, MAC_CSR0, ®); -- if (rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5390) -+ if (rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5390 || -+ rt2x00_get_field32(reg, MAC_CSR0_CHIPSET) == RT5392) - rt2x00_eeprom_read(rt2x00dev, EEPROM_CHIP_ID, &value); - else - value = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); -@@ -3858,15 +3966,19 @@ - rt2x00_set_chip(rt2x00dev, rt2x00_get_field32(reg, MAC_CSR0_CHIPSET), - value, rt2x00_get_field32(reg, MAC_CSR0_REVISION)); - -- if (!rt2x00_rt(rt2x00dev, RT2860) && -- !rt2x00_rt(rt2x00dev, RT2872) && -- !rt2x00_rt(rt2x00dev, RT2883) && -- !rt2x00_rt(rt2x00dev, RT3070) && -- !rt2x00_rt(rt2x00dev, RT3071) && -- !rt2x00_rt(rt2x00dev, RT3090) && -- !rt2x00_rt(rt2x00dev, RT3390) && -- !rt2x00_rt(rt2x00dev, RT3572) && -- !rt2x00_rt(rt2x00dev, RT5390)) { -+ switch (rt2x00dev->chip.rt) { -+ case RT2860: -+ case RT2872: -+ case RT2883: -+ case RT3070: -+ case RT3071: -+ case RT3090: -+ case RT3390: -+ case RT3572: -+ case RT5390: -+ case RT5392: -+ break; -+ default: - ERROR(rt2x00dev, "Invalid RT chipset detected.\n"); - return -ENODEV; - } -@@ -3883,6 +3995,7 @@ - case RF3052: - case RF3320: - case RF5370: -+ case RF5372: - case RF5390: - break; - default: -@@ -4189,6 +4302,7 @@ - rt2x00_rf(rt2x00dev, RF3022) || - rt2x00_rf(rt2x00dev, RF3320) || - rt2x00_rf(rt2x00dev, RF5370) || -+ rt2x00_rf(rt2x00dev, RF5372) || - rt2x00_rf(rt2x00dev, RF5390)) { - spec->num_channels = 14; - spec->channels = rf_vals_3x; -diff -Naur linux.orig/drivers/net/wireless/rt2x00/rt2x00.h linux/drivers/net/wireless/rt2x00/rt2x00.h ---- linux.orig/drivers/net/wireless/rt2x00/rt2x00.h 2011-11-11 21:19:27.000000000 +0100 -+++ linux/drivers/net/wireless/rt2x00/rt2x00.h 2014-02-23 20:20:33.000000000 +0100 -@@ -191,7 +191,8 @@ - #define RT3572 0x3572 - #define RT3593 0x3593 /* PCIe */ - #define RT3883 0x3883 /* WSOC */ --#define RT5390 0x5390 /* 2.4GHz */ -+#define RT5390 0x5390 /* 2.4GHz */ -+#define RT5392 0x5392 /* 2.4GHz */ - - u16 rf; - u16 rev; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux-tcp_output.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux-tcp_output.patch deleted file mode 100644 index cda1c68..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux-tcp_output.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c -index 7820f3a..fb6b332 100644 ---- a/net/ipv4/tcp_output.c -+++ b/net/ipv4/tcp_output.c -@@ -51,7 +51,7 @@ int sysctl_tcp_retrans_collapse __read_mostly = 1; - int sysctl_tcp_workaround_signed_windows __read_mostly = 0; - - /* Default TSQ limit of two TSO segments */ --int sysctl_tcp_limit_output_bytes __read_mostly = 131072; -+int sysctl_tcp_limit_output_bytes __read_mostly = 4194304; - - /* This limits the percentage of the congestion window which we - * will allow a single TSO frame to consume. Building TSO frames diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux_dvb_adapter.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux_dvb_adapter.patch deleted file mode 100644 index e298f2b..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/linux_dvb_adapter.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c -index 983db75..1a7aa58 100644 ---- a/drivers/media/dvb-core/dvbdev.c -+++ b/drivers/media/dvb-core/dvbdev.c -@@ -296,9 +296,9 @@ static int dvbdev_check_free_adapter_num(int num) - return 1; - } - --static int dvbdev_get_free_adapter_num (void) -+static int dvbdev_get_free_adapter_num (int start_num) - { -- int num = 0; -+ int num = start_num; - - while (num < DVB_MAX_ADAPTERS) { - if (dvbdev_check_free_adapter_num(num)) -@@ -316,16 +316,17 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, - { - int i, num; - -+ char *vu_name = strstr(name, "_vuplus_"); - mutex_lock(&dvbdev_register_lock); - - for (i = 0; i < DVB_MAX_ADAPTERS; ++i) { - num = adapter_nums[i]; -- if (num >= 0 && num < DVB_MAX_ADAPTERS) { -+ if (num >= vu_name? 0:1 && num < DVB_MAX_ADAPTERS) { - /* use the one the driver asked for */ - if (dvbdev_check_free_adapter_num(num)) - break; - } else { -- num = dvbdev_get_free_adapter_num(); -+ num = dvbdev_get_free_adapter_num(vu_name? 0:1); - break; - } - num = -1; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch deleted file mode 100644 index b484b6a..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.13.5/rt2800usb_fix_warn_tx_status_timeout_to_dbg.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c -index a81ceb6..4acd4b2 100644 ---- a/drivers/net/wireless/rt2x00/rt2800usb.c -+++ b/drivers/net/wireless/rt2x00/rt2800usb.c -@@ -128,7 +128,7 @@ static inline bool rt2800usb_entry_txstatus_timeout(struct queue_entry *entry) - - tout = time_after(jiffies, entry->last_action + msecs_to_jiffies(100)); - if (unlikely(tout)) -- rt2x00_warn(entry->queue->rt2x00dev, -+ rt2x00_dbg(entry->queue->rt2x00dev, - "TX status timeout for entry %d in queue %d\n", - entry->entry_idx, entry->queue->qid); - return tout; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_3.3.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_3.3.patch deleted file mode 100644 index 006a779..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_3.3.patch +++ /dev/null @@ -1,1749 +0,0 @@ -diff --git a/Makefile b/Makefile -index ff77350..b3d7160 100644 ---- a/Makefile -+++ b/Makefile -@@ -193,7 +193,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ - # Default value for CROSS_COMPILE is not to prefix executables - # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile - export KBUILD_BUILDHOST := $(SUBARCH) --ARCH ?= $(SUBARCH) -+ARCH ?= mips - CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) - - # Architecture as present in compile.h -diff --git a/arch/mips/configs/bcm7346b0_defconfig b/arch/mips/configs/bcm7346b0_defconfig -index 581c8ac..e9b26ce 100644 ---- a/arch/mips/configs/bcm7346b0_defconfig -+++ b/arch/mips/configs/bcm7346b0_defconfig -@@ -1,115 +1,1680 @@ -+# -+# Automatically generated file; DO NOT EDIT. -+# Linux/mips 3.3.6-1.2 Kernel Configuration -+# -+CONFIG_MIPS=y -+ -+# -+# Machine selection -+# -+# CONFIG_MIPS_ALCHEMY is not set -+# CONFIG_AR7 is not set -+# CONFIG_ATH79 is not set -+# CONFIG_BCM47XX is not set -+# CONFIG_BCM63XX is not set - CONFIG_BRCMSTB=y -+# CONFIG_MIPS_COBALT is not set -+# CONFIG_MACH_DECSTATION is not set -+# CONFIG_MACH_JAZZ is not set -+# CONFIG_MACH_JZ4740 is not set -+# CONFIG_LANTIQ is not set -+# CONFIG_LASAT is not set -+# CONFIG_MACH_LOONGSON is not set -+# CONFIG_MIPS_MALTA is not set -+# CONFIG_MIPS_SIM is not set -+# CONFIG_NEC_MARKEINS is not set -+# CONFIG_MACH_VR41XX is not set -+# CONFIG_NXP_STB220 is not set -+# CONFIG_NXP_STB225 is not set -+# CONFIG_PNX8550_JBS is not set -+# CONFIG_PNX8550_STB810 is not set -+# CONFIG_PMC_MSP is not set -+# CONFIG_PMC_YOSEMITE is not set -+# CONFIG_POWERTV is not set -+# CONFIG_SGI_IP22 is not set -+# CONFIG_SGI_IP27 is not set -+# CONFIG_SGI_IP28 is not set -+# CONFIG_SGI_IP32 is not set -+# CONFIG_SIBYTE_CRHINE is not set -+# CONFIG_SIBYTE_CARMEL is not set -+# CONFIG_SIBYTE_CRHONE is not set -+# CONFIG_SIBYTE_RHONE is not set -+# CONFIG_SIBYTE_SWARM is not set -+# CONFIG_SIBYTE_LITTLESUR is not set -+# CONFIG_SIBYTE_SENTOSA is not set -+# CONFIG_SIBYTE_BIGSUR is not set -+# CONFIG_SNI_RM is not set -+# CONFIG_MACH_TX39XX is not set -+# CONFIG_MACH_TX49XX is not set -+# CONFIG_MIKROTIK_RB532 is not set -+# CONFIG_WR_PPMC is not set -+# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set -+# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set -+# CONFIG_NLM_XLR_BOARD is not set -+# CONFIG_NLM_XLP_BOARD is not set -+# CONFIG_ALCHEMY_GPIO_INDIRECT is not set -+ -+# -+# Broadcom STB options -+# -+# CONFIG_BRCM_LEGACY is not set -+# CONFIG_BCM7231B0 is not set -+# CONFIG_BCM7344B0 is not set - CONFIG_BCM7346B0=y -+# CONFIG_BCM7358A0 is not set -+# CONFIG_BCM7360A0 is not set -+# CONFIG_BCM7425B0 is not set -+# CONFIG_BCM7429A0 is not set -+# CONFIG_BCM7429B0 is not set -+# CONFIG_BCM7435A0 is not set -+# CONFIG_BCM7435B0 is not set -+# CONFIG_BCM7552B0 is not set -+# CONFIG_BCM7584A0 is not set -+ -+# -+# Memory map -+# -+CONFIG_BRCM_UPPER_MEMORY=y -+# CONFIG_BRCM_OVERRIDE_RAM_SIZE is not set -+ -+# -+# Onchip peripherals -+# -+CONFIG_BRCM_CONSOLE_DEVICE=0 -+CONFIG_BRCM_FLASH=y -+# CONFIG_BRCM_FIXED_MTD_PARTITIONS is not set -+CONFIG_MTD_BRCMNAND=y -+CONFIG_SPI_BRCMSTB=y -+CONFIG_BCMGENET=y -+ -+# -+# BCMGENET options -+# -+CONFIG_BCMGENET_0_GPHY=y -+# CONFIG_BCMGENET_1_GPHY is not set -+# CONFIG_BCMGENET_RX_DESC_THROTTLE is not set -+CONFIG_BCMGENET_NAPI=y -+# CONFIG_BCMGENET_RX_CSUM is not set -+# CONFIG_BCMGENET_TX_CSUM is not set -+# CONFIG_BCMGENET_DUMP_DATA is not set -+# CONFIG_BCMGENET_DUMP_TRACE is not set -+CONFIG_BRCM_MOCA=y -+CONFIG_BRCM_USB=y -+# CONFIG_BRCM_OVERRIDE_USB is not set -+CONFIG_BRCM_SDIO=y -+CONFIG_BRCM_PM=y -+CONFIG_CSRC_WKTMR=y -+# CONFIG_CSRC_UPG is not set -+ -+# -+# Miscellaneous options -+# -+CONFIG_BRCM_LIBGCC=y -+# CONFIG_BRCM_SCSI_NO_RW10_RETRIES is not set -+CONFIG_BRCM_WLAN_MODULES=y -+# CONFIG_BRCM_DEBUG_OPTIONS is not set -+CONFIG_BRCM_HAS_BMIPS5000=y -+CONFIG_BRCM_HAS_16550=y -+CONFIG_BRCM_HAS_UARTA=y -+CONFIG_BRCM_HAS_UARTB=y -+CONFIG_BRCM_HAS_UARTC=y -+CONFIG_BRCM_UARTA_IS_16550=y -+CONFIG_BRCM_UARTB_IS_16550=y -+CONFIG_BRCM_UARTC_IS_16550=y -+CONFIG_BRCM_GENET_V2=y -+CONFIG_BRCM_GENET_VERSION=2 -+CONFIG_BRCM_HAS_GENET=y -+CONFIG_BRCM_HAS_GENET_0=y -+CONFIG_BRCM_HAS_GENET_1=y -+CONFIG_BRCM_HAS_MOCA=y -+CONFIG_BRCM_HAS_MOCA_11_PLUS=y -+CONFIG_BRCM_MOCA_VERS=0x1102 -+CONFIG_BRCM_MOCA_ON_GENET_1=y -+CONFIG_BRCM_HAS_MOCA_MIDRF=y -+CONFIG_BRCM_HAS_SATA=y -+CONFIG_BRCM_HAS_SATA3=y -+# CONFIG_BRCM_SATA_75MHZ_PLL is not set -+# CONFIG_BRCM_SATA_SINGLE_PORT is not set -+CONFIG_BRCM_HAS_NOR=y -+CONFIG_BRCM_HAS_NAND_MINOR_0=y -+CONFIG_BRCM_HAS_NAND_MAJOR_5=y -+CONFIG_BRCMNAND_MAJOR_VERS=5 -+CONFIG_BRCMNAND_MINOR_VERS=0 -+CONFIG_BRCM_HAS_NAND=y -+CONFIG_BRCM_HAS_SPI=y -+CONFIG_BRCM_HAS_BSPI_V4=y -+CONFIG_BRCM_BSPI_MAJOR_VERS=4 -+CONFIG_BRCM_HAS_WKTMR=y -+CONFIG_BRCM_HAS_SDIO=y -+CONFIG_BRCM_HAS_SDIO_V1=y -+CONFIG_BRCM_ZSCM_L2=y -+CONFIG_BRCM_CPU_DIV=y -+CONFIG_BRCM_HAS_XKS01=y -+CONFIG_BRCM_HAS_XI=y -+CONFIG_BRCM_HAS_UPPER_MEMORY=y -+CONFIG_BRCM_UPPER_768MB=y -+CONFIG_BRCM_HAS_1GB_MEMC0=y -+CONFIG_BRCM_HAS_DIGITAL_DDR_PHY=y -+CONFIG_BRCM_HAS_STANDBY=y -+CONFIG_BRCM_HAS_AON=y -+CONFIG_BRCM_PWR_HANDSHAKE=y -+CONFIG_BRCM_PWR_HANDSHAKE_V1=y -+CONFIG_BRCM_HAS_USB_CAPS=y -+CONFIG_BRCM_MIPS_DEFAULTS=y -+CONFIG_BCM7346=y -+CONFIG_RWSEM_GENERIC_SPINLOCK=y -+# CONFIG_ARCH_HAS_ILOG2_U32 is not set -+# CONFIG_ARCH_HAS_ILOG2_U64 is not set -+CONFIG_GENERIC_HWEIGHT=y -+CONFIG_GENERIC_CALIBRATE_DELAY=y -+CONFIG_GENERIC_CLOCKEVENTS=y -+CONFIG_GENERIC_CMOS_UPDATE=y -+CONFIG_SCHED_OMIT_FRAME_POINTER=y -+CONFIG_BOOT_RAW=y -+CONFIG_CEVT_R4K_LIB=y -+CONFIG_CEVT_R4K=y -+CONFIG_CFE=y -+# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set -+CONFIG_DMA_NONCOHERENT=y -+CONFIG_NEED_DMA_MAP_STATE=y -+CONFIG_SYS_HAS_EARLY_PRINTK=y -+CONFIG_HOTPLUG_CPU=y -+CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y -+# CONFIG_MIPS_MACHINE is not set -+# CONFIG_NO_IOPORT is not set -+# CONFIG_CPU_BIG_ENDIAN is not set - CONFIG_CPU_LITTLE_ENDIAN=y -+CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y -+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y -+CONFIG_IRQ_CPU=y -+CONFIG_SWAP_IO_SPACE=y -+CONFIG_MIPS_L1_CACHE_SHIFT=7 -+ -+# -+# CPU selection -+# -+CONFIG_CPU_BMIPS5000=y -+CONFIG_CPU_BMIPS=y -+CONFIG_SYS_HAS_CPU_BMIPS5000=y -+CONFIG_WEAK_ORDERING=y -+CONFIG_CPU_MIPS32=y -+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y -+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -+ -+# -+# Kernel type -+# -+CONFIG_32BIT=y -+CONFIG_PAGE_SIZE_4KB=y -+# CONFIG_PAGE_SIZE_16KB is not set -+# CONFIG_PAGE_SIZE_64KB is not set -+CONFIG_FORCE_MAX_ZONEORDER=11 -+CONFIG_BOARD_SCACHE=y -+CONFIG_MIPS_CPU_SCACHE=y -+CONFIG_MIPS_MT_DISABLED=y -+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -+CONFIG_XKS01=y -+CONFIG_CPU_HAS_SYNC=y -+# CONFIG_HIGHMEM is not set -+CONFIG_CPU_SUPPORTS_HIGHMEM=y -+CONFIG_SYS_SUPPORTS_HIGHMEM=y -+CONFIG_ARCH_FLATMEM_ENABLE=y -+CONFIG_ARCH_SPARSEMEM_ENABLE=y -+CONFIG_SELECT_MEMORY_MODEL=y -+CONFIG_FLATMEM_MANUAL=y -+# CONFIG_SPARSEMEM_MANUAL is not set -+CONFIG_FLATMEM=y -+CONFIG_FLAT_NODE_MEM_MAP=y -+CONFIG_SPARSEMEM_STATIC=y -+CONFIG_HAVE_MEMBLOCK=y -+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y -+CONFIG_ARCH_DISCARD_MEMBLOCK=y -+CONFIG_PAGEFLAGS_EXTENDED=y -+CONFIG_SPLIT_PTLOCK_CPUS=4 -+# CONFIG_COMPACTION is not set -+# CONFIG_PHYS_ADDR_T_64BIT is not set -+CONFIG_ZONE_DMA_FLAG=0 -+CONFIG_VIRT_TO_BUS=y -+# CONFIG_KSM is not set -+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -+# CONFIG_CLEANCACHE is not set - CONFIG_SMP=y -+CONFIG_SYS_SUPPORTS_SMP=y - CONFIG_NR_CPUS=2 -+CONFIG_TICK_ONESHOT=y - CONFIG_NO_HZ=y - CONFIG_HIGH_RES_TIMERS=y -+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -+# CONFIG_HZ_48 is not set -+# CONFIG_HZ_100 is not set -+# CONFIG_HZ_128 is not set -+# CONFIG_HZ_250 is not set -+# CONFIG_HZ_256 is not set - CONFIG_HZ_1000=y -+# CONFIG_HZ_1024 is not set -+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y -+CONFIG_HZ=1000 -+CONFIG_PREEMPT_NONE=y -+# CONFIG_PREEMPT_VOLUNTARY is not set -+# CONFIG_PREEMPT is not set -+# CONFIG_KEXEC is not set - # CONFIG_SECCOMP is not set -+# CONFIG_USE_OF is not set -+CONFIG_LOCKDEP_SUPPORT=y -+CONFIG_STACKTRACE_SUPPORT=y -+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -+CONFIG_HAVE_IRQ_WORK=y -+ -+# -+# General setup -+# - CONFIG_EXPERIMENTAL=y -+CONFIG_INIT_ENV_ARG_LIMIT=32 -+CONFIG_CROSS_COMPILE="" -+CONFIG_LOCALVERSION="" -+CONFIG_LOCALVERSION_AUTO=y -+CONFIG_DEFAULT_HOSTNAME="(none)" -+CONFIG_SWAP=y - CONFIG_SYSVIPC=y -+CONFIG_SYSVIPC_SYSCTL=y - CONFIG_POSIX_MQUEUE=y -+CONFIG_POSIX_MQUEUE_SYSCTL=y -+# CONFIG_BSD_PROCESS_ACCT is not set -+# CONFIG_FHANDLE is not set -+# CONFIG_TASKSTATS is not set -+# CONFIG_AUDIT is not set -+CONFIG_HAVE_GENERIC_HARDIRQS=y -+ -+# -+# IRQ subsystem -+# -+CONFIG_GENERIC_HARDIRQS=y -+CONFIG_GENERIC_IRQ_PROBE=y -+CONFIG_GENERIC_IRQ_SHOW=y -+CONFIG_IRQ_FORCED_THREADING=y -+ -+# -+# RCU Subsystem -+# -+CONFIG_TREE_RCU=y -+# CONFIG_PREEMPT_RCU is not set -+# CONFIG_RCU_TRACE is not set -+CONFIG_RCU_FANOUT=32 -+# CONFIG_RCU_FANOUT_EXACT is not set -+# CONFIG_RCU_FAST_NO_HZ is not set -+# CONFIG_TREE_RCU_TRACE is not set -+# CONFIG_IKCONFIG is not set - CONFIG_LOG_BUF_SHIFT=14 -+# CONFIG_CGROUPS is not set -+# CONFIG_CHECKPOINT_RESTORE is not set -+# CONFIG_NAMESPACES is not set -+# CONFIG_SCHED_AUTOGROUP is not set - CONFIG_SYSFS_DEPRECATED=y - CONFIG_SYSFS_DEPRECATED_V2=y - CONFIG_RELAY=y - CONFIG_BLK_DEV_INITRD=y -+CONFIG_INITRAMFS_SOURCE="" -+CONFIG_RD_GZIP=y -+# CONFIG_RD_BZIP2 is not set -+# CONFIG_RD_LZMA is not set -+# CONFIG_RD_XZ is not set -+# CONFIG_RD_LZO is not set -+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set -+CONFIG_SYSCTL=y -+CONFIG_ANON_INODES=y -+CONFIG_EXPERT=y -+# CONFIG_SYSCTL_SYSCALL is not set -+CONFIG_KALLSYMS=y -+# CONFIG_KALLSYMS_ALL is not set -+CONFIG_HOTPLUG=y -+CONFIG_PRINTK=y -+CONFIG_BUG=y -+CONFIG_ELF_CORE=y -+CONFIG_BASE_FULL=y -+CONFIG_FUTEX=y -+CONFIG_EPOLL=y -+CONFIG_SIGNALFD=y -+CONFIG_TIMERFD=y -+CONFIG_EVENTFD=y -+CONFIG_SHMEM=y -+CONFIG_AIO=y - CONFIG_EMBEDDED=y -+CONFIG_HAVE_PERF_EVENTS=y -+CONFIG_PERF_USE_VMALLOC=y -+ -+# -+# Kernel Performance Events And Counters -+# -+# CONFIG_PERF_EVENTS is not set -+# CONFIG_PERF_COUNTERS is not set -+CONFIG_VM_EVENT_COUNTERS=y -+CONFIG_COMPAT_BRK=y - CONFIG_SLAB=y -+# CONFIG_SLUB is not set -+# CONFIG_SLOB is not set -+# CONFIG_PROFILING is not set -+CONFIG_HAVE_OPROFILE=y -+# CONFIG_KPROBES is not set -+# CONFIG_JUMP_LABEL is not set -+CONFIG_HAVE_KPROBES=y -+CONFIG_HAVE_KRETPROBES=y -+CONFIG_HAVE_DMA_ATTRS=y -+CONFIG_USE_GENERIC_SMP_HELPERS=y -+CONFIG_HAVE_DMA_API_DEBUG=y -+CONFIG_HAVE_ARCH_JUMP_LABEL=y -+ -+# -+# GCOV-based kernel profiling -+# -+# CONFIG_GCOV_KERNEL is not set -+CONFIG_HAVE_GENERIC_DMA_COHERENT=y -+CONFIG_SLABINFO=y -+CONFIG_RT_MUTEXES=y -+CONFIG_BASE_SMALL=0 - CONFIG_MODULES=y - CONFIG_MODULE_FORCE_LOAD=y - CONFIG_MODULE_UNLOAD=y -+# CONFIG_MODULE_FORCE_UNLOAD is not set - CONFIG_MODVERSIONS=y -+# CONFIG_MODULE_SRCVERSION_ALL is not set -+CONFIG_STOP_MACHINE=y -+CONFIG_BLOCK=y -+CONFIG_LBDAF=y - # CONFIG_BLK_DEV_BSG is not set -+# CONFIG_BLK_DEV_BSGLIB is not set -+# CONFIG_BLK_DEV_INTEGRITY is not set -+ -+# -+# Partition Types -+# - CONFIG_PARTITION_ADVANCED=y -+# CONFIG_ACORN_PARTITION is not set -+# CONFIG_OSF_PARTITION is not set -+# CONFIG_AMIGA_PARTITION is not set -+# CONFIG_ATARI_PARTITION is not set -+# CONFIG_MAC_PARTITION is not set -+CONFIG_MSDOS_PARTITION=y -+# CONFIG_BSD_DISKLABEL is not set -+# CONFIG_MINIX_SUBPARTITION is not set -+# CONFIG_SOLARIS_X86_PARTITION is not set -+# CONFIG_UNIXWARE_DISKLABEL is not set -+# CONFIG_LDM_PARTITION is not set -+# CONFIG_SGI_PARTITION is not set -+# CONFIG_ULTRIX_PARTITION is not set -+# CONFIG_SUN_PARTITION is not set -+# CONFIG_KARMA_PARTITION is not set - CONFIG_EFI_PARTITION=y -+# CONFIG_SYSV68_PARTITION is not set -+ -+# -+# IO Schedulers -+# -+CONFIG_IOSCHED_NOOP=y - # CONFIG_IOSCHED_DEADLINE is not set -+CONFIG_IOSCHED_CFQ=y -+CONFIG_DEFAULT_CFQ=y -+# CONFIG_DEFAULT_NOOP is not set -+CONFIG_DEFAULT_IOSCHED="cfq" -+# CONFIG_INLINE_SPIN_TRYLOCK is not set -+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -+# CONFIG_INLINE_SPIN_LOCK is not set -+# CONFIG_INLINE_SPIN_LOCK_BH is not set -+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -+CONFIG_INLINE_SPIN_UNLOCK=y -+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set -+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -+# CONFIG_INLINE_READ_TRYLOCK is not set -+# CONFIG_INLINE_READ_LOCK is not set -+# CONFIG_INLINE_READ_LOCK_BH is not set -+# CONFIG_INLINE_READ_LOCK_IRQ is not set -+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -+CONFIG_INLINE_READ_UNLOCK=y -+# CONFIG_INLINE_READ_UNLOCK_BH is not set -+CONFIG_INLINE_READ_UNLOCK_IRQ=y -+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -+# CONFIG_INLINE_WRITE_TRYLOCK is not set -+# CONFIG_INLINE_WRITE_LOCK is not set -+# CONFIG_INLINE_WRITE_LOCK_BH is not set -+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -+CONFIG_INLINE_WRITE_UNLOCK=y -+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set -+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set -+CONFIG_MUTEX_SPIN_ON_OWNER=y -+CONFIG_FREEZER=y -+ -+# -+# Bus options (PCI, PCMCIA, EISA, ISA, TC) -+# -+# CONFIG_ARCH_SUPPORTS_MSI is not set -+CONFIG_MMU=y -+# CONFIG_PCCARD is not set -+ -+# -+# Executable file formats -+# -+CONFIG_BINFMT_ELF=y -+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -+# CONFIG_HAVE_AOUT is not set -+# CONFIG_BINFMT_MISC is not set -+CONFIG_TRAD_SIGNALS=y -+ -+# -+# Power management options -+# -+CONFIG_ARCH_HIBERNATION_POSSIBLE=y -+CONFIG_ARCH_SUSPEND_POSSIBLE=y -+CONFIG_SUSPEND=y -+CONFIG_SUSPEND_FREEZER=y -+# CONFIG_HIBERNATION is not set -+CONFIG_PM_SLEEP=y -+CONFIG_PM_SLEEP_SMP=y - CONFIG_PM_RUNTIME=y -+CONFIG_PM=y -+# CONFIG_PM_DEBUG is not set - CONFIG_NET=y -+ -+# -+# Networking options -+# - CONFIG_PACKET=y - CONFIG_UNIX=y -+# CONFIG_UNIX_DIAG is not set -+# CONFIG_NET_KEY is not set - CONFIG_INET=y - CONFIG_IP_MULTICAST=y -+# CONFIG_IP_ADVANCED_ROUTER is not set - CONFIG_IP_PNP=y - CONFIG_IP_PNP_DHCP=y - CONFIG_IP_PNP_BOOTP=y - CONFIG_IP_PNP_RARP=y -+# CONFIG_NET_IPIP is not set -+# CONFIG_NET_IPGRE_DEMUX is not set -+# CONFIG_IP_MROUTE is not set -+# CONFIG_ARPD is not set -+# CONFIG_SYN_COOKIES is not set -+# CONFIG_INET_AH is not set -+# CONFIG_INET_ESP is not set -+# CONFIG_INET_IPCOMP is not set -+# CONFIG_INET_XFRM_TUNNEL is not set -+# CONFIG_INET_TUNNEL is not set - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set - # CONFIG_INET_XFRM_MODE_TUNNEL is not set - # CONFIG_INET_XFRM_MODE_BEET is not set - # CONFIG_INET_LRO is not set -+CONFIG_INET_DIAG=y -+CONFIG_INET_TCP_DIAG=y -+# CONFIG_INET_UDP_DIAG is not set -+# CONFIG_TCP_CONG_ADVANCED is not set -+CONFIG_TCP_CONG_CUBIC=y -+CONFIG_DEFAULT_TCP_CONG="cubic" -+# CONFIG_TCP_MD5SIG is not set - # CONFIG_IPV6 is not set -+# CONFIG_NETWORK_SECMARK is not set -+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -+# CONFIG_NETFILTER is not set -+# CONFIG_IP_DCCP is not set -+# CONFIG_IP_SCTP is not set -+# CONFIG_RDS is not set -+# CONFIG_TIPC is not set -+# CONFIG_ATM is not set -+# CONFIG_L2TP is not set -+CONFIG_STP=y - CONFIG_BRIDGE=y -+CONFIG_BRIDGE_IGMP_SNOOPING=y -+# CONFIG_NET_DSA is not set -+# CONFIG_VLAN_8021Q is not set -+# CONFIG_DECNET is not set -+CONFIG_LLC=y -+# CONFIG_LLC2 is not set -+# CONFIG_IPX is not set -+# CONFIG_ATALK is not set -+# CONFIG_X25 is not set -+# CONFIG_LAPB is not set -+# CONFIG_ECONET is not set -+# CONFIG_WAN_ROUTER is not set -+# CONFIG_PHONET is not set -+# CONFIG_IEEE802154 is not set -+# CONFIG_NET_SCHED is not set -+# CONFIG_DCB is not set -+# CONFIG_BATMAN_ADV is not set -+# CONFIG_OPENVSWITCH is not set -+CONFIG_RPS=y -+CONFIG_RFS_ACCEL=y -+CONFIG_XPS=y -+CONFIG_BQL=y -+ -+# -+# Network testing -+# -+# CONFIG_NET_PKTGEN is not set -+# CONFIG_HAMRADIO is not set -+# CONFIG_CAN is not set -+# CONFIG_IRDA is not set -+# CONFIG_BT is not set -+# CONFIG_AF_RXRPC is not set -+CONFIG_WIRELESS=y -+CONFIG_WIRELESS_EXT=y -+CONFIG_WEXT_CORE=y -+CONFIG_WEXT_PROC=y -+CONFIG_WEXT_PRIV=y -+# CONFIG_CFG80211 is not set -+# CONFIG_WIRELESS_EXT_SYSFS is not set -+# CONFIG_LIB80211 is not set -+ -+# -+# CFG80211 needs to be enabled for MAC80211 -+# -+# CONFIG_WIMAX is not set -+# CONFIG_RFKILL is not set -+# CONFIG_NET_9P is not set -+# CONFIG_CAIF is not set -+# CONFIG_CEPH_LIB is not set -+# CONFIG_NFC is not set -+ -+# -+# Device Drivers -+# -+ -+# -+# Generic Driver Options -+# - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -+# CONFIG_DEVTMPFS is not set -+CONFIG_STANDALONE=y -+CONFIG_PREVENT_FIRMWARE_BUILD=y -+CONFIG_FW_LOADER=y -+CONFIG_FIRMWARE_IN_KERNEL=y -+CONFIG_EXTRA_FIRMWARE="" -+# CONFIG_DEBUG_DRIVER is not set -+# CONFIG_DEBUG_DEVRES is not set -+# CONFIG_SYS_HYPERVISOR is not set -+# CONFIG_GENERIC_CPU_DEVICES is not set -+# CONFIG_DMA_SHARED_BUFFER is not set -+# CONFIG_CONNECTOR is not set - CONFIG_MTD=y -+# CONFIG_MTD_TESTS is not set -+# CONFIG_MTD_REDBOOT_PARTS is not set - CONFIG_MTD_CMDLINE_PARTS=y -+# CONFIG_MTD_AR7_PARTS is not set -+ -+# -+# User Modules And Translation Layers -+# - CONFIG_MTD_CHAR=y -+CONFIG_MTD_BLKDEVS=y - CONFIG_MTD_BLOCK=y -+# CONFIG_FTL is not set -+# CONFIG_NFTL is not set -+# CONFIG_INFTL is not set -+# CONFIG_RFD_FTL is not set -+# CONFIG_SSFDC is not set -+# CONFIG_SM_FTL is not set -+# CONFIG_MTD_OOPS is not set -+# CONFIG_MTD_SWAP is not set -+ -+# -+# RAM/ROM/Flash chip drivers -+# - CONFIG_MTD_CFI=y - CONFIG_MTD_JEDECPROBE=y -+CONFIG_MTD_GEN_PROBE=y -+# CONFIG_MTD_CFI_ADV_OPTIONS is not set -+CONFIG_MTD_MAP_BANK_WIDTH_1=y -+CONFIG_MTD_MAP_BANK_WIDTH_2=y -+CONFIG_MTD_MAP_BANK_WIDTH_4=y -+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set -+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set -+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set -+CONFIG_MTD_CFI_I1=y -+CONFIG_MTD_CFI_I2=y -+# CONFIG_MTD_CFI_I4 is not set -+# CONFIG_MTD_CFI_I8 is not set - CONFIG_MTD_CFI_INTELEXT=y - CONFIG_MTD_CFI_AMDSTD=y - CONFIG_MTD_CFI_STAA=y -+CONFIG_MTD_CFI_UTIL=y -+# CONFIG_MTD_RAM is not set - CONFIG_MTD_ROM=y - CONFIG_MTD_ABSENT=y -+ -+# -+# Mapping drivers for chip access -+# -+# CONFIG_MTD_COMPLEX_MAPPINGS is not set - CONFIG_MTD_PHYSMAP=y -+# CONFIG_MTD_PHYSMAP_COMPAT is not set -+# CONFIG_MTD_PLATRAM is not set -+ -+# -+# Self-contained MTD device drivers -+# -+# CONFIG_MTD_DATAFLASH is not set - CONFIG_MTD_M25P80=y -+CONFIG_M25PXX_USE_FAST_READ=y -+# CONFIG_MTD_SST25L is not set -+# CONFIG_MTD_SLRAM is not set -+# CONFIG_MTD_PHRAM is not set -+# CONFIG_MTD_MTDRAM is not set -+# CONFIG_MTD_BLOCK2MTD is not set -+ -+# -+# Disk-On-Chip Device Drivers -+# -+# CONFIG_MTD_DOC2000 is not set -+# CONFIG_MTD_DOC2001 is not set -+# CONFIG_MTD_DOC2001PLUS is not set -+# CONFIG_MTD_DOCG3 is not set -+CONFIG_MTD_NAND_ECC=y -+# CONFIG_MTD_NAND_ECC_SMC is not set - CONFIG_MTD_NAND=y -+# CONFIG_MTD_NAND_VERIFY_WRITE is not set -+# CONFIG_MTD_NAND_ECC_BCH is not set -+# CONFIG_MTD_SM_COMMON is not set -+# CONFIG_MTD_NAND_MUSEUM_IDS is not set -+CONFIG_MTD_NAND_IDS=y -+# CONFIG_MTD_NAND_DISKONCHIP is not set -+# CONFIG_MTD_NAND_NANDSIM is not set -+# CONFIG_MTD_NAND_PLATFORM is not set -+# CONFIG_MTD_ALAUDA is not set -+# CONFIG_MTD_ONENAND is not set -+ -+# -+# LPDDR flash memory drivers -+# -+# CONFIG_MTD_LPDDR is not set - CONFIG_MTD_UBI=y -+CONFIG_MTD_UBI_WL_THRESHOLD=4096 -+CONFIG_MTD_UBI_BEB_RESERVE=1 - CONFIG_MTD_UBI_GLUEBI=y -+# CONFIG_MTD_UBI_DEBUG is not set -+# CONFIG_PARPORT is not set -+CONFIG_BLK_DEV=y -+# CONFIG_BLK_DEV_COW_COMMON is not set - CONFIG_BLK_DEV_LOOP=y -+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -+# CONFIG_BLK_DEV_CRYPTOLOOP is not set -+ -+# -+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected -+# -+# CONFIG_BLK_DEV_NBD is not set -+# CONFIG_BLK_DEV_UB is not set - CONFIG_BLK_DEV_RAM=y -+CONFIG_BLK_DEV_RAM_COUNT=16 -+CONFIG_BLK_DEV_RAM_SIZE=4096 -+# CONFIG_BLK_DEV_XIP is not set -+# CONFIG_CDROM_PKTCDVD is not set -+# CONFIG_ATA_OVER_ETH is not set -+# CONFIG_BLK_DEV_HD is not set -+# CONFIG_BLK_DEV_RBD is not set -+ -+# -+# Misc devices -+# -+# CONFIG_SENSORS_LIS3LV02D is not set -+# CONFIG_AD525X_DPOT is not set -+# CONFIG_ENCLOSURE_SERVICES is not set -+# CONFIG_TI_DAC7512 is not set -+# CONFIG_C2PORT is not set -+ -+# -+# EEPROM support -+# -+# CONFIG_EEPROM_AT25 is not set -+# CONFIG_EEPROM_93CX6 is not set -+# CONFIG_EEPROM_93XX46 is not set -+# CONFIG_IWMC3200TOP is not set -+ -+# -+# Texas Instruments shared transport line discipline -+# -+# CONFIG_SENSORS_LIS3_SPI is not set -+ -+# -+# Altera FPGA firmware download module -+# -+CONFIG_HAVE_IDE=y -+# CONFIG_IDE is not set -+ -+# -+# SCSI device support -+# -+CONFIG_SCSI_MOD=y -+# CONFIG_RAID_ATTRS is not set -+CONFIG_SCSI=y -+CONFIG_SCSI_DMA=y -+# CONFIG_SCSI_TGT is not set -+# CONFIG_SCSI_NETLINK is not set -+CONFIG_SCSI_PROC_FS=y -+ -+# -+# SCSI support type (disk, tape, CD-ROM) -+# - CONFIG_BLK_DEV_SD=y -+# CONFIG_CHR_DEV_ST is not set -+# CONFIG_CHR_DEV_OSST is not set - CONFIG_BLK_DEV_SR=y -+# CONFIG_BLK_DEV_SR_VENDOR is not set - CONFIG_CHR_DEV_SG=y -+# CONFIG_CHR_DEV_SCH is not set -+# CONFIG_SCSI_MULTI_LUN is not set -+# CONFIG_SCSI_CONSTANTS is not set -+# CONFIG_SCSI_LOGGING is not set -+# CONFIG_SCSI_SCAN_ASYNC is not set -+CONFIG_SCSI_WAIT_SCAN=m -+ -+# -+# SCSI Transports -+# -+# CONFIG_SCSI_SPI_ATTRS is not set -+# CONFIG_SCSI_FC_ATTRS is not set -+# CONFIG_SCSI_ISCSI_ATTRS is not set -+# CONFIG_SCSI_SAS_ATTRS is not set -+# CONFIG_SCSI_SAS_LIBSAS is not set -+# CONFIG_SCSI_SRP_ATTRS is not set -+CONFIG_SCSI_LOWLEVEL=y -+# CONFIG_ISCSI_TCP is not set -+# CONFIG_ISCSI_BOOT_SYSFS is not set -+# CONFIG_LIBFC is not set -+# CONFIG_LIBFCOE is not set -+# CONFIG_SCSI_DEBUG is not set -+# CONFIG_SCSI_DH is not set -+# CONFIG_SCSI_OSD_INITIATOR is not set - CONFIG_ATA=y -+# CONFIG_ATA_NONSTANDARD is not set -+CONFIG_ATA_VERBOSE_ERROR=y -+CONFIG_SATA_PMP=y -+ -+# -+# Controllers with non-SFF native interface -+# -+CONFIG_SATA_AHCI_PLATFORM=y -+CONFIG_ATA_SFF=y -+ -+# -+# SFF controllers with custom DMA interface -+# -+CONFIG_ATA_BMDMA=y -+ -+# -+# SATA SFF controllers with BMDMA -+# -+# CONFIG_SATA_MV is not set -+ -+# -+# PATA SFF controllers with BMDMA -+# -+ -+# -+# PIO-only SFF controllers -+# -+# CONFIG_PATA_PLATFORM is not set -+ -+# -+# Generic fallback / legacy drivers -+# -+# CONFIG_MD is not set -+# CONFIG_TARGET_CORE is not set - CONFIG_NETDEVICES=y -+CONFIG_NET_CORE=y -+# CONFIG_BONDING is not set -+# CONFIG_DUMMY is not set -+# CONFIG_EQUALIZER is not set -+CONFIG_MII=y -+# CONFIG_NET_TEAM is not set -+# CONFIG_MACVLAN is not set -+# CONFIG_NETCONSOLE is not set -+# CONFIG_NETPOLL is not set -+# CONFIG_NET_POLL_CONTROLLER is not set -+# CONFIG_TUN is not set -+# CONFIG_VETH is not set -+ -+# -+# CAIF transport drivers -+# -+CONFIG_ETHERNET=y -+CONFIG_NET_VENDOR_BROADCOM=y -+# CONFIG_B44 is not set -+# CONFIG_NET_CALXEDA_XGMAC is not set -+CONFIG_NET_VENDOR_CHELSIO=y -+# CONFIG_DM9000 is not set -+# CONFIG_DNET is not set -+CONFIG_NET_VENDOR_INTEL=y -+CONFIG_NET_VENDOR_I825XX=y -+CONFIG_NET_VENDOR_MARVELL=y -+CONFIG_NET_VENDOR_MICREL=y -+# CONFIG_KS8851 is not set -+# CONFIG_KS8851_MLL is not set -+CONFIG_NET_VENDOR_MICROCHIP=y -+# CONFIG_ENC28J60 is not set -+CONFIG_NET_VENDOR_NATSEMI=y -+CONFIG_NET_VENDOR_8390=y -+# CONFIG_AX88796 is not set -+# CONFIG_ETHOC is not set -+CONFIG_NET_VENDOR_SEEQ=y -+# CONFIG_SEEQ8005 is not set -+CONFIG_NET_VENDOR_SMSC=y -+# CONFIG_SMC91X is not set -+# CONFIG_SMSC911X is not set -+CONFIG_NET_VENDOR_STMICRO=y -+# CONFIG_STMMAC_ETH is not set -+# CONFIG_PHYLIB is not set -+# CONFIG_MICREL_KS8995MA is not set -+# CONFIG_PPP is not set -+# CONFIG_SLIP is not set -+ -+# -+# USB Network Adapters -+# -+# CONFIG_USB_CATC is not set -+# CONFIG_USB_KAWETH is not set - CONFIG_USB_PEGASUS=y -+# CONFIG_USB_RTL8150 is not set - CONFIG_USB_USBNET=y -+CONFIG_USB_NET_AX8817X=y -+CONFIG_USB_NET_CDCETHER=y -+# CONFIG_USB_NET_CDC_EEM is not set -+CONFIG_USB_NET_CDC_NCM=y -+# CONFIG_USB_NET_DM9601 is not set -+# CONFIG_USB_NET_SMSC75XX is not set -+# CONFIG_USB_NET_SMSC95XX is not set -+# CONFIG_USB_NET_GL620A is not set -+CONFIG_USB_NET_NET1080=y -+# CONFIG_USB_NET_PLUSB is not set -+# CONFIG_USB_NET_MCS7830 is not set -+# CONFIG_USB_NET_RNDIS_HOST is not set -+CONFIG_USB_NET_CDC_SUBSET=y -+# CONFIG_USB_ALI_M5632 is not set -+# CONFIG_USB_AN2720 is not set -+CONFIG_USB_BELKIN=y -+CONFIG_USB_ARMLINUX=y -+# CONFIG_USB_EPSON2888 is not set -+# CONFIG_USB_KC2190 is not set -+CONFIG_USB_NET_ZAURUS=y -+# CONFIG_USB_NET_CX82310_ETH is not set -+# CONFIG_USB_NET_KALMIA is not set -+# CONFIG_USB_NET_INT51X1 is not set -+# CONFIG_USB_IPHETH is not set -+# CONFIG_USB_SIERRA_NET is not set -+# CONFIG_USB_VL600 is not set -+CONFIG_WLAN=y -+# CONFIG_USB_ZD1201 is not set -+# CONFIG_HOSTAP is not set -+ -+# -+# Enable WiMAX (Networking options) to see the WiMAX drivers -+# -+# CONFIG_WAN is not set -+# CONFIG_ISDN is not set -+# CONFIG_PHONE is not set -+ -+# -+# Input device support -+# -+CONFIG_INPUT=y -+# CONFIG_INPUT_FF_MEMLESS is not set -+# CONFIG_INPUT_POLLDEV is not set -+# CONFIG_INPUT_SPARSEKMAP is not set -+ -+# -+# Userland interfaces -+# -+CONFIG_INPUT_MOUSEDEV=y - # CONFIG_INPUT_MOUSEDEV_PSAUX is not set -+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -+# CONFIG_INPUT_JOYDEV is not set - CONFIG_INPUT_EVDEV=y -+# CONFIG_INPUT_EVBUG is not set -+ -+# -+# Input Device Drivers -+# - # CONFIG_INPUT_KEYBOARD is not set - # CONFIG_INPUT_MOUSE is not set -+# CONFIG_INPUT_JOYSTICK is not set -+# CONFIG_INPUT_TABLET is not set -+# CONFIG_INPUT_TOUCHSCREEN is not set -+# CONFIG_INPUT_MISC is not set -+ -+# -+# Hardware I/O ports -+# - # CONFIG_SERIO is not set -+# CONFIG_GAMEPORT is not set -+ -+# -+# Character devices -+# -+CONFIG_VT=y - # CONFIG_CONSOLE_TRANSLATIONS is not set - # CONFIG_VT_CONSOLE is not set -+CONFIG_HW_CONSOLE=y -+# CONFIG_VT_HW_CONSOLE_BINDING is not set -+CONFIG_UNIX98_PTYS=y -+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set - # CONFIG_LEGACY_PTYS is not set -+# CONFIG_SERIAL_NONSTANDARD is not set -+# CONFIG_N_GSM is not set -+# CONFIG_TRACE_SINK is not set -+CONFIG_DEVKMEM=y -+ -+# -+# Serial drivers -+# -+CONFIG_SERIAL_8250=y -+CONFIG_SERIAL_8250_CONSOLE=y -+CONFIG_SERIAL_8250_NR_UARTS=4 -+CONFIG_SERIAL_8250_RUNTIME_UARTS=4 -+# CONFIG_SERIAL_8250_EXTENDED is not set -+ -+# -+# Non-8250 serial port support -+# -+# CONFIG_SERIAL_MAX3100 is not set -+# CONFIG_SERIAL_MAX3107 is not set -+CONFIG_SERIAL_CORE=y -+CONFIG_SERIAL_CORE_CONSOLE=y -+# CONFIG_SERIAL_TIMBERDALE is not set -+# CONFIG_SERIAL_ALTERA_JTAGUART is not set -+# CONFIG_SERIAL_ALTERA_UART is not set -+# CONFIG_SERIAL_XILINX_PS_UART is not set -+# CONFIG_TTY_PRINTK is not set -+# CONFIG_IPMI_HANDLER is not set - CONFIG_HW_RANDOM=y -+# CONFIG_HW_RANDOM_TIMERIOMEM is not set -+# CONFIG_R3964 is not set -+# CONFIG_RAW_DRIVER is not set -+# CONFIG_TCG_TPM is not set -+# CONFIG_RAMOOPS is not set -+# CONFIG_I2C is not set - CONFIG_SPI=y -+# CONFIG_SPI_DEBUG is not set -+CONFIG_SPI_MASTER=y -+ -+# -+# SPI Master Controller Drivers -+# -+# CONFIG_SPI_ALTERA is not set -+# CONFIG_SPI_BITBANG is not set -+# CONFIG_SPI_PXA2XX_PCI is not set -+# CONFIG_SPI_XILINX is not set -+# CONFIG_SPI_DESIGNWARE is not set -+ -+# -+# SPI Protocol Masters -+# -+# CONFIG_SPI_SPIDEV is not set -+# CONFIG_SPI_TLE62X0 is not set -+ -+# -+# PPS support -+# -+# CONFIG_PPS is not set -+ -+# -+# PPS generators support -+# -+ -+# -+# PTP clock support -+# -+ -+# -+# Enable Device Drivers -> PPS to see the PTP clock options. -+# -+# CONFIG_W1 is not set -+# CONFIG_POWER_SUPPLY is not set - # CONFIG_HWMON is not set -+# CONFIG_THERMAL is not set -+# CONFIG_WATCHDOG is not set -+CONFIG_SSB_POSSIBLE=y -+ -+# -+# Sonics Silicon Backplane -+# -+# CONFIG_SSB is not set -+CONFIG_BCMA_POSSIBLE=y -+ -+# -+# Broadcom specific AMBA -+# -+# CONFIG_BCMA is not set -+ -+# -+# Multifunction device drivers -+# -+# CONFIG_MFD_CORE is not set -+# CONFIG_MFD_SM501 is not set -+# CONFIG_HTC_PASIC3 is not set -+# CONFIG_MFD_STMPE is not set -+# CONFIG_MFD_TMIO is not set -+# CONFIG_MFD_DA9052_SPI is not set -+# CONFIG_MFD_WM831X_SPI is not set -+# CONFIG_MFD_MC13XXX is not set -+# CONFIG_ABX500_CORE is not set -+# CONFIG_EZX_PCAP is not set -+# CONFIG_REGULATOR is not set -+# CONFIG_MEDIA_SUPPORT is not set -+ -+# -+# Graphics support -+# -+# CONFIG_DRM is not set -+# CONFIG_VGASTATE is not set -+# CONFIG_VIDEO_OUTPUT_CONTROL is not set -+# CONFIG_FB is not set -+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set -+ -+# -+# Console display driver support -+# - # CONFIG_VGA_CONSOLE is not set -+CONFIG_DUMMY_CONSOLE=y -+# CONFIG_SOUND is not set -+CONFIG_HID_SUPPORT=y -+CONFIG_HID=y -+# CONFIG_HIDRAW is not set -+ -+# -+# USB Input Devices -+# -+CONFIG_USB_HID=y -+# CONFIG_HID_PID is not set -+# CONFIG_USB_HIDDEV is not set -+ -+# -+# Special HID drivers -+# -+# CONFIG_HID_A4TECH is not set -+# CONFIG_HID_ACRUX is not set -+# CONFIG_HID_APPLE is not set -+# CONFIG_HID_BELKIN is not set -+# CONFIG_HID_CHERRY is not set -+# CONFIG_HID_CHICONY is not set -+# CONFIG_HID_CYPRESS is not set -+# CONFIG_HID_DRAGONRISE is not set -+# CONFIG_HID_EMS_FF is not set -+# CONFIG_HID_EZKEY is not set -+# CONFIG_HID_HOLTEK is not set -+# CONFIG_HID_KEYTOUCH is not set -+# CONFIG_HID_KYE is not set -+# CONFIG_HID_UCLOGIC is not set -+# CONFIG_HID_WALTOP is not set -+# CONFIG_HID_GYRATION is not set -+# CONFIG_HID_TWINHAN is not set -+# CONFIG_HID_KENSINGTON is not set -+# CONFIG_HID_LCPOWER is not set -+# CONFIG_HID_LOGITECH is not set -+# CONFIG_HID_MICROSOFT is not set -+# CONFIG_HID_MONTEREY is not set -+# CONFIG_HID_MULTITOUCH is not set -+# CONFIG_HID_NTRIG is not set -+# CONFIG_HID_ORTEK is not set -+# CONFIG_HID_PANTHERLORD is not set -+# CONFIG_HID_PETALYNX is not set -+# CONFIG_HID_PICOLCD is not set -+# CONFIG_HID_PRIMAX is not set -+# CONFIG_HID_ROCCAT is not set -+# CONFIG_HID_SAMSUNG is not set -+# CONFIG_HID_SONY is not set -+# CONFIG_HID_SPEEDLINK is not set -+# CONFIG_HID_SUNPLUS is not set -+# CONFIG_HID_GREENASIA is not set -+# CONFIG_HID_SMARTJOYPLUS is not set -+# CONFIG_HID_TOPSEED is not set -+# CONFIG_HID_THRUSTMASTER is not set -+# CONFIG_HID_ZEROPLUS is not set -+# CONFIG_HID_ZYDACRON is not set -+CONFIG_USB_SUPPORT=y -+CONFIG_USB_COMMON=y -+CONFIG_USB_ARCH_HAS_HCD=y -+CONFIG_USB_ARCH_HAS_OHCI=y -+CONFIG_USB_ARCH_HAS_EHCI=y -+# CONFIG_USB_ARCH_HAS_XHCI is not set - CONFIG_USB=y -+# CONFIG_USB_DEBUG is not set -+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set -+ -+# -+# Miscellaneous USB options -+# - CONFIG_USB_DEVICEFS=y -+CONFIG_USB_DEVICE_CLASS=y -+# CONFIG_USB_DYNAMIC_MINORS is not set - CONFIG_USB_SUSPEND=y -+# CONFIG_USB_OTG is not set -+# CONFIG_USB_OTG_WHITELIST is not set -+# CONFIG_USB_OTG_BLACKLIST_HUB is not set - CONFIG_USB_MON=y -+# CONFIG_USB_WUSB_CBAF is not set -+ -+# -+# USB Host Controller Drivers -+# -+# CONFIG_USB_C67X00_HCD is not set -+# CONFIG_USB_EHCI_HCD is not set -+# CONFIG_USB_OXU210HP_HCD is not set -+# CONFIG_USB_ISP116X_HCD is not set -+# CONFIG_USB_ISP1760_HCD is not set -+# CONFIG_USB_ISP1362_HCD is not set -+# CONFIG_USB_OHCI_HCD is not set -+# CONFIG_USB_SL811_HCD is not set -+# CONFIG_USB_R8A66597_HCD is not set -+ -+# -+# USB Device Class drivers -+# -+# CONFIG_USB_ACM is not set -+# CONFIG_USB_PRINTER is not set -+# CONFIG_USB_WDM is not set -+# CONFIG_USB_TMC is not set -+ -+# -+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may -+# -+ -+# -+# also be needed; see USB_STORAGE Help for more info -+# - CONFIG_USB_STORAGE=y -+# CONFIG_USB_STORAGE_DEBUG is not set -+# CONFIG_USB_STORAGE_REALTEK is not set -+# CONFIG_USB_STORAGE_DATAFAB is not set -+# CONFIG_USB_STORAGE_FREECOM is not set -+# CONFIG_USB_STORAGE_ISD200 is not set -+# CONFIG_USB_STORAGE_USBAT is not set -+# CONFIG_USB_STORAGE_SDDR09 is not set -+# CONFIG_USB_STORAGE_SDDR55 is not set -+# CONFIG_USB_STORAGE_JUMPSHOT is not set -+# CONFIG_USB_STORAGE_ALAUDA is not set -+# CONFIG_USB_STORAGE_ONETOUCH is not set -+# CONFIG_USB_STORAGE_KARMA is not set -+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set -+# CONFIG_USB_STORAGE_ENE_UB6250 is not set -+# CONFIG_USB_UAS is not set -+# CONFIG_USB_LIBUSUAL is not set -+ -+# -+# USB Imaging devices -+# -+# CONFIG_USB_MDC800 is not set -+# CONFIG_USB_MICROTEK is not set -+ -+# -+# USB port drivers -+# -+# CONFIG_USB_SERIAL is not set -+ -+# -+# USB Miscellaneous drivers -+# -+# CONFIG_USB_EMI62 is not set -+# CONFIG_USB_EMI26 is not set -+# CONFIG_USB_ADUTUX is not set -+# CONFIG_USB_SEVSEG is not set -+# CONFIG_USB_RIO500 is not set -+# CONFIG_USB_LEGOTOWER is not set -+# CONFIG_USB_LCD is not set -+# CONFIG_USB_LED is not set -+# CONFIG_USB_CYPRESS_CY7C63 is not set -+# CONFIG_USB_CYTHERM is not set -+# CONFIG_USB_IDMOUSE is not set -+# CONFIG_USB_FTDI_ELAN is not set -+# CONFIG_USB_APPLEDISPLAY is not set -+# CONFIG_USB_LD is not set -+# CONFIG_USB_TRANCEVIBRATOR is not set -+# CONFIG_USB_IOWARRIOR is not set -+# CONFIG_USB_TEST is not set -+# CONFIG_USB_ISIGHTFW is not set -+# CONFIG_USB_YUREX is not set -+# CONFIG_USB_GADGET is not set -+ -+# -+# OTG and related infrastructure -+# -+# CONFIG_NOP_USB_XCEIV is not set - CONFIG_MMC=y -+# CONFIG_MMC_DEBUG is not set -+# CONFIG_MMC_UNSAFE_RESUME is not set -+# CONFIG_MMC_CLKGATE is not set -+ -+# -+# MMC/SD/SDIO Card Drivers -+# -+CONFIG_MMC_BLOCK=y -+CONFIG_MMC_BLOCK_MINORS=8 -+CONFIG_MMC_BLOCK_BOUNCE=y -+# CONFIG_SDIO_UART is not set -+# CONFIG_MMC_TEST is not set -+ -+# -+# MMC/SD/SDIO Host Controller Drivers -+# - CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_IO_ACCESSORS=y - CONFIG_MMC_SDHCI_PLTFM=y -+# CONFIG_MMC_SPI is not set -+# CONFIG_MMC_VUB300 is not set -+# CONFIG_MMC_USHC is not set -+# CONFIG_MEMSTICK is not set -+# CONFIG_NEW_LEDS is not set -+# CONFIG_ACCESSIBILITY is not set -+CONFIG_RTC_LIB=y -+# CONFIG_RTC_CLASS is not set -+# CONFIG_DMADEVICES is not set -+# CONFIG_AUXDISPLAY is not set -+# CONFIG_UIO is not set -+ -+# -+# Virtio drivers -+# -+# CONFIG_VIRTIO_BALLOON is not set -+# CONFIG_VIRTIO_MMIO is not set -+ -+# -+# Microsoft Hyper-V guest support -+# -+# CONFIG_STAGING is not set -+ -+# -+# Hardware Spinlock drivers -+# -+CONFIG_IOMMU_SUPPORT=y -+# CONFIG_VIRT_DRIVERS is not set -+# CONFIG_PM_DEVFREQ is not set -+ -+# -+# File systems -+# -+# CONFIG_EXT2_FS is not set -+# CONFIG_EXT3_FS is not set - CONFIG_EXT4_FS=y -+CONFIG_EXT4_USE_FOR_EXT23=y - # CONFIG_EXT4_FS_XATTR is not set -+# CONFIG_EXT4_DEBUG is not set -+CONFIG_JBD2=y - CONFIG_JBD2_DEBUG=y -+# CONFIG_REISERFS_FS is not set -+# CONFIG_JFS_FS is not set -+# CONFIG_XFS_FS is not set -+# CONFIG_GFS2_FS is not set -+# CONFIG_BTRFS_FS is not set -+# CONFIG_NILFS2_FS is not set -+# CONFIG_FS_POSIX_ACL is not set -+CONFIG_FILE_LOCKING=y -+CONFIG_FSNOTIFY=y - # CONFIG_DNOTIFY is not set -+CONFIG_INOTIFY_USER=y -+# CONFIG_FANOTIFY is not set -+# CONFIG_QUOTA is not set -+# CONFIG_QUOTACTL is not set -+# CONFIG_AUTOFS4_FS is not set - CONFIG_FUSE_FS=y -+# CONFIG_CUSE is not set -+ -+# -+# Caches -+# -+# CONFIG_FSCACHE is not set -+ -+# -+# CD-ROM/DVD Filesystems -+# - CONFIG_ISO9660_FS=y - CONFIG_JOLIET=y -+# CONFIG_ZISOFS is not set - CONFIG_UDF_FS=y -+CONFIG_UDF_NLS=y -+ -+# -+# DOS/FAT/NT Filesystems -+# -+CONFIG_FAT_FS=y - CONFIG_MSDOS_FS=y - CONFIG_VFAT_FS=y -+CONFIG_FAT_DEFAULT_CODEPAGE=437 -+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" -+# CONFIG_NTFS_FS is not set -+ -+# -+# Pseudo filesystems -+# -+CONFIG_PROC_FS=y - CONFIG_PROC_KCORE=y -+CONFIG_PROC_SYSCTL=y -+CONFIG_PROC_PAGE_MONITOR=y -+CONFIG_SYSFS=y - CONFIG_TMPFS=y -+# CONFIG_TMPFS_POSIX_ACL is not set -+# CONFIG_TMPFS_XATTR is not set -+# CONFIG_HUGETLB_PAGE is not set -+# CONFIG_CONFIGFS_FS is not set -+CONFIG_MISC_FILESYSTEMS=y -+# CONFIG_ADFS_FS is not set -+# CONFIG_AFFS_FS is not set -+# CONFIG_HFS_FS is not set -+# CONFIG_HFSPLUS_FS is not set -+# CONFIG_BEFS_FS is not set -+# CONFIG_BFS_FS is not set -+# CONFIG_EFS_FS is not set - CONFIG_JFFS2_FS=y -+CONFIG_JFFS2_FS_DEBUG=0 -+CONFIG_JFFS2_FS_WRITEBUFFER=y -+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set -+# CONFIG_JFFS2_SUMMARY is not set -+# CONFIG_JFFS2_FS_XATTR is not set -+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set -+CONFIG_JFFS2_ZLIB=y -+# CONFIG_JFFS2_LZO is not set -+CONFIG_JFFS2_RTIME=y -+# CONFIG_JFFS2_RUBIN is not set - CONFIG_UBIFS_FS=y -+# CONFIG_UBIFS_FS_XATTR is not set -+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set -+CONFIG_UBIFS_FS_LZO=y -+CONFIG_UBIFS_FS_ZLIB=y -+# CONFIG_UBIFS_FS_DEBUG is not set -+# CONFIG_LOGFS is not set -+# CONFIG_CRAMFS is not set - CONFIG_SQUASHFS=y -+# CONFIG_SQUASHFS_XATTR is not set -+CONFIG_SQUASHFS_ZLIB=y -+# CONFIG_SQUASHFS_LZO is not set -+# CONFIG_SQUASHFS_XZ is not set -+# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set -+# CONFIG_SQUASHFS_EMBEDDED is not set -+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 -+# CONFIG_VXFS_FS is not set -+# CONFIG_MINIX_FS is not set -+# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set -+# CONFIG_OMFS_FS is not set -+# CONFIG_HPFS_FS is not set -+# CONFIG_QNX4FS_FS is not set -+# CONFIG_ROMFS_FS is not set -+# CONFIG_PSTORE is not set -+# CONFIG_SYSV_FS is not set -+# CONFIG_UFS_FS is not set -+CONFIG_NETWORK_FILESYSTEMS=y - CONFIG_NFS_FS=y - CONFIG_NFS_V3=y -+# CONFIG_NFS_V3_ACL is not set -+# CONFIG_NFS_V4 is not set - CONFIG_ROOT_NFS=y -+# CONFIG_NFSD is not set -+CONFIG_LOCKD=y -+CONFIG_LOCKD_V4=y -+CONFIG_NFS_COMMON=y -+CONFIG_SUNRPC=y -+# CONFIG_CEPH_FS is not set -+# CONFIG_CIFS is not set -+# CONFIG_NCP_FS is not set -+# CONFIG_CODA_FS is not set -+# CONFIG_AFS_FS is not set -+CONFIG_NLS=y -+CONFIG_NLS_DEFAULT="iso8859-1" - CONFIG_NLS_CODEPAGE_437=y -+# CONFIG_NLS_CODEPAGE_737 is not set -+# CONFIG_NLS_CODEPAGE_775 is not set -+# CONFIG_NLS_CODEPAGE_850 is not set -+# CONFIG_NLS_CODEPAGE_852 is not set -+# CONFIG_NLS_CODEPAGE_855 is not set -+# CONFIG_NLS_CODEPAGE_857 is not set -+# CONFIG_NLS_CODEPAGE_860 is not set -+# CONFIG_NLS_CODEPAGE_861 is not set -+# CONFIG_NLS_CODEPAGE_862 is not set -+# CONFIG_NLS_CODEPAGE_863 is not set -+# CONFIG_NLS_CODEPAGE_864 is not set -+# CONFIG_NLS_CODEPAGE_865 is not set -+# CONFIG_NLS_CODEPAGE_866 is not set -+# CONFIG_NLS_CODEPAGE_869 is not set -+# CONFIG_NLS_CODEPAGE_936 is not set -+# CONFIG_NLS_CODEPAGE_950 is not set -+# CONFIG_NLS_CODEPAGE_932 is not set -+# CONFIG_NLS_CODEPAGE_949 is not set -+# CONFIG_NLS_CODEPAGE_874 is not set -+# CONFIG_NLS_ISO8859_8 is not set -+# CONFIG_NLS_CODEPAGE_1250 is not set -+# CONFIG_NLS_CODEPAGE_1251 is not set -+# CONFIG_NLS_ASCII is not set - CONFIG_NLS_ISO8859_1=y -+# CONFIG_NLS_ISO8859_2 is not set -+# CONFIG_NLS_ISO8859_3 is not set -+# CONFIG_NLS_ISO8859_4 is not set -+# CONFIG_NLS_ISO8859_5 is not set -+# CONFIG_NLS_ISO8859_6 is not set -+# CONFIG_NLS_ISO8859_7 is not set -+# CONFIG_NLS_ISO8859_9 is not set -+# CONFIG_NLS_ISO8859_13 is not set -+# CONFIG_NLS_ISO8859_14 is not set -+# CONFIG_NLS_ISO8859_15 is not set -+# CONFIG_NLS_KOI8_R is not set -+# CONFIG_NLS_KOI8_U is not set -+# CONFIG_NLS_UTF8 is not set -+ -+# -+# Kernel hacking -+# -+CONFIG_TRACE_IRQFLAGS_SUPPORT=y -+# CONFIG_PRINTK_TIME is not set -+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 - # CONFIG_ENABLE_WARN_DEPRECATED is not set - # CONFIG_ENABLE_MUST_CHECK is not set -+CONFIG_FRAME_WARN=1024 -+# CONFIG_MAGIC_SYSRQ is not set -+# CONFIG_STRIP_ASM_SYMS is not set -+# CONFIG_UNUSED_SYMBOLS is not set - CONFIG_DEBUG_FS=y -+# CONFIG_HEADERS_CHECK is not set -+# CONFIG_DEBUG_SECTION_MISMATCH is not set -+CONFIG_DEBUG_KERNEL=y -+# CONFIG_DEBUG_SHIRQ is not set -+# CONFIG_LOCKUP_DETECTOR is not set -+# CONFIG_HARDLOCKUP_DETECTOR is not set -+# CONFIG_DETECT_HUNG_TASK is not set -+CONFIG_SCHED_DEBUG=y -+# CONFIG_SCHEDSTATS is not set -+# CONFIG_TIMER_STATS is not set -+# CONFIG_DEBUG_OBJECTS is not set -+# CONFIG_DEBUG_SLAB is not set -+# CONFIG_DEBUG_KMEMLEAK is not set -+# CONFIG_DEBUG_RT_MUTEXES is not set -+# CONFIG_RT_MUTEX_TESTER is not set -+# CONFIG_DEBUG_SPINLOCK is not set -+# CONFIG_DEBUG_MUTEXES is not set -+# CONFIG_DEBUG_LOCK_ALLOC is not set -+# CONFIG_PROVE_LOCKING is not set -+# CONFIG_SPARSE_RCU_POINTER is not set -+# CONFIG_LOCK_STAT is not set -+# CONFIG_DEBUG_ATOMIC_SLEEP is not set -+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -+# CONFIG_DEBUG_STACK_USAGE is not set -+# CONFIG_DEBUG_KOBJECT is not set -+# CONFIG_DEBUG_INFO is not set -+# CONFIG_DEBUG_VM is not set -+# CONFIG_DEBUG_WRITECOUNT is not set -+# CONFIG_DEBUG_MEMORY_INIT is not set -+# CONFIG_DEBUG_LIST is not set -+# CONFIG_TEST_LIST_SORT is not set -+# CONFIG_DEBUG_SG is not set -+# CONFIG_DEBUG_NOTIFIERS is not set -+# CONFIG_DEBUG_CREDENTIALS is not set -+# CONFIG_BOOT_PRINTK_DELAY is not set -+# CONFIG_RCU_TORTURE_TEST is not set -+CONFIG_RCU_CPU_STALL_TIMEOUT=60 -+# CONFIG_BACKTRACE_SELF_TEST is not set -+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -+# CONFIG_DEBUG_PER_CPU_MAPS is not set -+# CONFIG_LKDTM is not set -+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set -+# CONFIG_FAULT_INJECTION is not set -+# CONFIG_SYSCTL_SYSCALL_CHECK is not set -+# CONFIG_DEBUG_PAGEALLOC is not set -+CONFIG_HAVE_FUNCTION_TRACER=y -+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y -+CONFIG_HAVE_DYNAMIC_FTRACE=y -+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -+CONFIG_HAVE_C_RECORDMCOUNT=y -+CONFIG_TRACING_SUPPORT=y -+CONFIG_FTRACE=y -+# CONFIG_FUNCTION_TRACER is not set -+# CONFIG_IRQSOFF_TRACER is not set -+# CONFIG_SCHED_TRACER is not set -+# CONFIG_ENABLE_DEFAULT_TRACERS is not set -+CONFIG_BRANCH_PROFILE_NONE=y -+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set -+# CONFIG_PROFILE_ALL_BRANCHES is not set -+# CONFIG_STACK_TRACER is not set -+# CONFIG_BLK_DEV_IO_TRACE is not set - CONFIG_DYNAMIC_DEBUG=y -+# CONFIG_DMA_API_DEBUG is not set -+# CONFIG_ATOMIC64_SELFTEST is not set -+# CONFIG_SAMPLES is not set -+CONFIG_HAVE_ARCH_KGDB=y -+# CONFIG_KGDB is not set -+# CONFIG_TEST_KSTRTOX is not set -+CONFIG_EARLY_PRINTK=y -+# CONFIG_CMDLINE_BOOL is not set -+# CONFIG_DEBUG_STACKOVERFLOW is not set -+# CONFIG_RUNTIME_DEBUG is not set -+# CONFIG_SPINLOCK_TEST is not set -+ -+# -+# Security options -+# -+# CONFIG_KEYS is not set -+# CONFIG_SECURITY_DMESG_RESTRICT is not set -+# CONFIG_SECURITY is not set -+# CONFIG_SECURITYFS is not set -+CONFIG_DEFAULT_SECURITY_DAC=y -+CONFIG_DEFAULT_SECURITY="" -+CONFIG_CRYPTO=y -+ -+# -+# Crypto core or helper -+# -+CONFIG_CRYPTO_ALGAPI=y -+CONFIG_CRYPTO_ALGAPI2=y -+# CONFIG_CRYPTO_MANAGER is not set -+# CONFIG_CRYPTO_MANAGER2 is not set -+# CONFIG_CRYPTO_USER is not set -+# CONFIG_CRYPTO_GF128MUL is not set -+# CONFIG_CRYPTO_NULL is not set -+# CONFIG_CRYPTO_PCRYPT is not set -+# CONFIG_CRYPTO_CRYPTD is not set -+# CONFIG_CRYPTO_AUTHENC is not set -+# CONFIG_CRYPTO_TEST is not set -+ -+# -+# Authenticated Encryption with Associated Data -+# -+# CONFIG_CRYPTO_CCM is not set -+# CONFIG_CRYPTO_GCM is not set -+# CONFIG_CRYPTO_SEQIV is not set -+ -+# -+# Block modes -+# -+# CONFIG_CRYPTO_CBC is not set -+# CONFIG_CRYPTO_CTR is not set -+# CONFIG_CRYPTO_CTS is not set -+# CONFIG_CRYPTO_ECB is not set -+# CONFIG_CRYPTO_LRW is not set -+# CONFIG_CRYPTO_PCBC is not set -+# CONFIG_CRYPTO_XTS is not set -+ -+# -+# Hash modes -+# -+# CONFIG_CRYPTO_HMAC is not set -+# CONFIG_CRYPTO_XCBC is not set -+# CONFIG_CRYPTO_VMAC is not set -+ -+# -+# Digest -+# -+# CONFIG_CRYPTO_CRC32C is not set -+# CONFIG_CRYPTO_GHASH is not set -+# CONFIG_CRYPTO_MD4 is not set -+# CONFIG_CRYPTO_MD5 is not set -+# CONFIG_CRYPTO_MICHAEL_MIC is not set -+# CONFIG_CRYPTO_RMD128 is not set -+# CONFIG_CRYPTO_RMD160 is not set -+# CONFIG_CRYPTO_RMD256 is not set -+# CONFIG_CRYPTO_RMD320 is not set -+# CONFIG_CRYPTO_SHA1 is not set -+# CONFIG_CRYPTO_SHA256 is not set -+# CONFIG_CRYPTO_SHA512 is not set -+# CONFIG_CRYPTO_TGR192 is not set -+# CONFIG_CRYPTO_WP512 is not set -+ -+# -+# Ciphers -+# -+# CONFIG_CRYPTO_AES is not set -+# CONFIG_CRYPTO_ANUBIS is not set -+# CONFIG_CRYPTO_ARC4 is not set -+# CONFIG_CRYPTO_BLOWFISH is not set -+# CONFIG_CRYPTO_CAMELLIA is not set -+# CONFIG_CRYPTO_CAST5 is not set -+# CONFIG_CRYPTO_CAST6 is not set -+# CONFIG_CRYPTO_DES is not set -+# CONFIG_CRYPTO_FCRYPT is not set -+# CONFIG_CRYPTO_KHAZAD is not set -+# CONFIG_CRYPTO_SALSA20 is not set -+# CONFIG_CRYPTO_SEED is not set -+# CONFIG_CRYPTO_SERPENT is not set -+# CONFIG_CRYPTO_TEA is not set -+# CONFIG_CRYPTO_TWOFISH is not set -+ -+# -+# Compression -+# -+CONFIG_CRYPTO_DEFLATE=y -+# CONFIG_CRYPTO_ZLIB is not set -+CONFIG_CRYPTO_LZO=y -+ -+# -+# Random Number Generation -+# - # CONFIG_CRYPTO_ANSI_CPRNG is not set -+# CONFIG_CRYPTO_USER_API_HASH is not set -+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -+CONFIG_CRYPTO_HW=y -+# CONFIG_BINARY_PRINTF is not set -+ -+# -+# Library routines -+# -+CONFIG_BITREVERSE=y -+# CONFIG_CRC_CCITT is not set -+CONFIG_CRC16=y -+# CONFIG_CRC_T10DIF is not set -+CONFIG_CRC_ITU_T=y -+CONFIG_CRC32=y -+# CONFIG_CRC7 is not set -+# CONFIG_LIBCRC32C is not set -+# CONFIG_CRC8 is not set -+CONFIG_ZLIB_INFLATE=y -+CONFIG_ZLIB_DEFLATE=y -+CONFIG_LZO_COMPRESS=y -+CONFIG_LZO_DECOMPRESS=y -+# CONFIG_XZ_DEC is not set -+# CONFIG_XZ_DEC_BCJ is not set -+CONFIG_DECOMPRESS_GZIP=y -+CONFIG_HAS_IOMEM=y -+CONFIG_HAS_IOPORT=y -+CONFIG_HAS_DMA=y -+CONFIG_CPU_RMAP=y -+CONFIG_DQL=y -+CONFIG_NLATTR=y -+CONFIG_GENERIC_ATOMIC64=y -+# CONFIG_AVERAGE is not set -+# CONFIG_CORDIC is not set -diff --git a/drivers/brcmstb/bchip.c b/drivers/brcmstb/bchip.c -index e7c8b4a..4ebd5bc 100644 ---- a/drivers/brcmstb/bchip.c -+++ b/drivers/brcmstb/bchip.c -@@ -442,9 +442,14 @@ void __init bchip_early_setup(void) - genet_pdata[0].phy_id = BRCM_PHY_ID_AUTO; - } - #else -+#if defined(CONFIG_BCMGENET_0_GPHY) -+ genet_pdata[0].phy_type = BRCM_PHY_TYPE_EXT_RGMII; -+ genet_pdata[0].phy_id = BRCM_PHY_ID_AUTO; -+#else - genet_pdata[0].phy_type = BRCM_PHY_TYPE_INT; - genet_pdata[0].phy_id = 1; - #endif -+#endif - - #endif - -diff --git a/drivers/net/ethernet/broadcom/genet/Kconfig b/drivers/net/ethernet/broadcom/genet/Kconfig -index c1ed960..4487c79 100644 ---- a/drivers/net/ethernet/broadcom/genet/Kconfig -+++ b/drivers/net/ethernet/broadcom/genet/Kconfig -@@ -1,5 +1,27 @@ - menu "BCMGENET options" - -+config BCMGENET_0_GPHY -+ bool "GENET0 is connected to GPHY via RGMII" -+ depends on BCMGENET && BRCM_HAS_GENET_0 -+ default n -+ help -+ Say Y to use an external GPHY for GENET_0. By default this will -+ use RGMII mode and disable the internal 10/100 PHY (if present); -+ the pinmux must be set up properly in arch/mips/brcmstb/board.c . -+ -+ If unsure, say N. -+ -+config BCMGENET_1_GPHY -+ bool "GENET1 is connected to GPHY via RGMII" -+ depends on BCMGENET && BRCM_HAS_GENET_1 -+ default n -+ help -+ Say Y to use an external GPHY for GENET_1. By default this will -+ use RGMII mode and disable the internal 10/100 PHY (if present); -+ the pinmux must be set up properly in arch/mips/brcmstb/board.c . -+ -+ If unsure, say N. -+ - config BCMGENET_RX_DESC_THROTTLE - bool "use hardware rx descriptor throttling" - depends on BCMGENET diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_mtd_mac.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_mtd_mac.patch deleted file mode 100644 index 3a50eb4..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_mtd_mac.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/arch/mips/brcmstb/prom.c b/arch/mips/brcmstb/prom.c -index 97691d1..995255d 100644 ---- a/arch/mips/brcmstb/prom.c -+++ b/arch/mips/brcmstb/prom.c -@@ -223,6 +223,8 @@ static void __init __maybe_unused cfe_read_configuration(void) - FETCH("LINUX_FFS_SIZE", parse_hex, &brcm_mtd_rootfs_len); - FETCH("LINUX_PART_STARTAD", parse_hex, &brcm_mtd_kernel_start); - FETCH("LINUX_PART_SIZE", parse_hex, &brcm_mtd_kernel_len); -+ FETCH("LINUX_MACADDR_STARTAD", parse_hex, &brcm_mtd_macaddr_start); -+ FETCH("LINUX_MACADDR_SIZE", parse_hex, &brcm_mtd_macaddr_len); - FETCH("OCAP_PART_STARTAD", parse_hex, &brcm_mtd_ocap_start); - FETCH("OCAP_PART_SIZE", parse_hex, &brcm_mtd_ocap_len); - FETCH("FLASH_SIZE", parse_ulong, &brcm_mtd_flash_size_mb); -diff --git a/drivers/brcmstb/board.c b/drivers/brcmstb/board.c -index 936818b..5d2c870 100644 ---- a/drivers/brcmstb/board.c -+++ b/drivers/brcmstb/board.c -@@ -34,6 +34,8 @@ unsigned long brcm_mtd_rootfs_start; - unsigned long brcm_mtd_rootfs_len; - unsigned long brcm_mtd_kernel_start; - unsigned long brcm_mtd_kernel_len; -+unsigned long brcm_mtd_macaddr_start; -+unsigned long brcm_mtd_macaddr_len; - unsigned long brcm_mtd_ocap_start; - unsigned long brcm_mtd_ocap_len; - unsigned long brcm_mtd_flash_size_mb; -@@ -486,6 +488,8 @@ int __init board_get_partition_map(struct mtd_partition **p) - nr_parts = 2; - if (brcm_mtd_kernel_len != 0) - nr_parts++; -+ if (brcm_mtd_macaddr_len != 0) -+ nr_parts++; - - ret = kzalloc(nr_parts * sizeof(struct mtd_partition), GFP_KERNEL); - if (!ret) -@@ -504,6 +508,12 @@ int __init board_get_partition_map(struct mtd_partition **p) - ret[2].size = brcm_mtd_kernel_len; - ret[2].name = "kernel"; - } -+ if (brcm_mtd_macaddr_len != 0) { -+ ret[3].offset = brcm_mtd_macaddr_start; -+ ret[3].size = brcm_mtd_macaddr_len; -+ ret[3].name = "mac"; -+ } -+ - - *p = ret; - return nr_parts; -diff --git a/include/linux/brcmstb/brcmstb.h b/include/linux/brcmstb/brcmstb.h -index ffca523..eb25084 100644 ---- a/include/linux/brcmstb/brcmstb.h -+++ b/include/linux/brcmstb/brcmstb.h -@@ -684,6 +684,8 @@ extern unsigned long brcm_mtd_rootfs_start; - extern unsigned long brcm_mtd_rootfs_len; - extern unsigned long brcm_mtd_kernel_start; - extern unsigned long brcm_mtd_kernel_len; -+extern unsigned long brcm_mtd_macaddr_start; -+extern unsigned long brcm_mtd_macaddr_len; - extern unsigned long brcm_mtd_ocap_start; - extern unsigned long brcm_mtd_ocap_len; - extern unsigned long brcm_mtd_flash_size_mb; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_remove_entire_mtd.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_remove_entire_mtd.patch deleted file mode 100644 index 96ed644..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/brcm_remove_entire_mtd.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/drivers/brcmstb/board.c b/drivers/brcmstb/board.c -index 5d2c870..92d54cc 100644 ---- a/drivers/brcmstb/board.c -+++ b/drivers/brcmstb/board.c -@@ -499,9 +499,9 @@ int __init board_get_partition_map(struct mtd_partition **p) - ret[0].size = brcm_mtd_rootfs_len; - ret[0].name = "rootfs"; - -- ret[1].offset = 0; -- ret[1].size = MTDPART_SIZ_FULL; -- ret[1].name = "entire_device"; -+ ret[1].offset = brcm_mtd_rootfs_start; -+ ret[1].size = brcm_mtd_rootfs_len; -+ ret[1].name = "rootfs(redundant)"; - - if (brcm_mtd_kernel_len != 0) { - ret[2].offset = brcm_mtd_kernel_start; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/dvb_core_5.5.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/dvb_core_5.5.patch deleted file mode 100644 index 71c832c..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/dvb_core_5.5.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c -index e4b5c03..caca6e5 100644 ---- a/drivers/media/dvb/dvb-core/dmxdev.c -+++ b/drivers/media/dvb/dvb-core/dmxdev.c -@@ -81,9 +81,14 @@ static ssize_t dvb_dmxdev_buffer_read(struct dvb_ringbuffer *src, - break; - } - -+ - ret = wait_event_interruptible(src->queue, - !dvb_ringbuffer_empty(src) || -- (src->error != 0)); -+ (src->error != 0) || -+ (src->do_wait != 1)); -+ if (src->do_wait != 1) -+ ret = -EINTR; -+ - if (ret < 0) - break; - -@@ -963,6 +968,22 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, - return ret; - } - -+static int dvb_demux_lock_filter(struct dmxdev_filter *dmxdevfilter) -+{ -+ int ret; -+ -+ dmxdevfilter->buffer.do_wait = 0; -+ -+ if (waitqueue_active(&dmxdevfilter->buffer.queue)) -+ wake_up(&dmxdevfilter->buffer.queue); -+ -+ ret = mutex_lock_interruptible(&dmxdevfilter->mutex); -+ -+ dmxdevfilter->buffer.do_wait = 1; -+ -+ return ret; -+} -+ - static int dvb_demux_do_ioctl(struct file *file, - unsigned int cmd, void *parg) - { -@@ -976,7 +997,7 @@ static int dvb_demux_do_ioctl(struct file *file, - - switch (cmd) { - case DMX_START: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -988,7 +1009,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_STOP: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -997,7 +1018,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_FILTER: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1006,7 +1027,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_PES_FILTER: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1015,7 +1036,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_SET_BUFFER_SIZE: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - mutex_unlock(&dmxdev->mutex); - return -ERESTARTSYS; - } -@@ -1059,7 +1080,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_ADD_PID: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - ret = -ERESTARTSYS; - break; - } -@@ -1068,7 +1089,7 @@ static int dvb_demux_do_ioctl(struct file *file, - break; - - case DMX_REMOVE_PID: -- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) { -+ if (dvb_demux_lock_filter(dmxdevfilter)) { - ret = -ERESTARTSYS; - break; - } -diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -old mode 100644 -new mode 100755 -index a5712cd..9f744c2 ---- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c -@@ -45,7 +45,8 @@ void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len) - rbuf->data=data; - rbuf->size=len; - rbuf->error=0; -- -+ rbuf->do_wait=1; -+ - init_waitqueue_head(&rbuf->queue); - - spin_lock_init(&(rbuf->lock)); -diff --git a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -old mode 100644 -new mode 100755 -index 41f04da..6951dd3 ---- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h -@@ -39,6 +39,7 @@ struct dvb_ringbuffer { - - wait_queue_head_t queue; - spinlock_t lock; -+ int do_wait; - }; - - #define DVB_RINGBUFFER_PKTHDRSIZE 3 diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/fix_cpu_proc.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/fix_cpu_proc.patch deleted file mode 100644 index 3069f1a..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.6/fix_cpu_proc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c -index 58eed1c..a914a75 100644 ---- a/arch/mips/kernel/cpu-probe.c -+++ b/arch/mips/kernel/cpu-probe.c -@@ -956,7 +956,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) - case PRID_IMP_BMIPS5000: - case PRID_IMP_BMIPS5200: - c->cputype = CPU_BMIPS5000; -- __cpu_name[cpu] = "Broadcom BMIPS5000"; -+ __cpu_name[cpu] = "Brcm4380"; - set_elf_platform(cpu, "bmips5000"); - c->options |= MIPS_CPU_ULRI; - break; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/bmips-no-array-bounds.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/bmips-no-array-bounds.patch deleted file mode 100644 index c372fd3..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/bmips-no-array-bounds.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/arch/mips/Makefile b/arch/mips/Makefile -index 4fedf5a..e7f3f34 100644 ---- a/arch/mips/Makefile -+++ b/arch/mips/Makefile -@@ -157,7 +157,7 @@ ifeq (,$(findstring march=octeon, $(cflags-$(CONFIG_CPU_CAVIUM_OCTEON)))) - cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon - endif - cflags-$(CONFIG_CAVIUM_CN63XXP1) += -Wa,-mfix-cn63xxp1 --cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap -+cflags-$(CONFIG_CPU_BMIPS) += -march=mips32 -Wa,-mips32 -Wa,--trap -Wno-array-bounds - - cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) - cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_3.3.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_3.3.patch deleted file mode 100644 index f8a2371..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_3.3.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/Makefile b/Makefile -index 002da9a..03831b6 100644 ---- a/Makefile -+++ b/Makefile -@@ -193,7 +193,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ - # Default value for CROSS_COMPILE is not to prefix executables - # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile - export KBUILD_BUILDHOST := $(SUBARCH) --ARCH ?= $(SUBARCH) -+ARCH ?= mips - CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) - - # Architecture as present in compile.h -diff --git a/drivers/brcmstb/bchip.c b/drivers/brcmstb/bchip.c -index b4c5b0b..4f871cd 100644 ---- a/drivers/brcmstb/bchip.c -+++ b/drivers/brcmstb/bchip.c -@@ -450,9 +450,14 @@ void __init bchip_early_setup(void) - genet_pdata[0].phy_id = BRCM_PHY_ID_AUTO; - } - #else -+#if defined(CONFIG_BCMGENET_0_GPHY) -+ genet_pdata[0].phy_type = BRCM_PHY_TYPE_EXT_RGMII; -+ genet_pdata[0].phy_id = BRCM_PHY_ID_AUTO; -+#else - genet_pdata[0].phy_type = BRCM_PHY_TYPE_INT; - genet_pdata[0].phy_id = 1; - #endif -+#endif - - #endif - -diff --git a/drivers/net/ethernet/broadcom/genet/Kconfig b/drivers/net/ethernet/broadcom/genet/Kconfig -index c1ed960..8e87443 100644 ---- a/drivers/net/ethernet/broadcom/genet/Kconfig -+++ b/drivers/net/ethernet/broadcom/genet/Kconfig -@@ -1,5 +1,27 @@ - menu "BCMGENET options" - -+config BCMGENET_0_GPHY -+ bool "GENET0 is connected to GPHY via RGMII" -+ depends on BCMGENET && BRCM_HAS_GENET_0 -+ default n -+ help -+ Say Y to use an external GPHY for GENET_0. By default this will -+ use RGMII mode and disable the internal 10/100 PHY (if present); -+ the pinmux must be set up properly in arch/mips/brcmstb/board.c . -+ -+ If unsure, say N. -+ -+config BCMGENET_1_GPHY -+ bool "GENET1 is connected to GPHY via RGMII" -+ depends on BCMGENET && BRCM_HAS_GENET_1 -+ default n -+ help -+ Say Y to use an external GPHY for GENET_1. By default this will -+ use RGMII mode and disable the internal 10/100 PHY (if present); -+ the pinmux must be set up properly in arch/mips/brcmstb/board.c . -+ -+ If unsure, say N. -+ - config BCMGENET_RX_DESC_THROTTLE - bool "use hardware rx descriptor throttling" - depends on BCMGENET diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_mtd_mac.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_mtd_mac.patch deleted file mode 100644 index a175212..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/brcm_mtd_mac.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff --git a/arch/mips/brcmstb/prom.c b/arch/mips/brcmstb/prom.c -index c575425..b9dfff2 100644 ---- a/arch/mips/brcmstb/prom.c -+++ b/arch/mips/brcmstb/prom.c -@@ -224,6 +224,8 @@ static void __init __maybe_unused cfe_read_configuration(void) - FETCH("LINUX_FFS_SIZE", parse_hex, &brcm_mtd_rootfs_len); - FETCH("LINUX_PART_STARTAD", parse_hex, &brcm_mtd_kernel_start); - FETCH("LINUX_PART_SIZE", parse_hex, &brcm_mtd_kernel_len); -+ FETCH("LINUX_MACADDR_STARTAD", parse_hex, &brcm_mtd_macaddr_start); -+ FETCH("LINUX_MACADDR_SIZE", parse_hex, &brcm_mtd_macaddr_len); - FETCH("OCAP_PART_STARTAD", parse_hex, &brcm_mtd_ocap_start); - FETCH("OCAP_PART_SIZE", parse_hex, &brcm_mtd_ocap_len); - FETCH("FLASH_SIZE", parse_ulong, &brcm_mtd_flash_size_mb); -diff --git a/drivers/brcmstb/board.c b/drivers/brcmstb/board.c -index 4a823ef..7ae6cd2 100644 ---- a/drivers/brcmstb/board.c -+++ b/drivers/brcmstb/board.c -@@ -34,6 +34,8 @@ unsigned long brcm_mtd_rootfs_start; - unsigned long brcm_mtd_rootfs_len; - unsigned long brcm_mtd_kernel_start; - unsigned long brcm_mtd_kernel_len; -+unsigned long brcm_mtd_macaddr_start; -+unsigned long brcm_mtd_macaddr_len; - unsigned long brcm_mtd_ocap_start; - unsigned long brcm_mtd_ocap_len; - unsigned long brcm_mtd_flash_size_mb; -@@ -535,6 +537,9 @@ int __init board_get_partition_map(struct mtd_partition **p) - nr_parts = 2; - if (brcm_mtd_kernel_len != 0) - nr_parts++; -+ if (brcm_mtd_macaddr_len != 0) -+ nr_parts++; -+ - - ret = kzalloc(nr_parts * sizeof(struct mtd_partition), GFP_KERNEL); - if (!ret) -@@ -544,15 +549,21 @@ int __init board_get_partition_map(struct mtd_partition **p) - ret[0].size = brcm_mtd_rootfs_len; - ret[0].name = "rootfs"; - -- ret[1].offset = 0; -- ret[1].size = MTDPART_SIZ_FULL; -- ret[1].name = "entire_device"; -+ ret[1].offset = brcm_mtd_rootfs_start; -+ ret[1].size = brcm_mtd_rootfs_len; -+ ret[1].name = "rootfs(redundant)"; - - if (brcm_mtd_kernel_len != 0) { - ret[2].offset = brcm_mtd_kernel_start; - ret[2].size = brcm_mtd_kernel_len; - ret[2].name = "kernel"; - } -+ if (brcm_mtd_macaddr_len != 0) { -+ ret[3].offset = brcm_mtd_macaddr_start; -+ ret[3].size = brcm_mtd_macaddr_len; -+ ret[3].name = "mac"; -+ } -+ - - *p = ret; - return nr_parts; -diff --git a/include/linux/brcmstb/brcmstb.h b/include/linux/brcmstb/brcmstb.h -index 9885e59..62b5515 100644 ---- a/include/linux/brcmstb/brcmstb.h -+++ b/include/linux/brcmstb/brcmstb.h -@@ -733,6 +733,8 @@ extern unsigned long brcm_mtd_rootfs_start; - extern unsigned long brcm_mtd_rootfs_len; - extern unsigned long brcm_mtd_kernel_start; - extern unsigned long brcm_mtd_kernel_len; -+extern unsigned long brcm_mtd_macaddr_start; -+extern unsigned long brcm_mtd_macaddr_len; - extern unsigned long brcm_mtd_ocap_start; - extern unsigned long brcm_mtd_ocap_len; - extern unsigned long brcm_mtd_flash_size_mb; diff --git a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/dvb_backport.patch b/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/dvb_backport.patch deleted file mode 100644 index 9082392..0000000 --- a/meta-bsp/common/recipes/linux/linux-vuplus-3.3.8/dvb_backport.patch +++ /dev/null @@ -1,1120888 +0,0 @@ -diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c -index e9c1893..2477aba 100644 ---- a/drivers/i2c/i2c-core.c -+++ b/drivers/i2c/i2c-core.c -@@ -1292,6 +1292,37 @@ module_exit(i2c_exit); - * the functional interface to the i2c busses. - * ---------------------------------------------------- - */ -+/** -+ * __i2c_transfer - unlocked flavor of i2c_transfer -+ * @adap: Handle to I2C bus -+ * @msgs: One or more messages to execute before STOP is issued to -+ * terminate the operation; each message begins with a START. -+ * @num: Number of messages to be executed. -+ * -+ * Returns negative errno, else the number of messages executed. -+ * -+ * Adapter lock must be held when calling this function. No debug logging -+ * takes place. adap->algo->master_xfer existence isn't checked. -+ */ -+int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) -+{ -+ unsigned long orig_jiffies; -+ int ret, try; -+ -+ /* Retry automatically on arbitration loss */ -+ orig_jiffies = jiffies; -+ for (ret = 0, try = 0; try <= adap->retries; try++) { -+ ret = adap->algo->master_xfer(adap, msgs, num); -+ if (ret != -EAGAIN) -+ break; -+ if (time_after(jiffies, orig_jiffies + adap->timeout)) -+ break; -+ } -+ -+ return ret; -+} -+EXPORT_SYMBOL(__i2c_transfer); -+ - - /** - * i2c_transfer - execute a single or combined I2C message -diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig -index 9575db4..84d85b9 100644 ---- a/drivers/media/Kconfig -+++ b/drivers/media/Kconfig -@@ -6,20 +6,82 @@ menuconfig MEDIA_SUPPORT - tristate "Multimedia support" - depends on HAS_IOMEM - help -- If you want to use Video for Linux, DVB for Linux, or DAB adapters, -+ If you want to use Webcams, Video grabber devices and/or TV devices - enable this option and other options below. -+ Additional info and docs are available on the web at -+ - - if MEDIA_SUPPORT - - comment "Multimedia core support" - - # -+# Multimedia support - automatically enable V4L2 and DVB core -+# -+config MEDIA_CAMERA_SUPPORT -+ bool "Cameras/video grabbers support" -+ ---help--- -+ Enable support for webcams and video grabbers. -+ -+ Say Y when you have a webcam or a video capture grabber board. -+ -+config MEDIA_ANALOG_TV_SUPPORT -+ bool "Analog TV support" -+ ---help--- -+ Enable analog TV support. -+ -+ Say Y when you have a TV board with analog support or with a -+ hybrid analog/digital TV chipset. -+ -+ Note: There are several DVB cards that are based on chips that -+ support both analog and digital TV. Disabling this option -+ will disable support for them. -+ -+config MEDIA_DIGITAL_TV_SUPPORT -+ bool "Digital TV support" -+ ---help--- -+ Enable digital TV support. -+ -+ Say Y when you have a board with digital support or a board with -+ hybrid digital TV and analog TV. -+ -+config MEDIA_RADIO_SUPPORT -+ bool "AM/FM radio receivers/transmitters support" -+ ---help--- -+ Enable AM/FM radio support. -+ -+ Additional info and docs are available on the web at -+ -+ -+ Say Y when you have a board with radio support. -+ -+ Note: There are several TV cards that are based on chips that -+ support radio reception. Disabling this option will -+ disable support for them. -+ -+config MEDIA_RC_SUPPORT -+ bool "Remote Controller support" -+ depends on INPUT -+ ---help--- -+ Enable support for Remote Controllers on Linux. This is -+ needed in order to support several video capture adapters, -+ standalone IR receivers/transmitters, and RF receivers. -+ -+ Enable this option if you have a video capture board even -+ if you don't need IR, as otherwise, you may not be able to -+ compile the driver for your adapter. -+ -+ Say Y when you have a TV or an IR device. -+ -+# - # Media controller -+# Selectable only for webcam/grabbers, as other drivers don't use it - # - - config MEDIA_CONTROLLER - bool "Media Controller API (EXPERIMENTAL)" - depends on EXPERIMENTAL -+ depends on MEDIA_CAMERA_SUPPORT - ---help--- - Enable the media controller API used to query media devices internal - topology and configure it dynamically. -@@ -27,31 +89,15 @@ config MEDIA_CONTROLLER - This API is mostly used by camera interfaces in embedded platforms. - - # --# V4L core and enabled API's -+# Video4Linux support -+# Only enables if one of the V4L2 types (ATV, webcam, radio) is selected - # - - config VIDEO_DEV -- tristate "Video For Linux" -- ---help--- -- V4L core support for video capture and overlay devices, webcams and -- AM/FM radio cards. -- -- This kernel includes support for the new Video for Linux Two API, -- (V4L2). -- -- Additional info and docs are available on the web at -- -- -- Documentation for V4L2 is also available on the web at -- . -- -- To compile this driver as a module, choose M here: the -- module will be called videodev. -- --config VIDEO_V4L2_COMMON - tristate -- depends on (I2C || I2C=n) && VIDEO_DEV -- default (I2C || I2C=n) && VIDEO_DEV -+ depends on MEDIA_SUPPORT -+ depends on MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT -+ default y - - config VIDEO_V4L2_SUBDEV_API - bool "V4L2 sub-device userspace API (EXPERIMENTAL)" -@@ -62,27 +108,19 @@ config VIDEO_V4L2_SUBDEV_API - - This API is mostly used by camera interfaces in embedded platforms. - -+source "drivers/media/v4l2-core/Kconfig" -+ - # - # DVB Core -+# Only enables if one of DTV is selected - # - - config DVB_CORE -- tristate "DVB for Linux" -+ tristate -+ depends on MEDIA_SUPPORT -+ depends on MEDIA_DIGITAL_TV_SUPPORT -+ default y - select CRC32 -- help -- DVB core utility functions for device handling, software fallbacks etc. -- -- Enable this if you own a DVB/ATSC adapter and want to use it or if -- you compile Linux for a digital SetTopBox. -- -- Say Y when you have a DVB or an ATSC card and want to use it. -- -- API specs and user tools are available from . -- -- Please report problems regarding this support to the LinuxDVB -- mailing list. -- -- If unsure say N. - - config DVB_NET - bool "DVB Network Support" -@@ -97,33 +135,63 @@ config DVB_NET - You may want to disable the network support on embedded devices. If - unsure say Y. - --config VIDEO_MEDIA -- tristate -- default (DVB_CORE && (VIDEO_DEV = n)) || (VIDEO_DEV && (DVB_CORE = n)) || (DVB_CORE && VIDEO_DEV) -+# This Kconfig option is used by both PCI and USB drivers -+config TTPCI_EEPROM -+ tristate -+ depends on I2C -+ default n - --comment "Multimedia drivers" -+source "drivers/media/dvb-core/Kconfig" - --source "drivers/media/common/Kconfig" -+comment "Media drivers" - source "drivers/media/rc/Kconfig" - - # --# Tuner drivers for DVB and V4L -+# V4L platform/mem2mem drivers - # - --source "drivers/media/common/tuners/Kconfig" -+source "drivers/media/usb/Kconfig" -+source "drivers/media/pci/Kconfig" -+source "drivers/media/platform/Kconfig" -+source "drivers/media/mmc/Kconfig" -+source "drivers/media/parport/Kconfig" -+source "drivers/media/radio/Kconfig" - --# --# Video/Radio/Hybrid adapters --# -+comment "Supported FireWire (IEEE 1394) Adapters" -+ depends on DVB_CORE && FIREWIRE -+source "drivers/media/firewire/Kconfig" - --source "drivers/media/video/Kconfig" -+# Common driver options -+source "drivers/media/common/Kconfig" - --source "drivers/media/radio/Kconfig" -+comment "Media ancillary drivers (tuners, sensors, i2c, frontends)" - - # --# DVB adapters -+# Ancillary drivers (tuners, i2c, frontends) - # - --source "drivers/media/dvb/Kconfig" -+config MEDIA_SUBDRV_AUTOSELECT -+ bool "Autoselect ancillary drivers (tuners, sensors, i2c, frontends)" -+ depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_CAMERA_SUPPORT -+ default y -+ help -+ By default, a media driver auto-selects all possible ancillary -+ devices such as tuners, sensors, video encoders/decoders and -+ frontends, that are used by any of the supported devices. -+ -+ This is generally the right thing to do, except when there -+ are strict constraints with regards to the kernel size, -+ like on embedded systems. -+ -+ Use this option with care, as deselecting ancillary drivers which -+ are, in fact, necessary will result in the lack of the needed -+ functionality for your device (it may not tune or may not have -+ the needed demodulators). -+ -+ If unsure say Y. -+ -+source "drivers/media/i2c/Kconfig" -+source "drivers/media/tuners/Kconfig" -+source "drivers/media/dvb-frontends/Kconfig" - - endif # MEDIA_SUPPORT -diff --git a/drivers/media/Makefile b/drivers/media/Makefile -index 64755c9..620f275 100644 ---- a/drivers/media/Makefile -+++ b/drivers/media/Makefile -@@ -4,11 +4,30 @@ - - media-objs := media-device.o media-devnode.o media-entity.o - -+# -+# I2C drivers should come before other drivers, otherwise they'll fail -+# when compiled as builtin drivers -+# -+obj-y += i2c/ tuners/ -+obj-$(CONFIG_DVB_CORE) += dvb-frontends/ -+ -+# -+# Now, let's link-in the media core -+# - ifeq ($(CONFIG_MEDIA_CONTROLLER),y) - obj-$(CONFIG_MEDIA_SUPPORT) += media.o - endif - --obj-y += common/ rc/ video/ -+obj-$(CONFIG_VIDEO_DEV) += v4l2-core/ -+obj-$(CONFIG_DVB_CORE) += dvb-core/ - -+# There are both core and drivers at RC subtree - merge before drivers -+obj-y += rc/ -+ -+# -+# Finally, merge the drivers that require the core -+# -+ -+obj-y += common/ platform/ pci/ usb/ mmc/ firewire/ parport/ - obj-$(CONFIG_VIDEO_DEV) += radio/ --obj-$(CONFIG_DVB_CORE) += dvb/ -+ -diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig -index 769c6f8..d2a436c 100644 ---- a/drivers/media/common/Kconfig -+++ b/drivers/media/common/Kconfig -@@ -1,9 +1,10 @@ --config VIDEO_SAA7146 -- tristate -- depends on I2C && PCI -+# Used by common drivers, when they need to ask questions -+config MEDIA_COMMON_OPTIONS -+ bool - --config VIDEO_SAA7146_VV -- tristate -- depends on VIDEO_V4L2 -- select VIDEOBUF_DMA_SG -- select VIDEO_SAA7146 -+comment "common driver options" -+ depends on MEDIA_COMMON_OPTIONS -+ -+source "drivers/media/common/b2c2/Kconfig" -+source "drivers/media/common/saa7146/Kconfig" -+source "drivers/media/common/siano/Kconfig" -diff --git a/drivers/media/common/Makefile b/drivers/media/common/Makefile -index e3ec963..b8e2e3a 100644 ---- a/drivers/media/common/Makefile -+++ b/drivers/media/common/Makefile -@@ -1,6 +1 @@ --saa7146-objs := saa7146_i2c.o saa7146_core.o --saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o -- --obj-y += tuners/ --obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o --obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o -+obj-y += b2c2/ saa7146/ siano/ -diff --git a/drivers/media/common/b2c2/Kconfig b/drivers/media/common/b2c2/Kconfig -new file mode 100644 -index 0000000..a8c6cdf ---- /dev/null -+++ b/drivers/media/common/b2c2/Kconfig -@@ -0,0 +1,23 @@ -+config DVB_B2C2_FLEXCOP -+ tristate -+ depends on DVB_CORE && I2C -+ depends on DVB_B2C2_FLEXCOP_PCI || DVB_B2C2_FLEXCOP_USB -+ default y -+ select DVB_PLL if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_STV0299 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_MT352 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_MT312 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_NXT200X if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_STV0297 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_BCM3510 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_LGDT330X if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_S5H1420 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_TUNER_ITD1000 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_ISL6421 if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_CX24123 if MEDIA_SUBDRV_AUTOSELECT -+ select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT -+ select DVB_TUNER_CX24113 if MEDIA_SUBDRV_AUTOSELECT -+ -+# Selected via the PCI or USB flexcop drivers -+config DVB_B2C2_FLEXCOP_DEBUG -+ bool -diff --git a/drivers/media/common/b2c2/Makefile b/drivers/media/common/b2c2/Makefile -new file mode 100644 -index 0000000..24993a5 ---- /dev/null -+++ b/drivers/media/common/b2c2/Makefile -@@ -0,0 +1,8 @@ -+b2c2-flexcop-objs += flexcop.o flexcop-fe-tuner.o flexcop-i2c.o -+b2c2-flexcop-objs += flexcop-sram.o flexcop-eeprom.o flexcop-misc.o -+b2c2-flexcop-objs += flexcop-hw-filter.o -+obj-$(CONFIG_DVB_B2C2_FLEXCOP) += b2c2-flexcop.o -+ -+ccflags-y += -Idrivers/media/dvb-core/ -+ccflags-y += -Idrivers/media/dvb-frontends/ -+ccflags-y += -Idrivers/media/tuners/ -diff --git a/drivers/media/common/b2c2/flexcop-common.h b/drivers/media/common/b2c2/flexcop-common.h -new file mode 100644 -index 0000000..437912e ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-common.h -@@ -0,0 +1,185 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-common.h - common header file for device-specific source files -+ * see flexcop.c for copyright information -+ */ -+#ifndef __FLEXCOP_COMMON_H__ -+#define __FLEXCOP_COMMON_H__ -+ -+#include -+#include -+#include -+ -+#include "flexcop-reg.h" -+ -+#include "dmxdev.h" -+#include "dvb_demux.h" -+#include "dvb_filter.h" -+#include "dvb_net.h" -+#include "dvb_frontend.h" -+ -+#define FC_MAX_FEED 256 -+ -+#ifndef FC_LOG_PREFIX -+#warning please define a log prefix for your file, using a default one -+#define FC_LOG_PREFIX "b2c2-undef" -+#endif -+ -+/* Steal from usb.h */ -+#undef err -+#define err(format, arg...) \ -+ printk(KERN_ERR FC_LOG_PREFIX ": " format "\n" , ## arg) -+#undef info -+#define info(format, arg...) \ -+ printk(KERN_INFO FC_LOG_PREFIX ": " format "\n" , ## arg) -+#undef warn -+#define warn(format, arg...) \ -+ printk(KERN_WARNING FC_LOG_PREFIX ": " format "\n" , ## arg) -+ -+struct flexcop_dma { -+ struct pci_dev *pdev; -+ -+ u8 *cpu_addr0; -+ dma_addr_t dma_addr0; -+ u8 *cpu_addr1; -+ dma_addr_t dma_addr1; -+ u32 size; /* size of each address in bytes */ -+}; -+ -+struct flexcop_i2c_adapter { -+ struct flexcop_device *fc; -+ struct i2c_adapter i2c_adap; -+ -+ u8 no_base_addr; -+ flexcop_i2c_port_t port; -+}; -+ -+/* Control structure for data definitions that are common to -+ * the B2C2-based PCI and USB devices. -+ */ -+struct flexcop_device { -+ /* general */ -+ struct device *dev; /* for firmware_class */ -+ -+#define FC_STATE_DVB_INIT 0x01 -+#define FC_STATE_I2C_INIT 0x02 -+#define FC_STATE_FE_INIT 0x04 -+ int init_state; -+ -+ /* device information */ -+ int has_32_hw_pid_filter; -+ flexcop_revision_t rev; -+ flexcop_device_type_t dev_type; -+ flexcop_bus_t bus_type; -+ -+ /* dvb stuff */ -+ struct dvb_adapter dvb_adapter; -+ struct dvb_frontend *fe; -+ struct dvb_net dvbnet; -+ struct dvb_demux demux; -+ struct dmxdev dmxdev; -+ struct dmx_frontend hw_frontend; -+ struct dmx_frontend mem_frontend; -+ int (*fe_sleep) (struct dvb_frontend *); -+ -+ struct flexcop_i2c_adapter fc_i2c_adap[3]; -+ struct mutex i2c_mutex; -+ struct module *owner; -+ -+ /* options and status */ -+ int extra_feedcount; -+ int feedcount; -+ int pid_filtering; -+ int fullts_streaming_state; -+ -+ /* bus specific callbacks */ -+ flexcop_ibi_value(*read_ibi_reg) (struct flexcop_device *, -+ flexcop_ibi_register); -+ int (*write_ibi_reg) (struct flexcop_device *, -+ flexcop_ibi_register, flexcop_ibi_value); -+ int (*i2c_request) (struct flexcop_i2c_adapter *, -+ flexcop_access_op_t, u8 chipaddr, u8 addr, u8 *buf, u16 len); -+ int (*stream_control) (struct flexcop_device *, int); -+ int (*get_mac_addr) (struct flexcop_device *fc, int extended); -+ void *bus_specific; -+}; -+ -+/* exported prototypes */ -+ -+/* from flexcop.c */ -+void flexcop_pass_dmx_data(struct flexcop_device *fc, u8 *buf, u32 len); -+void flexcop_pass_dmx_packets(struct flexcop_device *fc, u8 *buf, u32 no); -+ -+struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len); -+void flexcop_device_kfree(struct flexcop_device *); -+ -+int flexcop_device_initialize(struct flexcop_device *); -+void flexcop_device_exit(struct flexcop_device *fc); -+void flexcop_reset_block_300(struct flexcop_device *fc); -+ -+/* from flexcop-dma.c */ -+int flexcop_dma_allocate(struct pci_dev *pdev, -+ struct flexcop_dma *dma, u32 size); -+void flexcop_dma_free(struct flexcop_dma *dma); -+ -+int flexcop_dma_control_timer_irq(struct flexcop_device *fc, -+ flexcop_dma_index_t no, int onoff); -+int flexcop_dma_control_size_irq(struct flexcop_device *fc, -+ flexcop_dma_index_t no, int onoff); -+int flexcop_dma_config(struct flexcop_device *fc, struct flexcop_dma *dma, -+ flexcop_dma_index_t dma_idx); -+int flexcop_dma_xfer_control(struct flexcop_device *fc, -+ flexcop_dma_index_t dma_idx, flexcop_dma_addr_index_t index, -+ int onoff); -+int flexcop_dma_config_timer(struct flexcop_device *fc, -+ flexcop_dma_index_t dma_idx, u8 cycles); -+ -+/* from flexcop-eeprom.c */ -+/* the PCI part uses this call to get the MAC address, the USB part has its own */ -+int flexcop_eeprom_check_mac_addr(struct flexcop_device *fc, int extended); -+ -+/* from flexcop-i2c.c */ -+/* the PCI part uses this a i2c_request callback, whereas the usb part has its own -+ * one. We have it in flexcop-i2c.c, because it is going via the actual -+ * I2C-channel of the flexcop. -+ */ -+int flexcop_i2c_request(struct flexcop_i2c_adapter*, flexcop_access_op_t, -+ u8 chipaddr, u8 addr, u8 *buf, u16 len); -+ -+/* from flexcop-sram.c */ -+int flexcop_sram_set_dest(struct flexcop_device *fc, flexcop_sram_dest_t dest, -+ flexcop_sram_dest_target_t target); -+void flexcop_wan_set_speed(struct flexcop_device *fc, flexcop_wan_speed_t s); -+void flexcop_sram_ctrl(struct flexcop_device *fc, -+ int usb_wan, int sramdma, int maximumfill); -+ -+/* global prototypes for the flexcop-chip */ -+/* from flexcop-fe-tuner.c */ -+int flexcop_frontend_init(struct flexcop_device *fc); -+void flexcop_frontend_exit(struct flexcop_device *fc); -+ -+/* from flexcop-i2c.c */ -+int flexcop_i2c_init(struct flexcop_device *fc); -+void flexcop_i2c_exit(struct flexcop_device *fc); -+ -+/* from flexcop-sram.c */ -+int flexcop_sram_init(struct flexcop_device *fc); -+ -+/* from flexcop-misc.c */ -+void flexcop_determine_revision(struct flexcop_device *fc); -+void flexcop_device_name(struct flexcop_device *fc, -+ const char *prefix, const char *suffix); -+void flexcop_dump_reg(struct flexcop_device *fc, -+ flexcop_ibi_register reg, int num); -+ -+/* from flexcop-hw-filter.c */ -+int flexcop_pid_feed_control(struct flexcop_device *fc, -+ struct dvb_demux_feed *dvbdmxfeed, int onoff); -+void flexcop_hw_filter_init(struct flexcop_device *fc); -+ -+void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff); -+ -+void flexcop_set_mac_filter(struct flexcop_device *fc, u8 mac[6]); -+void flexcop_mac_filter_ctrl(struct flexcop_device *fc, int onoff); -+ -+#endif -diff --git a/drivers/media/common/b2c2/flexcop-eeprom.c b/drivers/media/common/b2c2/flexcop-eeprom.c -new file mode 100644 -index 0000000..a25373a ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-eeprom.c -@@ -0,0 +1,147 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-eeprom.c - eeprom access methods (currently only MAC address reading) -+ * see flexcop.c for copyright information -+ */ -+#include "flexcop.h" -+ -+#if 0 -+/*EEPROM (Skystar2 has one "24LC08B" chip on board) */ -+static int eeprom_write(struct adapter *adapter, u16 addr, u8 *buf, u16 len) -+{ -+ return flex_i2c_write(adapter, 0x20000000, 0x50, addr, buf, len); -+} -+ -+static int eeprom_lrc_write(struct adapter *adapter, u32 addr, -+ u32 len, u8 *wbuf, u8 *rbuf, int retries) -+{ -+int i; -+ -+for (i = 0; i < retries; i++) { -+ if (eeprom_write(adapter, addr, wbuf, len) == len) { -+ if (eeprom_lrc_read(adapter, addr, len, rbuf, retries) == 1) -+ return 1; -+ } -+ } -+ return 0; -+} -+ -+/* These functions could be used to unlock SkyStar2 cards. */ -+ -+static int eeprom_writeKey(struct adapter *adapter, u8 *key, u32 len) -+{ -+ u8 rbuf[20]; -+ u8 wbuf[20]; -+ -+ if (len != 16) -+ return 0; -+ -+ memcpy(wbuf, key, len); -+ wbuf[16] = 0; -+ wbuf[17] = 0; -+ wbuf[18] = 0; -+ wbuf[19] = calc_lrc(wbuf, 19); -+ return eeprom_lrc_write(adapter, 0x3e4, 20, wbuf, rbuf, 4); -+} -+ -+static int eeprom_readKey(struct adapter *adapter, u8 *key, u32 len) -+{ -+ u8 buf[20]; -+ -+ if (len != 16) -+ return 0; -+ -+ if (eeprom_lrc_read(adapter, 0x3e4, 20, buf, 4) == 0) -+ return 0; -+ -+ memcpy(key, buf, len); -+ return 1; -+} -+ -+static char eeprom_set_mac_addr(struct adapter *adapter, char type, u8 *mac) -+{ -+ u8 tmp[8]; -+ -+ if (type != 0) { -+ tmp[0] = mac[0]; -+ tmp[1] = mac[1]; -+ tmp[2] = mac[2]; -+ tmp[3] = mac[5]; -+ tmp[4] = mac[6]; -+ tmp[5] = mac[7]; -+ } else { -+ tmp[0] = mac[0]; -+ tmp[1] = mac[1]; -+ tmp[2] = mac[2]; -+ tmp[3] = mac[3]; -+ tmp[4] = mac[4]; -+ tmp[5] = mac[5]; -+ } -+ -+ tmp[6] = 0; -+ tmp[7] = calc_lrc(tmp, 7); -+ -+ if (eeprom_write(adapter, 0x3f8, tmp, 8) == 8) -+ return 1; -+ return 0; -+} -+ -+static int flexcop_eeprom_read(struct flexcop_device *fc, -+ u16 addr, u8 *buf, u16 len) -+{ -+ return fc->i2c_request(fc,FC_READ,FC_I2C_PORT_EEPROM,0x50,addr,buf,len); -+} -+ -+#endif -+ -+static u8 calc_lrc(u8 *buf, int len) -+{ -+ int i; -+ u8 sum = 0; -+ for (i = 0; i < len; i++) -+ sum = sum ^ buf[i]; -+ return sum; -+} -+ -+static int flexcop_eeprom_request(struct flexcop_device *fc, -+ flexcop_access_op_t op, u16 addr, u8 *buf, u16 len, int retries) -+{ -+ int i,ret = 0; -+ u8 chipaddr = 0x50 | ((addr >> 8) & 3); -+ for (i = 0; i < retries; i++) { -+ ret = fc->i2c_request(&fc->fc_i2c_adap[1], op, chipaddr, -+ addr & 0xff, buf, len); -+ if (ret == 0) -+ break; -+ } -+ return ret; -+} -+ -+static int flexcop_eeprom_lrc_read(struct flexcop_device *fc, u16 addr, -+ u8 *buf, u16 len, int retries) -+{ -+ int ret = flexcop_eeprom_request(fc, FC_READ, addr, buf, len, retries); -+ if (ret == 0) -+ if (calc_lrc(buf, len - 1) != buf[len - 1]) -+ ret = -EINVAL; -+ return ret; -+} -+ -+/* JJ's comment about extended == 1: it is not presently used anywhere but was -+ * added to the low-level functions for possible support of EUI64 */ -+int flexcop_eeprom_check_mac_addr(struct flexcop_device *fc, int extended) -+{ -+ u8 buf[8]; -+ int ret = 0; -+ -+ if ((ret = flexcop_eeprom_lrc_read(fc,0x3f8,buf,8,4)) == 0) { -+ if (extended != 0) { -+ err("TODO: extended (EUI64) MAC addresses aren't " -+ "completely supported yet"); -+ ret = -EINVAL; -+ } else -+ memcpy(fc->dvb_adapter.proposed_mac,buf,6); -+ } -+ return ret; -+} -+EXPORT_SYMBOL(flexcop_eeprom_check_mac_addr); -diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c b/drivers/media/common/b2c2/flexcop-fe-tuner.c -new file mode 100644 -index 0000000..850a6c6 ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c -@@ -0,0 +1,678 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-fe-tuner.c - methods for frontend attachment and DiSEqC controlling -+ * see flexcop.c for copyright information -+ */ -+#include -+#include "flexcop.h" -+#include "mt312.h" -+#include "stv0299.h" -+#include "s5h1420.h" -+#include "itd1000.h" -+#include "cx24113.h" -+#include "cx24123.h" -+#include "isl6421.h" -+#include "mt352.h" -+#include "bcm3510.h" -+#include "nxt200x.h" -+#include "dvb-pll.h" -+#include "lgdt330x.h" -+#include "tuner-simple.h" -+#include "stv0297.h" -+ -+ -+/* Can we use the specified front-end? Remember that if we are compiled -+ * into the kernel we can't call code that's in modules. */ -+#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \ -+ (defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE))) -+ -+/* lnb control */ -+#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299) -+static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) -+{ -+ struct flexcop_device *fc = fe->dvb->priv; -+ flexcop_ibi_value v; -+ deb_tuner("polarity/voltage = %u\n", voltage); -+ -+ v = fc->read_ibi_reg(fc, misc_204); -+ switch (voltage) { -+ case SEC_VOLTAGE_OFF: -+ v.misc_204.ACPI1_sig = 1; -+ break; -+ case SEC_VOLTAGE_13: -+ v.misc_204.ACPI1_sig = 0; -+ v.misc_204.LNB_L_H_sig = 0; -+ break; -+ case SEC_VOLTAGE_18: -+ v.misc_204.ACPI1_sig = 0; -+ v.misc_204.LNB_L_H_sig = 1; -+ break; -+ default: -+ err("unknown SEC_VOLTAGE value"); -+ return -EINVAL; -+ } -+ return fc->write_ibi_reg(fc, misc_204, v); -+} -+#endif -+ -+#if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312) -+static int flexcop_sleep(struct dvb_frontend* fe) -+{ -+ struct flexcop_device *fc = fe->dvb->priv; -+ if (fc->fe_sleep) -+ return fc->fe_sleep(fe); -+ return 0; -+} -+#endif -+ -+/* SkyStar2 DVB-S rev 2.3 */ -+#if FE_SUPPORTED(MT312) && FE_SUPPORTED(PLL) -+static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone) -+{ -+/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */ -+ struct flexcop_device *fc = fe->dvb->priv; -+ flexcop_ibi_value v; -+ u16 ax; -+ v.raw = 0; -+ deb_tuner("tone = %u\n",tone); -+ -+ switch (tone) { -+ case SEC_TONE_ON: -+ ax = 0x01ff; -+ break; -+ case SEC_TONE_OFF: -+ ax = 0; -+ break; -+ default: -+ err("unknown SEC_TONE value"); -+ return -EINVAL; -+ } -+ -+ v.lnb_switch_freq_200.LNB_CTLPrescaler_sig = 1; /* divide by 2 */ -+ v.lnb_switch_freq_200.LNB_CTLHighCount_sig = ax; -+ v.lnb_switch_freq_200.LNB_CTLLowCount_sig = ax == 0 ? 0x1ff : ax; -+ return fc->write_ibi_reg(fc,lnb_switch_freq_200,v); -+} -+ -+static void flexcop_diseqc_send_bit(struct dvb_frontend* fe, int data) -+{ -+ flexcop_set_tone(fe, SEC_TONE_ON); -+ udelay(data ? 500 : 1000); -+ flexcop_set_tone(fe, SEC_TONE_OFF); -+ udelay(data ? 1000 : 500); -+} -+ -+static void flexcop_diseqc_send_byte(struct dvb_frontend* fe, int data) -+{ -+ int i, par = 1, d; -+ for (i = 7; i >= 0; i--) { -+ d = (data >> i) & 1; -+ par ^= d; -+ flexcop_diseqc_send_bit(fe, d); -+ } -+ flexcop_diseqc_send_bit(fe, par); -+} -+ -+static int flexcop_send_diseqc_msg(struct dvb_frontend *fe, -+ int len, u8 *msg, unsigned long burst) -+{ -+ int i; -+ -+ flexcop_set_tone(fe, SEC_TONE_OFF); -+ mdelay(16); -+ -+ for (i = 0; i < len; i++) -+ flexcop_diseqc_send_byte(fe,msg[i]); -+ mdelay(16); -+ -+ if (burst != -1) { -+ if (burst) -+ flexcop_diseqc_send_byte(fe, 0xff); -+ else { -+ flexcop_set_tone(fe, SEC_TONE_ON); -+ mdelay(12); -+ udelay(500); -+ flexcop_set_tone(fe, SEC_TONE_OFF); -+ } -+ msleep(20); -+ } -+ return 0; -+} -+ -+static int flexcop_diseqc_send_master_cmd(struct dvb_frontend *fe, -+ struct dvb_diseqc_master_cmd *cmd) -+{ -+ return flexcop_send_diseqc_msg(fe, cmd->msg_len, cmd->msg, 0); -+} -+ -+static int flexcop_diseqc_send_burst(struct dvb_frontend *fe, -+ fe_sec_mini_cmd_t minicmd) -+{ -+ return flexcop_send_diseqc_msg(fe, 0, NULL, minicmd); -+} -+ -+static struct mt312_config skystar23_samsung_tbdu18132_config = { -+ .demod_address = 0x0e, -+}; -+ -+static int skystar2_rev23_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ struct dvb_frontend_ops *ops; -+ -+ fc->fe = dvb_attach(mt312_attach, &skystar23_samsung_tbdu18132_config, i2c); -+ if (!fc->fe) -+ return 0; -+ -+ if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, i2c, -+ DVB_PLL_SAMSUNG_TBDU18132)) -+ return 0; -+ -+ ops = &fc->fe->ops; -+ ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; -+ ops->diseqc_send_burst = flexcop_diseqc_send_burst; -+ ops->set_tone = flexcop_set_tone; -+ ops->set_voltage = flexcop_set_voltage; -+ fc->fe_sleep = ops->sleep; -+ ops->sleep = flexcop_sleep; -+ return 1; -+} -+#else -+#define skystar2_rev23_attach NULL -+#endif -+ -+/* SkyStar2 DVB-S rev 2.6 */ -+#if FE_SUPPORTED(STV0299) && FE_SUPPORTED(PLL) -+static int samsung_tbmu24112_set_symbol_rate(struct dvb_frontend *fe, -+ u32 srate, u32 ratio) -+{ -+ u8 aclk = 0; -+ u8 bclk = 0; -+ -+ if (srate < 1500000) { -+ aclk = 0xb7; bclk = 0x47; -+ } else if (srate < 3000000) { -+ aclk = 0xb7; bclk = 0x4b; -+ } else if (srate < 7000000) { -+ aclk = 0xb7; bclk = 0x4f; -+ } else if (srate < 14000000) { -+ aclk = 0xb7; bclk = 0x53; -+ } else if (srate < 30000000) { -+ aclk = 0xb6; bclk = 0x53; -+ } else if (srate < 45000000) { -+ aclk = 0xb4; bclk = 0x51; -+ } -+ -+ stv0299_writereg(fe, 0x13, aclk); -+ stv0299_writereg(fe, 0x14, bclk); -+ stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff); -+ stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff); -+ stv0299_writereg(fe, 0x21, ratio & 0xf0); -+ return 0; -+} -+ -+static u8 samsung_tbmu24112_inittab[] = { -+ 0x01, 0x15, -+ 0x02, 0x30, -+ 0x03, 0x00, -+ 0x04, 0x7D, -+ 0x05, 0x35, -+ 0x06, 0x02, -+ 0x07, 0x00, -+ 0x08, 0xC3, -+ 0x0C, 0x00, -+ 0x0D, 0x81, -+ 0x0E, 0x23, -+ 0x0F, 0x12, -+ 0x10, 0x7E, -+ 0x11, 0x84, -+ 0x12, 0xB9, -+ 0x13, 0x88, -+ 0x14, 0x89, -+ 0x15, 0xC9, -+ 0x16, 0x00, -+ 0x17, 0x5C, -+ 0x18, 0x00, -+ 0x19, 0x00, -+ 0x1A, 0x00, -+ 0x1C, 0x00, -+ 0x1D, 0x00, -+ 0x1E, 0x00, -+ 0x1F, 0x3A, -+ 0x20, 0x2E, -+ 0x21, 0x80, -+ 0x22, 0xFF, -+ 0x23, 0xC1, -+ 0x28, 0x00, -+ 0x29, 0x1E, -+ 0x2A, 0x14, -+ 0x2B, 0x0F, -+ 0x2C, 0x09, -+ 0x2D, 0x05, -+ 0x31, 0x1F, -+ 0x32, 0x19, -+ 0x33, 0xFE, -+ 0x34, 0x93, -+ 0xff, 0xff, -+}; -+ -+static struct stv0299_config samsung_tbmu24112_config = { -+ .demod_address = 0x68, -+ .inittab = samsung_tbmu24112_inittab, -+ .mclk = 88000000UL, -+ .invert = 0, -+ .skip_reinit = 0, -+ .lock_output = STV0299_LOCKOUTPUT_LK, -+ .volt13_op0_op1 = STV0299_VOLT13_OP1, -+ .min_delay_ms = 100, -+ .set_symbol_rate = samsung_tbmu24112_set_symbol_rate, -+}; -+ -+static int skystar2_rev26_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fe = dvb_attach(stv0299_attach, &samsung_tbmu24112_config, i2c); -+ if (!fc->fe) -+ return 0; -+ -+ if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, i2c, -+ DVB_PLL_SAMSUNG_TBMU24112)) -+ return 0; -+ -+ fc->fe->ops.set_voltage = flexcop_set_voltage; -+ fc->fe_sleep = fc->fe->ops.sleep; -+ fc->fe->ops.sleep = flexcop_sleep; -+ return 1; -+ -+} -+#else -+#define skystar2_rev26_attach NULL -+#endif -+ -+/* SkyStar2 DVB-S rev 2.7 */ -+#if FE_SUPPORTED(S5H1420) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_ITD1000) -+static struct s5h1420_config skystar2_rev2_7_s5h1420_config = { -+ .demod_address = 0x53, -+ .invert = 1, -+ .repeated_start_workaround = 1, -+ .serial_mpeg = 1, -+}; -+ -+static struct itd1000_config skystar2_rev2_7_itd1000_config = { -+ .i2c_address = 0x61, -+}; -+ -+static int skystar2_rev27_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ flexcop_ibi_value r108; -+ struct i2c_adapter *i2c_tuner; -+ -+ /* enable no_base_addr - no repeated start when reading */ -+ fc->fc_i2c_adap[0].no_base_addr = 1; -+ fc->fe = dvb_attach(s5h1420_attach, &skystar2_rev2_7_s5h1420_config, -+ i2c); -+ if (!fc->fe) -+ goto fail; -+ -+ i2c_tuner = s5h1420_get_tuner_i2c_adapter(fc->fe); -+ if (!i2c_tuner) -+ goto fail; -+ -+ fc->fe_sleep = fc->fe->ops.sleep; -+ fc->fe->ops.sleep = flexcop_sleep; -+ -+ /* enable no_base_addr - no repeated start when reading */ -+ fc->fc_i2c_adap[2].no_base_addr = 1; -+ if (!dvb_attach(isl6421_attach, fc->fe, &fc->fc_i2c_adap[2].i2c_adap, -+ 0x08, 1, 1)) { -+ err("ISL6421 could NOT be attached"); -+ goto fail_isl; -+ } -+ info("ISL6421 successfully attached"); -+ -+ /* the ITD1000 requires a lower i2c clock - is it a problem ? */ -+ r108.raw = 0x00000506; -+ fc->write_ibi_reg(fc, tw_sm_c_108, r108); -+ if (!dvb_attach(itd1000_attach, fc->fe, i2c_tuner, -+ &skystar2_rev2_7_itd1000_config)) { -+ err("ITD1000 could NOT be attached"); -+ /* Should i2c clock be restored? */ -+ goto fail_isl; -+ } -+ info("ITD1000 successfully attached"); -+ -+ return 1; -+ -+fail_isl: -+ fc->fc_i2c_adap[2].no_base_addr = 0; -+fail: -+ /* for the next devices we need it again */ -+ fc->fc_i2c_adap[0].no_base_addr = 0; -+ return 0; -+} -+#else -+#define skystar2_rev27_attach NULL -+#endif -+ -+/* SkyStar2 rev 2.8 */ -+#if FE_SUPPORTED(CX24123) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_CX24113) -+static struct cx24123_config skystar2_rev2_8_cx24123_config = { -+ .demod_address = 0x55, -+ .dont_use_pll = 1, -+ .agc_callback = cx24113_agc_callback, -+}; -+ -+static const struct cx24113_config skystar2_rev2_8_cx24113_config = { -+ .i2c_addr = 0x54, -+ .xtal_khz = 10111, -+}; -+ -+static int skystar2_rev28_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ struct i2c_adapter *i2c_tuner; -+ -+ fc->fe = dvb_attach(cx24123_attach, &skystar2_rev2_8_cx24123_config, -+ i2c); -+ if (!fc->fe) -+ return 0; -+ -+ i2c_tuner = cx24123_get_tuner_i2c_adapter(fc->fe); -+ if (!i2c_tuner) -+ return 0; -+ -+ if (!dvb_attach(cx24113_attach, fc->fe, &skystar2_rev2_8_cx24113_config, -+ i2c_tuner)) { -+ err("CX24113 could NOT be attached"); -+ return 0; -+ } -+ info("CX24113 successfully attached"); -+ -+ fc->fc_i2c_adap[2].no_base_addr = 1; -+ if (!dvb_attach(isl6421_attach, fc->fe, &fc->fc_i2c_adap[2].i2c_adap, -+ 0x08, 0, 0)) { -+ err("ISL6421 could NOT be attached"); -+ fc->fc_i2c_adap[2].no_base_addr = 0; -+ return 0; -+ } -+ info("ISL6421 successfully attached"); -+ /* TODO on i2c_adap[1] addr 0x11 (EEPROM) there seems to be an -+ * IR-receiver (PIC16F818) - but the card has no input for that ??? */ -+ return 1; -+} -+#else -+#define skystar2_rev28_attach NULL -+#endif -+ -+/* AirStar DVB-T */ -+#if FE_SUPPORTED(MT352) && FE_SUPPORTED(PLL) -+static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend *fe) -+{ -+ static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d }; -+ static u8 mt352_reset[] = { 0x50, 0x80 }; -+ static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 }; -+ static u8 mt352_agc_cfg[] = { 0x67, 0x28, 0xa1 }; -+ static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; -+ -+ mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config)); -+ udelay(2000); -+ mt352_write(fe, mt352_reset, sizeof(mt352_reset)); -+ mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg)); -+ mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg)); -+ mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); -+ return 0; -+} -+ -+static struct mt352_config samsung_tdtc9251dh0_config = { -+ .demod_address = 0x0f, -+ .demod_init = samsung_tdtc9251dh0_demod_init, -+}; -+ -+static int airstar_dvbt_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fe = dvb_attach(mt352_attach, &samsung_tdtc9251dh0_config, i2c); -+ if (!fc->fe) -+ return 0; -+ -+ return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, -+ DVB_PLL_SAMSUNG_TDTC9251DH0); -+} -+#else -+#define airstar_dvbt_attach NULL -+#endif -+ -+/* AirStar ATSC 1st generation */ -+#if FE_SUPPORTED(BCM3510) -+static int flexcop_fe_request_firmware(struct dvb_frontend *fe, -+ const struct firmware **fw, char* name) -+{ -+ struct flexcop_device *fc = fe->dvb->priv; -+ return request_firmware(fw, name, fc->dev); -+} -+ -+static struct bcm3510_config air2pc_atsc_first_gen_config = { -+ .demod_address = 0x0f, -+ .request_firmware = flexcop_fe_request_firmware, -+}; -+ -+static int airstar_atsc1_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, i2c); -+ return fc->fe != NULL; -+} -+#else -+#define airstar_atsc1_attach NULL -+#endif -+ -+/* AirStar ATSC 2nd generation */ -+#if FE_SUPPORTED(NXT200X) && FE_SUPPORTED(PLL) -+static struct nxt200x_config samsung_tbmv_config = { -+ .demod_address = 0x0a, -+}; -+ -+static int airstar_atsc2_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fe = dvb_attach(nxt200x_attach, &samsung_tbmv_config, i2c); -+ if (!fc->fe) -+ return 0; -+ -+ return !!dvb_attach(dvb_pll_attach, fc->fe, 0x61, NULL, -+ DVB_PLL_SAMSUNG_TBMV); -+} -+#else -+#define airstar_atsc2_attach NULL -+#endif -+ -+/* AirStar ATSC 3rd generation */ -+#if FE_SUPPORTED(LGDT330X) -+static struct lgdt330x_config air2pc_atsc_hd5000_config = { -+ .demod_address = 0x59, -+ .demod_chip = LGDT3303, -+ .serial_mpeg = 0x04, -+ .clock_polarity_flip = 1, -+}; -+ -+static int airstar_atsc3_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, i2c); -+ if (!fc->fe) -+ return 0; -+ -+ return !!dvb_attach(simple_tuner_attach, fc->fe, i2c, 0x61, -+ TUNER_LG_TDVS_H06XF); -+} -+#else -+#define airstar_atsc3_attach NULL -+#endif -+ -+/* CableStar2 DVB-C */ -+#if FE_SUPPORTED(STV0297) && FE_SUPPORTED(PLL) -+static u8 alps_tdee4_stv0297_inittab[] = { -+ 0x80, 0x01, -+ 0x80, 0x00, -+ 0x81, 0x01, -+ 0x81, 0x00, -+ 0x00, 0x48, -+ 0x01, 0x58, -+ 0x03, 0x00, -+ 0x04, 0x00, -+ 0x07, 0x00, -+ 0x08, 0x00, -+ 0x30, 0xff, -+ 0x31, 0x9d, -+ 0x32, 0xff, -+ 0x33, 0x00, -+ 0x34, 0x29, -+ 0x35, 0x55, -+ 0x36, 0x80, -+ 0x37, 0x6e, -+ 0x38, 0x9c, -+ 0x40, 0x1a, -+ 0x41, 0xfe, -+ 0x42, 0x33, -+ 0x43, 0x00, -+ 0x44, 0xff, -+ 0x45, 0x00, -+ 0x46, 0x00, -+ 0x49, 0x04, -+ 0x4a, 0x51, -+ 0x4b, 0xf8, -+ 0x52, 0x30, -+ 0x53, 0x06, -+ 0x59, 0x06, -+ 0x5a, 0x5e, -+ 0x5b, 0x04, -+ 0x61, 0x49, -+ 0x62, 0x0a, -+ 0x70, 0xff, -+ 0x71, 0x04, -+ 0x72, 0x00, -+ 0x73, 0x00, -+ 0x74, 0x0c, -+ 0x80, 0x20, -+ 0x81, 0x00, -+ 0x82, 0x30, -+ 0x83, 0x00, -+ 0x84, 0x04, -+ 0x85, 0x22, -+ 0x86, 0x08, -+ 0x87, 0x1b, -+ 0x88, 0x00, -+ 0x89, 0x00, -+ 0x90, 0x00, -+ 0x91, 0x04, -+ 0xa0, 0x86, -+ 0xa1, 0x00, -+ 0xa2, 0x00, -+ 0xb0, 0x91, -+ 0xb1, 0x0b, -+ 0xc0, 0x5b, -+ 0xc1, 0x10, -+ 0xc2, 0x12, -+ 0xd0, 0x02, -+ 0xd1, 0x00, -+ 0xd2, 0x00, -+ 0xd3, 0x00, -+ 0xd4, 0x02, -+ 0xd5, 0x00, -+ 0xde, 0x00, -+ 0xdf, 0x01, -+ 0xff, 0xff, -+}; -+ -+static struct stv0297_config alps_tdee4_stv0297_config = { -+ .demod_address = 0x1c, -+ .inittab = alps_tdee4_stv0297_inittab, -+}; -+ -+static int cablestar2_attach(struct flexcop_device *fc, -+ struct i2c_adapter *i2c) -+{ -+ fc->fc_i2c_adap[0].no_base_addr = 1; -+ fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, i2c); -+ if (!fc->fe) -+ goto fail; -+ -+ /* This tuner doesn't use the stv0297's I2C gate, but instead the -+ * tuner is connected to a different flexcop I2C adapter. */ -+ if (fc->fe->ops.i2c_gate_ctrl) -+ fc->fe->ops.i2c_gate_ctrl(fc->fe, 0); -+ fc->fe->ops.i2c_gate_ctrl = NULL; -+ -+ if (!dvb_attach(dvb_pll_attach, fc->fe, 0x61, -+ &fc->fc_i2c_adap[2].i2c_adap, DVB_PLL_TDEE4)) -+ goto fail; -+ -+ return 1; -+ -+fail: -+ /* Reset for next frontend to try */ -+ fc->fc_i2c_adap[0].no_base_addr = 0; -+ return 0; -+} -+#else -+#define cablestar2_attach NULL -+#endif -+ -+static struct { -+ flexcop_device_type_t type; -+ int (*attach)(struct flexcop_device *, struct i2c_adapter *); -+} flexcop_frontends[] = { -+ { FC_SKY_REV27, skystar2_rev27_attach }, -+ { FC_SKY_REV28, skystar2_rev28_attach }, -+ { FC_SKY_REV26, skystar2_rev26_attach }, -+ { FC_AIR_DVBT, airstar_dvbt_attach }, -+ { FC_AIR_ATSC2, airstar_atsc2_attach }, -+ { FC_AIR_ATSC3, airstar_atsc3_attach }, -+ { FC_AIR_ATSC1, airstar_atsc1_attach }, -+ { FC_CABLE, cablestar2_attach }, -+ { FC_SKY_REV23, skystar2_rev23_attach }, -+}; -+ -+/* try to figure out the frontend */ -+int flexcop_frontend_init(struct flexcop_device *fc) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(flexcop_frontends); i++) { -+ if (!flexcop_frontends[i].attach) -+ continue; -+ /* type needs to be set before, because of some workarounds -+ * done based on the probed card type */ -+ fc->dev_type = flexcop_frontends[i].type; -+ if (flexcop_frontends[i].attach(fc, &fc->fc_i2c_adap[0].i2c_adap)) -+ goto fe_found; -+ /* Clean up partially attached frontend */ -+ if (fc->fe) { -+ dvb_frontend_detach(fc->fe); -+ fc->fe = NULL; -+ } -+ } -+ fc->dev_type = FC_UNK; -+ err("no frontend driver found for this B2C2/FlexCop adapter"); -+ return -ENODEV; -+ -+fe_found: -+ info("found '%s' .", fc->fe->ops.info.name); -+ if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) { -+ err("frontend registration failed!"); -+ dvb_frontend_detach(fc->fe); -+ fc->fe = NULL; -+ return -EINVAL; -+ } -+ fc->init_state |= FC_STATE_FE_INIT; -+ return 0; -+} -+ -+void flexcop_frontend_exit(struct flexcop_device *fc) -+{ -+ if (fc->init_state & FC_STATE_FE_INIT) { -+ dvb_unregister_frontend(fc->fe); -+ dvb_frontend_detach(fc->fe); -+ } -+ fc->init_state &= ~FC_STATE_FE_INIT; -+} -diff --git a/drivers/media/common/b2c2/flexcop-hw-filter.c b/drivers/media/common/b2c2/flexcop-hw-filter.c -new file mode 100644 -index 0000000..77e4547 ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-hw-filter.c -@@ -0,0 +1,232 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-hw-filter.c - pid and mac address filtering and control functions -+ * see flexcop.c for copyright information -+ */ -+#include "flexcop.h" -+ -+static void flexcop_rcv_data_ctrl(struct flexcop_device *fc, int onoff) -+{ -+ flexcop_set_ibi_value(ctrl_208, Rcv_Data_sig, onoff); -+ deb_ts("rcv_data is now: '%s'\n", onoff ? "on" : "off"); -+} -+ -+void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) -+{ -+ flexcop_set_ibi_value(ctrl_208, SMC_Enable_sig, onoff); -+} -+ -+static void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) -+{ -+ flexcop_set_ibi_value(ctrl_208, Null_filter_sig, onoff); -+} -+ -+void flexcop_set_mac_filter(struct flexcop_device *fc, u8 mac[6]) -+{ -+ flexcop_ibi_value v418, v41c; -+ v41c = fc->read_ibi_reg(fc, mac_address_41c); -+ -+ v418.mac_address_418.MAC1 = mac[0]; -+ v418.mac_address_418.MAC2 = mac[1]; -+ v418.mac_address_418.MAC3 = mac[2]; -+ v418.mac_address_418.MAC6 = mac[3]; -+ v41c.mac_address_41c.MAC7 = mac[4]; -+ v41c.mac_address_41c.MAC8 = mac[5]; -+ -+ fc->write_ibi_reg(fc, mac_address_418, v418); -+ fc->write_ibi_reg(fc, mac_address_41c, v41c); -+} -+ -+void flexcop_mac_filter_ctrl(struct flexcop_device *fc, int onoff) -+{ -+ flexcop_set_ibi_value(ctrl_208, MAC_filter_Mode_sig, onoff); -+} -+ -+static void flexcop_pid_group_filter(struct flexcop_device *fc, -+ u16 pid, u16 mask) -+{ -+ /* index_reg_310.extra_index_reg need to 0 or 7 to work */ -+ flexcop_ibi_value v30c; -+ v30c.pid_filter_30c_ext_ind_0_7.Group_PID = pid; -+ v30c.pid_filter_30c_ext_ind_0_7.Group_mask = mask; -+ fc->write_ibi_reg(fc, pid_filter_30c, v30c); -+} -+ -+static void flexcop_pid_group_filter_ctrl(struct flexcop_device *fc, int onoff) -+{ -+ flexcop_set_ibi_value(ctrl_208, Mask_filter_sig, onoff); -+} -+ -+/* this fancy define reduces the code size of the quite similar PID controlling of -+ * the first 6 PIDs -+ */ -+ -+#define pid_ctrl(vregname,field,enablefield,trans_field,transval) \ -+ flexcop_ibi_value vpid = fc->read_ibi_reg(fc, vregname), \ -+v208 = fc->read_ibi_reg(fc, ctrl_208); \ -+vpid.vregname.field = onoff ? pid : 0x1fff; \ -+vpid.vregname.trans_field = transval; \ -+v208.ctrl_208.enablefield = onoff; \ -+fc->write_ibi_reg(fc, vregname, vpid); \ -+fc->write_ibi_reg(fc, ctrl_208, v208); -+ -+static void flexcop_pid_Stream1_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_300, Stream1_PID, Stream1_filter_sig, -+ Stream1_trans, 0); -+} -+ -+static void flexcop_pid_Stream2_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_300, Stream2_PID, Stream2_filter_sig, -+ Stream2_trans, 0); -+} -+ -+static void flexcop_pid_PCR_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_304, PCR_PID, PCR_filter_sig, PCR_trans, 0); -+} -+ -+static void flexcop_pid_PMT_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_304, PMT_PID, PMT_filter_sig, PMT_trans, 0); -+} -+ -+static void flexcop_pid_EMM_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_308, EMM_PID, EMM_filter_sig, EMM_trans, 0); -+} -+ -+static void flexcop_pid_ECM_PID_ctrl(struct flexcop_device *fc, -+ u16 pid, int onoff) -+{ -+ pid_ctrl(pid_filter_308, ECM_PID, ECM_filter_sig, ECM_trans, 0); -+} -+ -+static void flexcop_pid_control(struct flexcop_device *fc, -+ int index, u16 pid, int onoff) -+{ -+ if (pid == 0x2000) -+ return; -+ -+ deb_ts("setting pid: %5d %04x at index %d '%s'\n", -+ pid, pid, index, onoff ? "on" : "off"); -+ -+ /* We could use bit magic here to reduce source code size. -+ * I decided against it, but to use the real register names */ -+ switch (index) { -+ case 0: -+ flexcop_pid_Stream1_PID_ctrl(fc, pid, onoff); -+ break; -+ case 1: -+ flexcop_pid_Stream2_PID_ctrl(fc, pid, onoff); -+ break; -+ case 2: -+ flexcop_pid_PCR_PID_ctrl(fc, pid, onoff); -+ break; -+ case 3: -+ flexcop_pid_PMT_PID_ctrl(fc, pid, onoff); -+ break; -+ case 4: -+ flexcop_pid_EMM_PID_ctrl(fc, pid, onoff); -+ break; -+ case 5: -+ flexcop_pid_ECM_PID_ctrl(fc, pid, onoff); -+ break; -+ default: -+ if (fc->has_32_hw_pid_filter && index < 38) { -+ flexcop_ibi_value vpid, vid; -+ -+ /* set the index */ -+ vid = fc->read_ibi_reg(fc, index_reg_310); -+ vid.index_reg_310.index_reg = index - 6; -+ fc->write_ibi_reg(fc, index_reg_310, vid); -+ -+ vpid = fc->read_ibi_reg(fc, pid_n_reg_314); -+ vpid.pid_n_reg_314.PID = onoff ? pid : 0x1fff; -+ vpid.pid_n_reg_314.PID_enable_bit = onoff; -+ fc->write_ibi_reg(fc, pid_n_reg_314, vpid); -+ } -+ break; -+ } -+} -+ -+static int flexcop_toggle_fullts_streaming(struct flexcop_device *fc, int onoff) -+{ -+ if (fc->fullts_streaming_state != onoff) { -+ deb_ts("%s full TS transfer\n",onoff ? "enabling" : "disabling"); -+ flexcop_pid_group_filter(fc, 0, 0x1fe0 * (!onoff)); -+ flexcop_pid_group_filter_ctrl(fc, onoff); -+ fc->fullts_streaming_state = onoff; -+ } -+ return 0; -+} -+ -+int flexcop_pid_feed_control(struct flexcop_device *fc, -+ struct dvb_demux_feed *dvbdmxfeed, int onoff) -+{ -+ int max_pid_filter = 6 + fc->has_32_hw_pid_filter*32; -+ -+ fc->feedcount += onoff ? 1 : -1; /* the number of PIDs/Feed currently requested */ -+ if (dvbdmxfeed->index >= max_pid_filter) -+ fc->extra_feedcount += onoff ? 1 : -1; -+ -+ /* toggle complete-TS-streaming when: -+ * - pid_filtering is not enabled and it is the first or last feed requested -+ * - pid_filtering is enabled, -+ * - but the number of requested feeds is exceeded -+ * - or the requested pid is 0x2000 */ -+ -+ if (!fc->pid_filtering && fc->feedcount == onoff) -+ flexcop_toggle_fullts_streaming(fc, onoff); -+ -+ if (fc->pid_filtering) { -+ flexcop_pid_control \ -+ (fc, dvbdmxfeed->index, dvbdmxfeed->pid, onoff); -+ -+ if (fc->extra_feedcount > 0) -+ flexcop_toggle_fullts_streaming(fc, 1); -+ else if (dvbdmxfeed->pid == 0x2000) -+ flexcop_toggle_fullts_streaming(fc, onoff); -+ else -+ flexcop_toggle_fullts_streaming(fc, 0); -+ } -+ -+ /* if it was the first or last feed request change the stream-status */ -+ if (fc->feedcount == onoff) { -+ flexcop_rcv_data_ctrl(fc, onoff); -+ if (fc->stream_control) /* device specific stream control */ -+ fc->stream_control(fc, onoff); -+ -+ /* feeding stopped -> reset the flexcop filter*/ -+ if (onoff == 0) { -+ flexcop_reset_block_300(fc); -+ flexcop_hw_filter_init(fc); -+ } -+ } -+ return 0; -+} -+EXPORT_SYMBOL(flexcop_pid_feed_control); -+ -+void flexcop_hw_filter_init(struct flexcop_device *fc) -+{ -+ int i; -+ flexcop_ibi_value v; -+ for (i = 0; i < 6 + 32*fc->has_32_hw_pid_filter; i++) -+ flexcop_pid_control(fc, i, 0x1fff, 0); -+ -+ flexcop_pid_group_filter(fc, 0, 0x1fe0); -+ flexcop_pid_group_filter_ctrl(fc, 0); -+ -+ v = fc->read_ibi_reg(fc, pid_filter_308); -+ v.pid_filter_308.EMM_filter_4 = 1; -+ v.pid_filter_308.EMM_filter_6 = 0; -+ fc->write_ibi_reg(fc, pid_filter_308, v); -+ -+ flexcop_null_filter_ctrl(fc, 1); -+} -diff --git a/drivers/media/common/b2c2/flexcop-i2c.c b/drivers/media/common/b2c2/flexcop-i2c.c -new file mode 100644 -index 0000000..965d5eb ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-i2c.c -@@ -0,0 +1,288 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-i2c.c - flexcop internal 2Wire bus (I2C) and dvb i2c initialization -+ * see flexcop.c for copyright information -+ */ -+#include "flexcop.h" -+ -+#define FC_MAX_I2C_RETRIES 100000 -+ -+static int flexcop_i2c_operation(struct flexcop_device *fc, -+ flexcop_ibi_value *r100) -+{ -+ int i; -+ flexcop_ibi_value r; -+ -+ r100->tw_sm_c_100.working_start = 1; -+ deb_i2c("r100 before: %08x\n",r100->raw); -+ -+ fc->write_ibi_reg(fc, tw_sm_c_100, ibi_zero); -+ fc->write_ibi_reg(fc, tw_sm_c_100, *r100); /* initiating i2c operation */ -+ -+ for (i = 0; i < FC_MAX_I2C_RETRIES; i++) { -+ r = fc->read_ibi_reg(fc, tw_sm_c_100); -+ -+ if (!r.tw_sm_c_100.no_base_addr_ack_error) { -+ if (r.tw_sm_c_100.st_done) { -+ *r100 = r; -+ deb_i2c("i2c success\n"); -+ return 0; -+ } -+ } else { -+ deb_i2c("suffering from an i2c ack_error\n"); -+ return -EREMOTEIO; -+ } -+ } -+ deb_i2c("tried %d times i2c operation, " -+ "never finished or too many ack errors.\n", i); -+ return -EREMOTEIO; -+} -+ -+static int flexcop_i2c_read4(struct flexcop_i2c_adapter *i2c, -+ flexcop_ibi_value r100, u8 *buf) -+{ -+ flexcop_ibi_value r104; -+ int len = r100.tw_sm_c_100.total_bytes, -+ /* remember total_bytes is buflen-1 */ -+ ret; -+ -+ /* work-around to have CableStar2 and SkyStar2 rev 2.7 work -+ * correctly: -+ * -+ * the ITD1000 is behind an i2c-gate which closes automatically -+ * after an i2c-transaction the STV0297 needs 2 consecutive reads -+ * one with no_base_addr = 0 and one with 1 -+ * -+ * those two work-arounds are conflictin: we check for the card -+ * type, it is set when probing the ITD1000 */ -+ if (i2c->fc->dev_type == FC_SKY_REV27) -+ r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr; -+ -+ ret = flexcop_i2c_operation(i2c->fc, &r100); -+ if (ret != 0) { -+ deb_i2c("Retrying operation\n"); -+ r100.tw_sm_c_100.no_base_addr_ack_error = i2c->no_base_addr; -+ ret = flexcop_i2c_operation(i2c->fc, &r100); -+ } -+ if (ret != 0) { -+ deb_i2c("read failed. %d\n", ret); -+ return ret; -+ } -+ -+ buf[0] = r100.tw_sm_c_100.data1_reg; -+ -+ if (len > 0) { -+ r104 = i2c->fc->read_ibi_reg(i2c->fc, tw_sm_c_104); -+ deb_i2c("read: r100: %08x, r104: %08x\n", r100.raw, r104.raw); -+ -+ /* there is at least one more byte, otherwise we wouldn't be here */ -+ buf[1] = r104.tw_sm_c_104.data2_reg; -+ if (len > 1) buf[2] = r104.tw_sm_c_104.data3_reg; -+ if (len > 2) buf[3] = r104.tw_sm_c_104.data4_reg; -+ } -+ return 0; -+} -+ -+static int flexcop_i2c_write4(struct flexcop_device *fc, -+ flexcop_ibi_value r100, u8 *buf) -+{ -+ flexcop_ibi_value r104; -+ int len = r100.tw_sm_c_100.total_bytes; /* remember total_bytes is buflen-1 */ -+ r104.raw = 0; -+ -+ /* there is at least one byte, otherwise we wouldn't be here */ -+ r100.tw_sm_c_100.data1_reg = buf[0]; -+ r104.tw_sm_c_104.data2_reg = len > 0 ? buf[1] : 0; -+ r104.tw_sm_c_104.data3_reg = len > 1 ? buf[2] : 0; -+ r104.tw_sm_c_104.data4_reg = len > 2 ? buf[3] : 0; -+ -+ deb_i2c("write: r100: %08x, r104: %08x\n", r100.raw, r104.raw); -+ -+ /* write the additional i2c data before doing the actual i2c operation */ -+ fc->write_ibi_reg(fc, tw_sm_c_104, r104); -+ return flexcop_i2c_operation(fc, &r100); -+} -+ -+int flexcop_i2c_request(struct flexcop_i2c_adapter *i2c, -+ flexcop_access_op_t op, u8 chipaddr, u8 addr, u8 *buf, u16 len) -+{ -+ int ret; -+ -+#ifdef DUMP_I2C_MESSAGES -+ int i; -+#endif -+ -+ u16 bytes_to_transfer; -+ flexcop_ibi_value r100; -+ -+ deb_i2c("op = %d\n",op); -+ r100.raw = 0; -+ r100.tw_sm_c_100.chipaddr = chipaddr; -+ r100.tw_sm_c_100.twoWS_rw = op; -+ r100.tw_sm_c_100.twoWS_port_reg = i2c->port; -+ -+#ifdef DUMP_I2C_MESSAGES -+ printk(KERN_DEBUG "%d ", i2c->port); -+ if (op == FC_READ) -+ printk("rd("); -+ else -+ printk("wr("); -+ printk("%02x): %02x ", chipaddr, addr); -+#endif -+ -+ /* in that case addr is the only value -> -+ * we write it twice as baseaddr and val0 -+ * BBTI is doing it like that for ISL6421 at least */ -+ if (i2c->no_base_addr && len == 0 && op == FC_WRITE) { -+ buf = &addr; -+ len = 1; -+ } -+ -+ while (len != 0) { -+ bytes_to_transfer = len > 4 ? 4 : len; -+ -+ r100.tw_sm_c_100.total_bytes = bytes_to_transfer - 1; -+ r100.tw_sm_c_100.baseaddr = addr; -+ -+ if (op == FC_READ) -+ ret = flexcop_i2c_read4(i2c, r100, buf); -+ else -+ ret = flexcop_i2c_write4(i2c->fc, r100, buf); -+ -+#ifdef DUMP_I2C_MESSAGES -+ for (i = 0; i < bytes_to_transfer; i++) -+ printk("%02x ", buf[i]); -+#endif -+ -+ if (ret < 0) -+ return ret; -+ -+ buf += bytes_to_transfer; -+ addr += bytes_to_transfer; -+ len -= bytes_to_transfer; -+ } -+ -+#ifdef DUMP_I2C_MESSAGES -+ printk("\n"); -+#endif -+ -+ return 0; -+} -+/* exported for PCI i2c */ -+EXPORT_SYMBOL(flexcop_i2c_request); -+ -+/* master xfer callback for demodulator */ -+static int flexcop_master_xfer(struct i2c_adapter *i2c_adap, -+ struct i2c_msg msgs[], int num) -+{ -+ struct flexcop_i2c_adapter *i2c = i2c_get_adapdata(i2c_adap); -+ int i, ret = 0; -+ -+ /* Some drivers use 1 byte or 0 byte reads as probes, which this -+ * driver doesn't support. These probes will always fail, so this -+ * hack makes them always succeed. If one knew how, it would of -+ * course be better to actually do the read. */ -+ if (num == 1 && msgs[0].flags == I2C_M_RD && msgs[0].len <= 1) -+ return 1; -+ -+ if (mutex_lock_interruptible(&i2c->fc->i2c_mutex)) -+ return -ERESTARTSYS; -+ -+ for (i = 0; i < num; i++) { -+ /* reading */ -+ if (i+1 < num && (msgs[i+1].flags == I2C_M_RD)) { -+ ret = i2c->fc->i2c_request(i2c, FC_READ, msgs[i].addr, -+ msgs[i].buf[0], msgs[i+1].buf, -+ msgs[i+1].len); -+ i++; /* skip the following message */ -+ } else /* writing */ -+ ret = i2c->fc->i2c_request(i2c, FC_WRITE, msgs[i].addr, -+ msgs[i].buf[0], &msgs[i].buf[1], -+ msgs[i].len - 1); -+ if (ret < 0) { -+ deb_i2c("i2c master_xfer failed"); -+ break; -+ } -+ } -+ -+ mutex_unlock(&i2c->fc->i2c_mutex); -+ -+ if (ret == 0) -+ ret = num; -+ return ret; -+} -+ -+static u32 flexcop_i2c_func(struct i2c_adapter *adapter) -+{ -+ return I2C_FUNC_I2C; -+} -+ -+static struct i2c_algorithm flexcop_algo = { -+ .master_xfer = flexcop_master_xfer, -+ .functionality = flexcop_i2c_func, -+}; -+ -+int flexcop_i2c_init(struct flexcop_device *fc) -+{ -+ int ret; -+ mutex_init(&fc->i2c_mutex); -+ -+ fc->fc_i2c_adap[0].fc = fc; -+ fc->fc_i2c_adap[1].fc = fc; -+ fc->fc_i2c_adap[2].fc = fc; -+ fc->fc_i2c_adap[0].port = FC_I2C_PORT_DEMOD; -+ fc->fc_i2c_adap[1].port = FC_I2C_PORT_EEPROM; -+ fc->fc_i2c_adap[2].port = FC_I2C_PORT_TUNER; -+ -+ strlcpy(fc->fc_i2c_adap[0].i2c_adap.name, "B2C2 FlexCop I2C to demod", -+ sizeof(fc->fc_i2c_adap[0].i2c_adap.name)); -+ strlcpy(fc->fc_i2c_adap[1].i2c_adap.name, "B2C2 FlexCop I2C to eeprom", -+ sizeof(fc->fc_i2c_adap[1].i2c_adap.name)); -+ strlcpy(fc->fc_i2c_adap[2].i2c_adap.name, "B2C2 FlexCop I2C to tuner", -+ sizeof(fc->fc_i2c_adap[2].i2c_adap.name)); -+ -+ i2c_set_adapdata(&fc->fc_i2c_adap[0].i2c_adap, &fc->fc_i2c_adap[0]); -+ i2c_set_adapdata(&fc->fc_i2c_adap[1].i2c_adap, &fc->fc_i2c_adap[1]); -+ i2c_set_adapdata(&fc->fc_i2c_adap[2].i2c_adap, &fc->fc_i2c_adap[2]); -+ -+ fc->fc_i2c_adap[0].i2c_adap.algo = -+ fc->fc_i2c_adap[1].i2c_adap.algo = -+ fc->fc_i2c_adap[2].i2c_adap.algo = &flexcop_algo; -+ fc->fc_i2c_adap[0].i2c_adap.algo_data = -+ fc->fc_i2c_adap[1].i2c_adap.algo_data = -+ fc->fc_i2c_adap[2].i2c_adap.algo_data = NULL; -+ fc->fc_i2c_adap[0].i2c_adap.dev.parent = -+ fc->fc_i2c_adap[1].i2c_adap.dev.parent = -+ fc->fc_i2c_adap[2].i2c_adap.dev.parent = fc->dev; -+ -+ ret = i2c_add_adapter(&fc->fc_i2c_adap[0].i2c_adap); -+ if (ret < 0) -+ return ret; -+ -+ ret = i2c_add_adapter(&fc->fc_i2c_adap[1].i2c_adap); -+ if (ret < 0) -+ goto adap_1_failed; -+ -+ ret = i2c_add_adapter(&fc->fc_i2c_adap[2].i2c_adap); -+ if (ret < 0) -+ goto adap_2_failed; -+ -+ fc->init_state |= FC_STATE_I2C_INIT; -+ return 0; -+ -+adap_2_failed: -+ i2c_del_adapter(&fc->fc_i2c_adap[1].i2c_adap); -+adap_1_failed: -+ i2c_del_adapter(&fc->fc_i2c_adap[0].i2c_adap); -+ return ret; -+} -+ -+void flexcop_i2c_exit(struct flexcop_device *fc) -+{ -+ if (fc->init_state & FC_STATE_I2C_INIT) { -+ i2c_del_adapter(&fc->fc_i2c_adap[2].i2c_adap); -+ i2c_del_adapter(&fc->fc_i2c_adap[1].i2c_adap); -+ i2c_del_adapter(&fc->fc_i2c_adap[0].i2c_adap); -+ } -+ fc->init_state &= ~FC_STATE_I2C_INIT; -+} -diff --git a/drivers/media/common/b2c2/flexcop-misc.c b/drivers/media/common/b2c2/flexcop-misc.c -new file mode 100644 -index 0000000..f06f3a9 ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-misc.c -@@ -0,0 +1,86 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-misc.c - miscellaneous functions -+ * see flexcop.c for copyright information -+ */ -+#include "flexcop.h" -+ -+void flexcop_determine_revision(struct flexcop_device *fc) -+{ -+ flexcop_ibi_value v = fc->read_ibi_reg(fc,misc_204); -+ -+ switch (v.misc_204.Rev_N_sig_revision_hi) { -+ case 0x2: -+ deb_info("found a FlexCopII.\n"); -+ fc->rev = FLEXCOP_II; -+ break; -+ case 0x3: -+ deb_info("found a FlexCopIIb.\n"); -+ fc->rev = FLEXCOP_IIB; -+ break; -+ case 0x0: -+ deb_info("found a FlexCopIII.\n"); -+ fc->rev = FLEXCOP_III; -+ break; -+ default: -+ err("unknown FlexCop Revision: %x. Please report this to " -+ "linux-dvb@linuxtv.org.", -+ v.misc_204.Rev_N_sig_revision_hi); -+ break; -+ } -+ -+ if ((fc->has_32_hw_pid_filter = v.misc_204.Rev_N_sig_caps)) -+ deb_info("this FlexCop has " -+ "the additional 32 hardware pid filter.\n"); -+ else -+ deb_info("this FlexCop has " -+ "the 6 basic main hardware pid filter.\n"); -+ /* bus parts have to decide if hw pid filtering is used or not. */ -+} -+ -+static const char *flexcop_revision_names[] = { -+ "Unknown chip", -+ "FlexCopII", -+ "FlexCopIIb", -+ "FlexCopIII", -+}; -+ -+static const char *flexcop_device_names[] = { -+ [FC_UNK] = "Unknown device", -+ [FC_CABLE] = "Cable2PC/CableStar 2 DVB-C", -+ [FC_AIR_DVBT] = "Air2PC/AirStar 2 DVB-T", -+ [FC_AIR_ATSC1] = "Air2PC/AirStar 2 ATSC 1st generation", -+ [FC_AIR_ATSC2] = "Air2PC/AirStar 2 ATSC 2nd generation", -+ [FC_AIR_ATSC3] = "Air2PC/AirStar 2 ATSC 3rd generation (HD5000)", -+ [FC_SKY_REV23] = "Sky2PC/SkyStar 2 DVB-S rev 2.3 (old version)", -+ [FC_SKY_REV26] = "Sky2PC/SkyStar 2 DVB-S rev 2.6", -+ [FC_SKY_REV27] = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u", -+ [FC_SKY_REV28] = "Sky2PC/SkyStar 2 DVB-S rev 2.8", -+}; -+ -+static const char *flexcop_bus_names[] = { -+ "USB", -+ "PCI", -+}; -+ -+void flexcop_device_name(struct flexcop_device *fc, -+ const char *prefix, const char *suffix) -+{ -+ info("%s '%s' at the '%s' bus controlled by a '%s' %s", -+ prefix, flexcop_device_names[fc->dev_type], -+ flexcop_bus_names[fc->bus_type], -+ flexcop_revision_names[fc->rev], suffix); -+} -+ -+void flexcop_dump_reg(struct flexcop_device *fc, -+ flexcop_ibi_register reg, int num) -+{ -+ flexcop_ibi_value v; -+ int i; -+ for (i = 0; i < num; i++) { -+ v = fc->read_ibi_reg(fc, reg+4*i); -+ deb_rdump("0x%03x: %08x, ", reg+4*i, v.raw); -+ } -+ deb_rdump("\n"); -+} -+EXPORT_SYMBOL(flexcop_dump_reg); -diff --git a/drivers/media/common/b2c2/flexcop-reg.h b/drivers/media/common/b2c2/flexcop-reg.h -new file mode 100644 -index 0000000..dc4528d ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-reg.h -@@ -0,0 +1,166 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-reg.h - register abstraction for FlexCopII, FlexCopIIb and FlexCopIII -+ * see flexcop.c for copyright information -+ */ -+#ifndef __FLEXCOP_REG_H__ -+#define __FLEXCOP_REG_H__ -+ -+typedef enum { -+ FLEXCOP_UNK = 0, -+ FLEXCOP_II, -+ FLEXCOP_IIB, -+ FLEXCOP_III, -+} flexcop_revision_t; -+ -+typedef enum { -+ FC_UNK = 0, -+ FC_CABLE, -+ FC_AIR_DVBT, -+ FC_AIR_ATSC1, -+ FC_AIR_ATSC2, -+ FC_AIR_ATSC3, -+ FC_SKY_REV23, -+ FC_SKY_REV26, -+ FC_SKY_REV27, -+ FC_SKY_REV28, -+} flexcop_device_type_t; -+ -+typedef enum { -+ FC_USB = 0, -+ FC_PCI, -+} flexcop_bus_t; -+ -+/* FlexCop IBI Registers */ -+#if defined(__LITTLE_ENDIAN) -+#include "flexcop_ibi_value_le.h" -+#else -+#if defined(__BIG_ENDIAN) -+#include "flexcop_ibi_value_be.h" -+#else -+#error no endian defined -+#endif -+#endif -+ -+#define fc_data_Tag_ID_DVB 0x3e -+#define fc_data_Tag_ID_ATSC 0x3f -+#define fc_data_Tag_ID_IDSB 0x8b -+ -+#define fc_key_code_default 0x1 -+#define fc_key_code_even 0x2 -+#define fc_key_code_odd 0x3 -+ -+extern flexcop_ibi_value ibi_zero; -+ -+typedef enum { -+ FC_I2C_PORT_DEMOD = 1, -+ FC_I2C_PORT_EEPROM = 2, -+ FC_I2C_PORT_TUNER = 3, -+} flexcop_i2c_port_t; -+ -+typedef enum { -+ FC_WRITE = 0, -+ FC_READ = 1, -+} flexcop_access_op_t; -+ -+typedef enum { -+ FC_SRAM_DEST_NET = 1, -+ FC_SRAM_DEST_CAI = 2, -+ FC_SRAM_DEST_CAO = 4, -+ FC_SRAM_DEST_MEDIA = 8 -+} flexcop_sram_dest_t; -+ -+typedef enum { -+ FC_SRAM_DEST_TARGET_WAN_USB = 0, -+ FC_SRAM_DEST_TARGET_DMA1 = 1, -+ FC_SRAM_DEST_TARGET_DMA2 = 2, -+ FC_SRAM_DEST_TARGET_FC3_CA = 3 -+} flexcop_sram_dest_target_t; -+ -+typedef enum { -+ FC_SRAM_2_32KB = 0, /* 64KB */ -+ FC_SRAM_1_32KB = 1, /* 32KB - default fow FCII */ -+ FC_SRAM_1_128KB = 2, /* 128KB */ -+ FC_SRAM_1_48KB = 3, /* 48KB - default for FCIII */ -+} flexcop_sram_type_t; -+ -+typedef enum { -+ FC_WAN_SPEED_4MBITS = 0, -+ FC_WAN_SPEED_8MBITS = 1, -+ FC_WAN_SPEED_12MBITS = 2, -+ FC_WAN_SPEED_16MBITS = 3, -+} flexcop_wan_speed_t; -+ -+typedef enum { -+ FC_DMA_1 = 1, -+ FC_DMA_2 = 2, -+} flexcop_dma_index_t; -+ -+typedef enum { -+ FC_DMA_SUBADDR_0 = 1, -+ FC_DMA_SUBADDR_1 = 2, -+} flexcop_dma_addr_index_t; -+ -+/* names of the particular registers */ -+typedef enum { -+ dma1_000 = 0x000, -+ dma1_004 = 0x004, -+ dma1_008 = 0x008, -+ dma1_00c = 0x00c, -+ dma2_010 = 0x010, -+ dma2_014 = 0x014, -+ dma2_018 = 0x018, -+ dma2_01c = 0x01c, -+ -+ tw_sm_c_100 = 0x100, -+ tw_sm_c_104 = 0x104, -+ tw_sm_c_108 = 0x108, -+ tw_sm_c_10c = 0x10c, -+ tw_sm_c_110 = 0x110, -+ -+ lnb_switch_freq_200 = 0x200, -+ misc_204 = 0x204, -+ ctrl_208 = 0x208, -+ irq_20c = 0x20c, -+ sw_reset_210 = 0x210, -+ misc_214 = 0x214, -+ mbox_v8_to_host_218 = 0x218, -+ mbox_host_to_v8_21c = 0x21c, -+ -+ pid_filter_300 = 0x300, -+ pid_filter_304 = 0x304, -+ pid_filter_308 = 0x308, -+ pid_filter_30c = 0x30c, -+ index_reg_310 = 0x310, -+ pid_n_reg_314 = 0x314, -+ mac_low_reg_318 = 0x318, -+ mac_high_reg_31c = 0x31c, -+ -+ data_tag_400 = 0x400, -+ card_id_408 = 0x408, -+ card_id_40c = 0x40c, -+ mac_address_418 = 0x418, -+ mac_address_41c = 0x41c, -+ -+ ci_600 = 0x600, -+ pi_604 = 0x604, -+ pi_608 = 0x608, -+ dvb_reg_60c = 0x60c, -+ -+ sram_ctrl_reg_700 = 0x700, -+ net_buf_reg_704 = 0x704, -+ cai_buf_reg_708 = 0x708, -+ cao_buf_reg_70c = 0x70c, -+ media_buf_reg_710 = 0x710, -+ sram_dest_reg_714 = 0x714, -+ net_buf_reg_718 = 0x718, -+ wan_ctrl_reg_71c = 0x71c, -+} flexcop_ibi_register; -+ -+#define flexcop_set_ibi_value(reg,attr,val) { \ -+ flexcop_ibi_value v = fc->read_ibi_reg(fc,reg); \ -+ v.reg.attr = val; \ -+ fc->write_ibi_reg(fc,reg,v); \ -+} -+ -+#endif -diff --git a/drivers/media/common/b2c2/flexcop-sram.c b/drivers/media/common/b2c2/flexcop-sram.c -new file mode 100644 -index 0000000..f2199e4 ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop-sram.c -@@ -0,0 +1,363 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop-sram.c - functions for controlling the SRAM -+ * see flexcop.c for copyright information -+ */ -+#include "flexcop.h" -+ -+static void flexcop_sram_set_chip(struct flexcop_device *fc, -+ flexcop_sram_type_t type) -+{ -+ flexcop_set_ibi_value(wan_ctrl_reg_71c, sram_chip, type); -+} -+ -+int flexcop_sram_init(struct flexcop_device *fc) -+{ -+ switch (fc->rev) { -+ case FLEXCOP_II: -+ case FLEXCOP_IIB: -+ flexcop_sram_set_chip(fc, FC_SRAM_1_32KB); -+ break; -+ case FLEXCOP_III: -+ flexcop_sram_set_chip(fc, FC_SRAM_1_48KB); -+ break; -+ default: -+ return -EINVAL; -+ } -+ return 0; -+} -+ -+int flexcop_sram_set_dest(struct flexcop_device *fc, flexcop_sram_dest_t dest, -+ flexcop_sram_dest_target_t target) -+{ -+ flexcop_ibi_value v; -+ v = fc->read_ibi_reg(fc, sram_dest_reg_714); -+ -+ if (fc->rev != FLEXCOP_III && target == FC_SRAM_DEST_TARGET_FC3_CA) { -+ err("SRAM destination target to available on FlexCopII(b)\n"); -+ return -EINVAL; -+ } -+ deb_sram("sram dest: %x target: %x\n", dest, target); -+ -+ if (dest & FC_SRAM_DEST_NET) -+ v.sram_dest_reg_714.NET_Dest = target; -+ if (dest & FC_SRAM_DEST_CAI) -+ v.sram_dest_reg_714.CAI_Dest = target; -+ if (dest & FC_SRAM_DEST_CAO) -+ v.sram_dest_reg_714.CAO_Dest = target; -+ if (dest & FC_SRAM_DEST_MEDIA) -+ v.sram_dest_reg_714.MEDIA_Dest = target; -+ -+ fc->write_ibi_reg(fc,sram_dest_reg_714,v); -+ udelay(1000); /* TODO delay really necessary */ -+ -+ return 0; -+} -+EXPORT_SYMBOL(flexcop_sram_set_dest); -+ -+void flexcop_wan_set_speed(struct flexcop_device *fc, flexcop_wan_speed_t s) -+{ -+ flexcop_set_ibi_value(wan_ctrl_reg_71c,wan_speed_sig,s); -+} -+EXPORT_SYMBOL(flexcop_wan_set_speed); -+ -+void flexcop_sram_ctrl(struct flexcop_device *fc, int usb_wan, int sramdma, int maximumfill) -+{ -+ flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); -+ v.sram_dest_reg_714.ctrl_usb_wan = usb_wan; -+ v.sram_dest_reg_714.ctrl_sramdma = sramdma; -+ v.sram_dest_reg_714.ctrl_maximumfill = maximumfill; -+ fc->write_ibi_reg(fc,sram_dest_reg_714,v); -+} -+EXPORT_SYMBOL(flexcop_sram_ctrl); -+ -+#if 0 -+static void flexcop_sram_write(struct adapter *adapter, u32 bank, u32 addr, u8 *buf, u32 len) -+{ -+ int i, retries; -+ u32 command; -+ -+ for (i = 0; i < len; i++) { -+ command = bank | addr | 0x04000000 | (*buf << 0x10); -+ -+ retries = 2; -+ -+ while (((read_reg_dw(adapter, 0x700) & 0x80000000) != 0) && (retries > 0)) { -+ mdelay(1); -+ retries--; -+ }; -+ -+ if (retries == 0) -+ printk("%s: SRAM timeout\n", __func__); -+ -+ write_reg_dw(adapter, 0x700, command); -+ -+ buf++; -+ addr++; -+ } -+} -+ -+static void flex_sram_read(struct adapter *adapter, u32 bank, u32 addr, u8 *buf, u32 len) -+{ -+ int i, retries; -+ u32 command, value; -+ -+ for (i = 0; i < len; i++) { -+ command = bank | addr | 0x04008000; -+ -+ retries = 10000; -+ -+ while (((read_reg_dw(adapter, 0x700) & 0x80000000) != 0) && (retries > 0)) { -+ mdelay(1); -+ retries--; -+ }; -+ -+ if (retries == 0) -+ printk("%s: SRAM timeout\n", __func__); -+ -+ write_reg_dw(adapter, 0x700, command); -+ -+ retries = 10000; -+ -+ while (((read_reg_dw(adapter, 0x700) & 0x80000000) != 0) && (retries > 0)) { -+ mdelay(1); -+ retries--; -+ }; -+ -+ if (retries == 0) -+ printk("%s: SRAM timeout\n", __func__); -+ -+ value = read_reg_dw(adapter, 0x700) >> 0x10; -+ -+ *buf = (value & 0xff); -+ -+ addr++; -+ buf++; -+ } -+} -+ -+static void sram_write_chunk(struct adapter *adapter, u32 addr, u8 *buf, u16 len) -+{ -+ u32 bank; -+ -+ bank = 0; -+ -+ if (adapter->dw_sram_type == 0x20000) { -+ bank = (addr & 0x18000) << 0x0d; -+ } -+ -+ if (adapter->dw_sram_type == 0x00000) { -+ if ((addr >> 0x0f) == 0) -+ bank = 0x20000000; -+ else -+ bank = 0x10000000; -+ } -+ flex_sram_write(adapter, bank, addr & 0x7fff, buf, len); -+} -+ -+static void sram_read_chunk(struct adapter *adapter, u32 addr, u8 *buf, u16 len) -+{ -+ u32 bank; -+ bank = 0; -+ -+ if (adapter->dw_sram_type == 0x20000) { -+ bank = (addr & 0x18000) << 0x0d; -+ } -+ -+ if (adapter->dw_sram_type == 0x00000) { -+ if ((addr >> 0x0f) == 0) -+ bank = 0x20000000; -+ else -+ bank = 0x10000000; -+ } -+ flex_sram_read(adapter, bank, addr & 0x7fff, buf, len); -+} -+ -+static void sram_read(struct adapter *adapter, u32 addr, u8 *buf, u32 len) -+{ -+ u32 length; -+ while (len != 0) { -+ length = len; -+ /* check if the address range belongs to the same -+ * 32K memory chip. If not, the data is read -+ * from one chip at a time */ -+ if ((addr >> 0x0f) != ((addr + len - 1) >> 0x0f)) { -+ length = (((addr >> 0x0f) + 1) << 0x0f) - addr; -+ } -+ -+ sram_read_chunk(adapter, addr, buf, length); -+ addr = addr + length; -+ buf = buf + length; -+ len = len - length; -+ } -+} -+ -+static void sram_write(struct adapter *adapter, u32 addr, u8 *buf, u32 len) -+{ -+ u32 length; -+ while (len != 0) { -+ length = len; -+ -+ /* check if the address range belongs to the same -+ * 32K memory chip. If not, the data is -+ * written to one chip at a time */ -+ if ((addr >> 0x0f) != ((addr + len - 1) >> 0x0f)) { -+ length = (((addr >> 0x0f) + 1) << 0x0f) - addr; -+ } -+ -+ sram_write_chunk(adapter, addr, buf, length); -+ addr = addr + length; -+ buf = buf + length; -+ len = len - length; -+ } -+} -+ -+static void sram_set_size(struct adapter *adapter, u32 mask) -+{ -+ write_reg_dw(adapter, 0x71c, -+ (mask | (~0x30000 & read_reg_dw(adapter, 0x71c)))); -+} -+ -+static void sram_init(struct adapter *adapter) -+{ -+ u32 tmp; -+ tmp = read_reg_dw(adapter, 0x71c); -+ write_reg_dw(adapter, 0x71c, 1); -+ -+ if (read_reg_dw(adapter, 0x71c) != 0) { -+ write_reg_dw(adapter, 0x71c, tmp); -+ adapter->dw_sram_type = tmp & 0x30000; -+ ddprintk("%s: dw_sram_type = %x\n", __func__, adapter->dw_sram_type); -+ } else { -+ adapter->dw_sram_type = 0x10000; -+ ddprintk("%s: dw_sram_type = %x\n", __func__, adapter->dw_sram_type); -+ } -+} -+ -+static int sram_test_location(struct adapter *adapter, u32 mask, u32 addr) -+{ -+ u8 tmp1, tmp2; -+ dprintk("%s: mask = %x, addr = %x\n", __func__, mask, addr); -+ -+ sram_set_size(adapter, mask); -+ sram_init(adapter); -+ -+ tmp2 = 0xa5; -+ tmp1 = 0x4f; -+ -+ sram_write(adapter, addr, &tmp2, 1); -+ sram_write(adapter, addr + 4, &tmp1, 1); -+ -+ tmp2 = 0; -+ mdelay(20); -+ -+ sram_read(adapter, addr, &tmp2, 1); -+ sram_read(adapter, addr, &tmp2, 1); -+ -+ dprintk("%s: wrote 0xa5, read 0x%2x\n", __func__, tmp2); -+ -+ if (tmp2 != 0xa5) -+ return 0; -+ -+ tmp2 = 0x5a; -+ tmp1 = 0xf4; -+ -+ sram_write(adapter, addr, &tmp2, 1); -+ sram_write(adapter, addr + 4, &tmp1, 1); -+ -+ tmp2 = 0; -+ mdelay(20); -+ -+ sram_read(adapter, addr, &tmp2, 1); -+ sram_read(adapter, addr, &tmp2, 1); -+ -+ dprintk("%s: wrote 0x5a, read 0x%2x\n", __func__, tmp2); -+ -+ if (tmp2 != 0x5a) -+ return 0; -+ return 1; -+} -+ -+static u32 sram_length(struct adapter *adapter) -+{ -+ if (adapter->dw_sram_type == 0x10000) -+ return 32768; /* 32K */ -+ if (adapter->dw_sram_type == 0x00000) -+ return 65536; /* 64K */ -+ if (adapter->dw_sram_type == 0x20000) -+ return 131072; /* 128K */ -+ return 32768; /* 32K */ -+} -+ -+/* FlexcopII can work with 32K, 64K or 128K of external SRAM memory. -+ - for 128K there are 4x32K chips at bank 0,1,2,3. -+ - for 64K there are 2x32K chips at bank 1,2. -+ - for 32K there is one 32K chip at bank 0. -+ -+ FlexCop works only with one bank at a time. The bank is selected -+ by bits 28-29 of the 0x700 register. -+ -+ bank 0 covers addresses 0x00000-0x07fff -+ bank 1 covers addresses 0x08000-0x0ffff -+ bank 2 covers addresses 0x10000-0x17fff -+ bank 3 covers addresses 0x18000-0x1ffff */ -+ -+static int flexcop_sram_detect(struct flexcop_device *fc) -+{ -+ flexcop_ibi_value r208, r71c_0, vr71c_1; -+ r208 = fc->read_ibi_reg(fc, ctrl_208); -+ fc->write_ibi_reg(fc, ctrl_208, ibi_zero); -+ -+ r71c_0 = fc->read_ibi_reg(fc, wan_ctrl_reg_71c); -+ write_reg_dw(adapter, 0x71c, 1); -+ tmp3 = read_reg_dw(adapter, 0x71c); -+ dprintk("%s: tmp3 = %x\n", __func__, tmp3); -+ write_reg_dw(adapter, 0x71c, tmp2); -+ -+ // check for internal SRAM ??? -+ tmp3--; -+ if (tmp3 != 0) { -+ sram_set_size(adapter, 0x10000); -+ sram_init(adapter); -+ write_reg_dw(adapter, 0x208, tmp); -+ dprintk("%s: sram size = 32K\n", __func__); -+ return 32; -+ } -+ -+ if (sram_test_location(adapter, 0x20000, 0x18000) != 0) { -+ sram_set_size(adapter, 0x20000); -+ sram_init(adapter); -+ write_reg_dw(adapter, 0x208, tmp); -+ dprintk("%s: sram size = 128K\n", __func__); -+ return 128; -+ } -+ -+ if (sram_test_location(adapter, 0x00000, 0x10000) != 0) { -+ sram_set_size(adapter, 0x00000); -+ sram_init(adapter); -+ write_reg_dw(adapter, 0x208, tmp); -+ dprintk("%s: sram size = 64K\n", __func__); -+ return 64; -+ } -+ -+ if (sram_test_location(adapter, 0x10000, 0x00000) != 0) { -+ sram_set_size(adapter, 0x10000); -+ sram_init(adapter); -+ write_reg_dw(adapter, 0x208, tmp); -+ dprintk("%s: sram size = 32K\n", __func__); -+ return 32; -+ } -+ -+ sram_set_size(adapter, 0x10000); -+ sram_init(adapter); -+ write_reg_dw(adapter, 0x208, tmp); -+ dprintk("%s: SRAM detection failed. Set to 32K \n", __func__); -+ return 0; -+} -+ -+static void sll_detect_sram_size(struct adapter *adapter) -+{ -+ sram_detect_for_flex2(adapter); -+} -+ -+#endif -diff --git a/drivers/media/common/b2c2/flexcop.c b/drivers/media/common/b2c2/flexcop.c -new file mode 100644 -index 0000000..412c5da ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop.c -@@ -0,0 +1,325 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop.c - main module part -+ * Copyright (C) 2004-9 Patrick Boettcher -+ * based on skystar2-driver Copyright (C) 2003 Vadim Catana, skystar@moldova.cc -+ * -+ * Acknowledgements: -+ * John Jurrius from BBTI, Inc. for extensive support -+ * with code examples and data books -+ * Bjarne Steinsbo, bjarne at steinsbo.com (some ideas for rewriting) -+ * -+ * Contributions to the skystar2-driver have been done by -+ * Vincenzo Di Massa, hawk.it at tiscalinet.it (several DiSEqC fixes) -+ * Roberto Ragusa, r.ragusa at libero.it (polishing, restyling the code) -+ * Uwe Bugla, uwe.bugla at gmx.de (doing tests, restyling code, writing docu) -+ * Niklas Peinecke, peinecke at gdv.uni-hannover.de (hardware pid/mac -+ * filtering) -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public License -+ * as published by the Free Software Foundation; either version 2.1 -+ * of the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ */ -+ -+#include "flexcop.h" -+ -+#define DRIVER_NAME "B2C2 FlexcopII/II(b)/III digital TV receiver chip" -+#define DRIVER_AUTHOR "Patrick Boettcher demux->priv; -+ return flexcop_pid_feed_control(fc, dvbdmxfeed, 1); -+} -+ -+static int flexcop_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) -+{ -+ struct flexcop_device *fc = dvbdmxfeed->demux->priv; -+ return flexcop_pid_feed_control(fc, dvbdmxfeed, 0); -+} -+ -+static int flexcop_dvb_init(struct flexcop_device *fc) -+{ -+ int ret = dvb_register_adapter(&fc->dvb_adapter, -+ "FlexCop Digital TV device", fc->owner, -+ fc->dev, adapter_nr); -+ if (ret < 0) { -+ err("error registering DVB adapter"); -+ return ret; -+ } -+ fc->dvb_adapter.priv = fc; -+ -+ fc->demux.dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING -+ | DMX_MEMORY_BASED_FILTERING); -+ fc->demux.priv = fc; -+ fc->demux.filternum = fc->demux.feednum = FC_MAX_FEED; -+ fc->demux.start_feed = flexcop_dvb_start_feed; -+ fc->demux.stop_feed = flexcop_dvb_stop_feed; -+ fc->demux.write_to_decoder = NULL; -+ -+ ret = dvb_dmx_init(&fc->demux); -+ if (ret < 0) { -+ err("dvb_dmx failed: error %d", ret); -+ goto err_dmx; -+ } -+ -+ fc->hw_frontend.source = DMX_FRONTEND_0; -+ -+ fc->dmxdev.filternum = fc->demux.feednum; -+ fc->dmxdev.demux = &fc->demux.dmx; -+ fc->dmxdev.capabilities = 0; -+ ret = dvb_dmxdev_init(&fc->dmxdev, &fc->dvb_adapter); -+ if (ret < 0) { -+ err("dvb_dmxdev_init failed: error %d", ret); -+ goto err_dmx_dev; -+ } -+ -+ ret = fc->demux.dmx.add_frontend(&fc->demux.dmx, &fc->hw_frontend); -+ if (ret < 0) { -+ err("adding hw_frontend to dmx failed: error %d", ret); -+ goto err_dmx_add_hw_frontend; -+ } -+ -+ fc->mem_frontend.source = DMX_MEMORY_FE; -+ ret = fc->demux.dmx.add_frontend(&fc->demux.dmx, &fc->mem_frontend); -+ if (ret < 0) { -+ err("adding mem_frontend to dmx failed: error %d", ret); -+ goto err_dmx_add_mem_frontend; -+ } -+ -+ ret = fc->demux.dmx.connect_frontend(&fc->demux.dmx, &fc->hw_frontend); -+ if (ret < 0) { -+ err("connect frontend failed: error %d", ret); -+ goto err_connect_frontend; -+ } -+ -+ ret = dvb_net_init(&fc->dvb_adapter, &fc->dvbnet, &fc->demux.dmx); -+ if (ret < 0) { -+ err("dvb_net_init failed: error %d", ret); -+ goto err_net; -+ } -+ -+ fc->init_state |= FC_STATE_DVB_INIT; -+ return 0; -+ -+err_net: -+ fc->demux.dmx.disconnect_frontend(&fc->demux.dmx); -+err_connect_frontend: -+ fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->mem_frontend); -+err_dmx_add_mem_frontend: -+ fc->demux.dmx.remove_frontend(&fc->demux.dmx, &fc->hw_frontend); -+err_dmx_add_hw_frontend: -+ dvb_dmxdev_release(&fc->dmxdev); -+err_dmx_dev: -+ dvb_dmx_release(&fc->demux); -+err_dmx: -+ dvb_unregister_adapter(&fc->dvb_adapter); -+ return ret; -+} -+ -+static void flexcop_dvb_exit(struct flexcop_device *fc) -+{ -+ if (fc->init_state & FC_STATE_DVB_INIT) { -+ dvb_net_release(&fc->dvbnet); -+ -+ fc->demux.dmx.close(&fc->demux.dmx); -+ fc->demux.dmx.remove_frontend(&fc->demux.dmx, -+ &fc->mem_frontend); -+ fc->demux.dmx.remove_frontend(&fc->demux.dmx, -+ &fc->hw_frontend); -+ dvb_dmxdev_release(&fc->dmxdev); -+ dvb_dmx_release(&fc->demux); -+ dvb_unregister_adapter(&fc->dvb_adapter); -+ deb_info("deinitialized dvb stuff\n"); -+ } -+ fc->init_state &= ~FC_STATE_DVB_INIT; -+} -+ -+/* these methods are necessary to achieve the long-term-goal of hiding the -+ * struct flexcop_device from the bus-parts */ -+void flexcop_pass_dmx_data(struct flexcop_device *fc, u8 *buf, u32 len) -+{ -+ dvb_dmx_swfilter(&fc->demux, buf, len); -+} -+EXPORT_SYMBOL(flexcop_pass_dmx_data); -+ -+void flexcop_pass_dmx_packets(struct flexcop_device *fc, u8 *buf, u32 no) -+{ -+ dvb_dmx_swfilter_packets(&fc->demux, buf, no); -+} -+EXPORT_SYMBOL(flexcop_pass_dmx_packets); -+ -+static void flexcop_reset(struct flexcop_device *fc) -+{ -+ flexcop_ibi_value v210, v204; -+ -+ /* reset the flexcop itself */ -+ fc->write_ibi_reg(fc,ctrl_208,ibi_zero); -+ -+ v210.raw = 0; -+ v210.sw_reset_210.reset_block_000 = 1; -+ v210.sw_reset_210.reset_block_100 = 1; -+ v210.sw_reset_210.reset_block_200 = 1; -+ v210.sw_reset_210.reset_block_300 = 1; -+ v210.sw_reset_210.reset_block_400 = 1; -+ v210.sw_reset_210.reset_block_500 = 1; -+ v210.sw_reset_210.reset_block_600 = 1; -+ v210.sw_reset_210.reset_block_700 = 1; -+ v210.sw_reset_210.Block_reset_enable = 0xb2; -+ v210.sw_reset_210.Special_controls = 0xc259; -+ fc->write_ibi_reg(fc,sw_reset_210,v210); -+ msleep(1); -+ -+ /* reset the periphical devices */ -+ -+ v204 = fc->read_ibi_reg(fc,misc_204); -+ v204.misc_204.Per_reset_sig = 0; -+ fc->write_ibi_reg(fc,misc_204,v204); -+ msleep(1); -+ v204.misc_204.Per_reset_sig = 1; -+ fc->write_ibi_reg(fc,misc_204,v204); -+} -+ -+void flexcop_reset_block_300(struct flexcop_device *fc) -+{ -+ flexcop_ibi_value v208_save = fc->read_ibi_reg(fc, ctrl_208), -+ v210 = fc->read_ibi_reg(fc, sw_reset_210); -+ -+ deb_rdump("208: %08x, 210: %08x\n", v208_save.raw, v210.raw); -+ fc->write_ibi_reg(fc,ctrl_208,ibi_zero); -+ -+ v210.sw_reset_210.reset_block_300 = 1; -+ v210.sw_reset_210.Block_reset_enable = 0xb2; -+ -+ fc->write_ibi_reg(fc,sw_reset_210,v210); -+ fc->write_ibi_reg(fc,ctrl_208,v208_save); -+} -+ -+struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) -+{ -+ void *bus; -+ struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), -+ GFP_KERNEL); -+ if (!fc) { -+ err("no memory"); -+ return NULL; -+ } -+ -+ bus = kzalloc(bus_specific_len, GFP_KERNEL); -+ if (!bus) { -+ err("no memory"); -+ kfree(fc); -+ return NULL; -+ } -+ -+ fc->bus_specific = bus; -+ -+ return fc; -+} -+EXPORT_SYMBOL(flexcop_device_kmalloc); -+ -+void flexcop_device_kfree(struct flexcop_device *fc) -+{ -+ kfree(fc->bus_specific); -+ kfree(fc); -+} -+EXPORT_SYMBOL(flexcop_device_kfree); -+ -+int flexcop_device_initialize(struct flexcop_device *fc) -+{ -+ int ret; -+ ibi_zero.raw = 0; -+ -+ flexcop_reset(fc); -+ flexcop_determine_revision(fc); -+ flexcop_sram_init(fc); -+ flexcop_hw_filter_init(fc); -+ flexcop_smc_ctrl(fc, 0); -+ -+ ret = flexcop_dvb_init(fc); -+ if (ret) -+ goto error; -+ -+ /* i2c has to be done before doing EEProm stuff - -+ * because the EEProm is accessed via i2c */ -+ ret = flexcop_i2c_init(fc); -+ if (ret) -+ goto error; -+ -+ /* do the MAC address reading after initializing the dvb_adapter */ -+ if (fc->get_mac_addr(fc, 0) == 0) { -+ u8 *b = fc->dvb_adapter.proposed_mac; -+ info("MAC address = %pM", b); -+ flexcop_set_mac_filter(fc,b); -+ flexcop_mac_filter_ctrl(fc,1); -+ } else -+ warn("reading of MAC address failed.\n"); -+ -+ ret = flexcop_frontend_init(fc); -+ if (ret) -+ goto error; -+ -+ flexcop_device_name(fc,"initialization of","complete"); -+ return 0; -+ -+error: -+ flexcop_device_exit(fc); -+ return ret; -+} -+EXPORT_SYMBOL(flexcop_device_initialize); -+ -+void flexcop_device_exit(struct flexcop_device *fc) -+{ -+ flexcop_frontend_exit(fc); -+ flexcop_i2c_exit(fc); -+ flexcop_dvb_exit(fc); -+} -+EXPORT_SYMBOL(flexcop_device_exit); -+ -+static int flexcop_module_init(void) -+{ -+ info(DRIVER_NAME " loaded successfully"); -+ return 0; -+} -+ -+static void flexcop_module_cleanup(void) -+{ -+ info(DRIVER_NAME " unloaded successfully"); -+} -+ -+module_init(flexcop_module_init); -+module_exit(flexcop_module_cleanup); -+ -+MODULE_AUTHOR(DRIVER_AUTHOR); -+MODULE_DESCRIPTION(DRIVER_NAME); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/b2c2/flexcop.h b/drivers/media/common/b2c2/flexcop.h -new file mode 100644 -index 0000000..897b10c ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop.h -@@ -0,0 +1,29 @@ -+/* -+ * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * flexcop.h - private header file for all flexcop-chip-source files -+ * see flexcop.c for copyright information -+ */ -+#ifndef __FLEXCOP_H__ -+#define __FLEXCOP_H___ -+ -+#define FC_LOG_PREFIX "b2c2-flexcop" -+#include "flexcop-common.h" -+ -+extern int b2c2_flexcop_debug; -+ -+/* debug */ -+#ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG -+#define dprintk(level,args...) \ -+ do { if ((b2c2_flexcop_debug & level)) printk(args); } while (0) -+#else -+#define dprintk(level,args...) -+#endif -+ -+#define deb_info(args...) dprintk(0x01, args) -+#define deb_tuner(args...) dprintk(0x02, args) -+#define deb_i2c(args...) dprintk(0x04, args) -+#define deb_ts(args...) dprintk(0x08, args) -+#define deb_sram(args...) dprintk(0x10, args) -+#define deb_rdump(args...) dprintk(0x20, args) -+ -+#endif -diff --git a/drivers/media/common/b2c2/flexcop_ibi_value_be.h b/drivers/media/common/b2c2/flexcop_ibi_value_be.h -new file mode 100644 -index 0000000..8f64bdb ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop_ibi_value_be.h -@@ -0,0 +1,455 @@ -+/* Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * register descriptions -+ * see flexcop.c for copyright information -+ */ -+/* This file is automatically generated, do not edit things here. */ -+#ifndef __FLEXCOP_IBI_VALUE_INCLUDED__ -+#define __FLEXCOP_IBI_VALUE_INCLUDED__ -+ -+typedef union { -+ u32 raw; -+ -+ struct { -+ u32 dma_address0 :30; -+ u32 dma_0No_update : 1; -+ u32 dma_0start : 1; -+ } dma_0x0; -+ -+ struct { -+ u32 dma_addr_size :24; -+ u32 DMA_maxpackets : 8; -+ } dma_0x4_remap; -+ -+ struct { -+ u32 dma_addr_size :24; -+ u32 unused : 1; -+ u32 dma1timer : 7; -+ } dma_0x4_read; -+ -+ struct { -+ u32 dma_addr_size :24; -+ u32 dmatimer : 7; -+ u32 unused : 1; -+ } dma_0x4_write; -+ -+ struct { -+ u32 dma_cur_addr :30; -+ u32 unused : 2; -+ } dma_0x8; -+ -+ struct { -+ u32 dma_address1 :30; -+ u32 remap_enable : 1; -+ u32 dma_1start : 1; -+ } dma_0xc; -+ -+ struct { -+ u32 st_done : 1; -+ u32 no_base_addr_ack_error : 1; -+ u32 twoWS_port_reg : 2; -+ u32 total_bytes : 2; -+ u32 twoWS_rw : 1; -+ u32 working_start : 1; -+ u32 data1_reg : 8; -+ u32 baseaddr : 8; -+ u32 reserved1 : 1; -+ u32 chipaddr : 7; -+ } tw_sm_c_100; -+ -+ struct { -+ u32 unused : 6; -+ u32 force_stop : 1; -+ u32 exlicit_stops : 1; -+ u32 data4_reg : 8; -+ u32 data3_reg : 8; -+ u32 data2_reg : 8; -+ } tw_sm_c_104; -+ -+ struct { -+ u32 reserved2 :19; -+ u32 tlo1 : 5; -+ u32 reserved1 : 2; -+ u32 thi1 : 6; -+ } tw_sm_c_108; -+ -+ struct { -+ u32 reserved2 :19; -+ u32 tlo1 : 5; -+ u32 reserved1 : 2; -+ u32 thi1 : 6; -+ } tw_sm_c_10c; -+ -+ struct { -+ u32 reserved2 :19; -+ u32 tlo1 : 5; -+ u32 reserved1 : 2; -+ u32 thi1 : 6; -+ } tw_sm_c_110; -+ -+ struct { -+ u32 LNB_CTLPrescaler_sig : 2; -+ u32 LNB_CTLLowCount_sig :15; -+ u32 LNB_CTLHighCount_sig :15; -+ } lnb_switch_freq_200; -+ -+ struct { -+ u32 Rev_N_sig_reserved2 : 1; -+ u32 Rev_N_sig_caps : 1; -+ u32 Rev_N_sig_reserved1 : 2; -+ u32 Rev_N_sig_revision_hi : 4; -+ u32 reserved :20; -+ u32 Per_reset_sig : 1; -+ u32 LNB_L_H_sig : 1; -+ u32 ACPI3_sig : 1; -+ u32 ACPI1_sig : 1; -+ } misc_204; -+ -+ struct { -+ u32 unused : 9; -+ u32 Mailbox_from_V8_Enable_sig : 1; -+ u32 DMA2_Size_IRQ_Enable_sig : 1; -+ u32 DMA1_Size_IRQ_Enable_sig : 1; -+ u32 DMA2_Timer_Enable_sig : 1; -+ u32 DMA2_IRQ_Enable_sig : 1; -+ u32 DMA1_Timer_Enable_sig : 1; -+ u32 DMA1_IRQ_Enable_sig : 1; -+ u32 Rcv_Data_sig : 1; -+ u32 MAC_filter_Mode_sig : 1; -+ u32 Multi2_Enable_sig : 1; -+ u32 Per_CA_Enable_sig : 1; -+ u32 SMC_Enable_sig : 1; -+ u32 CA_Enable_sig : 1; -+ u32 WAN_CA_Enable_sig : 1; -+ u32 WAN_Enable_sig : 1; -+ u32 Mask_filter_sig : 1; -+ u32 Null_filter_sig : 1; -+ u32 ECM_filter_sig : 1; -+ u32 EMM_filter_sig : 1; -+ u32 PMT_filter_sig : 1; -+ u32 PCR_filter_sig : 1; -+ u32 Stream2_filter_sig : 1; -+ u32 Stream1_filter_sig : 1; -+ } ctrl_208; -+ -+ struct { -+ u32 reserved :21; -+ u32 Transport_Error : 1; -+ u32 LLC_SNAP_FLAG_set : 1; -+ u32 Continuity_error_flag : 1; -+ u32 Data_receiver_error : 1; -+ u32 Mailbox_from_V8_Status_sig : 1; -+ u32 DMA2_Size_IRQ_Status : 1; -+ u32 DMA1_Size_IRQ_Status : 1; -+ u32 DMA2_Timer_Status : 1; -+ u32 DMA2_IRQ_Status : 1; -+ u32 DMA1_Timer_Status : 1; -+ u32 DMA1_IRQ_Status : 1; -+ } irq_20c; -+ -+ struct { -+ u32 Special_controls :16; -+ u32 Block_reset_enable : 8; -+ u32 reset_block_700 : 1; -+ u32 reset_block_600 : 1; -+ u32 reset_block_500 : 1; -+ u32 reset_block_400 : 1; -+ u32 reset_block_300 : 1; -+ u32 reset_block_200 : 1; -+ u32 reset_block_100 : 1; -+ u32 reset_block_000 : 1; -+ } sw_reset_210; -+ -+ struct { -+ u32 unused2 :20; -+ u32 polarity_PS_ERR_sig : 1; -+ u32 polarity_PS_SYNC_sig : 1; -+ u32 polarity_PS_VALID_sig : 1; -+ u32 polarity_PS_CLK_sig : 1; -+ u32 unused1 : 3; -+ u32 s2p_sel_sig : 1; -+ u32 section_pkg_enable_sig : 1; -+ u32 halt_V8_sig : 1; -+ u32 v2WS_oe_sig : 1; -+ u32 vuart_oe_sig : 1; -+ } misc_214; -+ -+ struct { -+ u32 Mailbox_from_V8 :32; -+ } mbox_v8_to_host_218; -+ -+ struct { -+ u32 sysramaccess_busmuster : 1; -+ u32 sysramaccess_write : 1; -+ u32 unused : 7; -+ u32 sysramaccess_addr :15; -+ u32 sysramaccess_data : 8; -+ } mbox_host_to_v8_21c; -+ -+ struct { -+ u32 debug_fifo_problem : 1; -+ u32 debug_flag_write_status00 : 1; -+ u32 Stream2_trans : 1; -+ u32 Stream2_PID :13; -+ u32 debug_flag_pid_saved : 1; -+ u32 MAC_Multicast_filter : 1; -+ u32 Stream1_trans : 1; -+ u32 Stream1_PID :13; -+ } pid_filter_300; -+ -+ struct { -+ u32 reserved : 2; -+ u32 PMT_trans : 1; -+ u32 PMT_PID :13; -+ u32 debug_overrun2 : 1; -+ u32 debug_overrun3 : 1; -+ u32 PCR_trans : 1; -+ u32 PCR_PID :13; -+ } pid_filter_304; -+ -+ struct { -+ u32 reserved : 2; -+ u32 ECM_trans : 1; -+ u32 ECM_PID :13; -+ u32 EMM_filter_6 : 1; -+ u32 EMM_filter_4 : 1; -+ u32 EMM_trans : 1; -+ u32 EMM_PID :13; -+ } pid_filter_308; -+ -+ struct { -+ u32 unused2 : 3; -+ u32 Group_mask :13; -+ u32 unused1 : 2; -+ u32 Group_trans : 1; -+ u32 Group_PID :13; -+ } pid_filter_30c_ext_ind_0_7; -+ -+ struct { -+ u32 unused :15; -+ u32 net_master_read :17; -+ } pid_filter_30c_ext_ind_1; -+ -+ struct { -+ u32 unused :15; -+ u32 net_master_write :17; -+ } pid_filter_30c_ext_ind_2; -+ -+ struct { -+ u32 unused :15; -+ u32 next_net_master_write :17; -+ } pid_filter_30c_ext_ind_3; -+ -+ struct { -+ u32 reserved2 : 5; -+ u32 stack_read :10; -+ u32 reserved1 : 6; -+ u32 state_write :10; -+ u32 unused1 : 1; -+ } pid_filter_30c_ext_ind_4; -+ -+ struct { -+ u32 unused :22; -+ u32 stack_cnt :10; -+ } pid_filter_30c_ext_ind_5; -+ -+ struct { -+ u32 unused : 4; -+ u32 data_size_reg :12; -+ u32 write_status4 : 2; -+ u32 write_status1 : 2; -+ u32 pid_fsm_save_reg300 : 2; -+ u32 pid_fsm_save_reg4 : 2; -+ u32 pid_fsm_save_reg3 : 2; -+ u32 pid_fsm_save_reg2 : 2; -+ u32 pid_fsm_save_reg1 : 2; -+ u32 pid_fsm_save_reg0 : 2; -+ } pid_filter_30c_ext_ind_6; -+ -+ struct { -+ u32 unused :22; -+ u32 pass_alltables : 1; -+ u32 AB_select : 1; -+ u32 extra_index_reg : 3; -+ u32 index_reg : 5; -+ } index_reg_310; -+ -+ struct { -+ u32 reserved :17; -+ u32 PID_enable_bit : 1; -+ u32 PID_trans : 1; -+ u32 PID :13; -+ } pid_n_reg_314; -+ -+ struct { -+ u32 reserved : 6; -+ u32 HighAB_bit : 1; -+ u32 Enable_bit : 1; -+ u32 A6_byte : 8; -+ u32 A5_byte : 8; -+ u32 A4_byte : 8; -+ } mac_low_reg_318; -+ -+ struct { -+ u32 reserved : 8; -+ u32 A3_byte : 8; -+ u32 A2_byte : 8; -+ u32 A1_byte : 8; -+ } mac_high_reg_31c; -+ -+ struct { -+ u32 data_Tag_ID :16; -+ u32 reserved :16; -+ } data_tag_400; -+ -+ struct { -+ u32 Card_IDbyte3 : 8; -+ u32 Card_IDbyte4 : 8; -+ u32 Card_IDbyte5 : 8; -+ u32 Card_IDbyte6 : 8; -+ } card_id_408; -+ -+ struct { -+ u32 Card_IDbyte1 : 8; -+ u32 Card_IDbyte2 : 8; -+ } card_id_40c; -+ -+ struct { -+ u32 MAC6 : 8; -+ u32 MAC3 : 8; -+ u32 MAC2 : 8; -+ u32 MAC1 : 8; -+ } mac_address_418; -+ -+ struct { -+ u32 reserved :16; -+ u32 MAC8 : 8; -+ u32 MAC7 : 8; -+ } mac_address_41c; -+ -+ struct { -+ u32 reserved :21; -+ u32 txbuffempty : 1; -+ u32 ReceiveByteFrameError : 1; -+ u32 ReceiveDataReady : 1; -+ u32 transmitter_data_byte : 8; -+ } ci_600; -+ -+ struct { -+ u32 pi_component_reg : 3; -+ u32 pi_rw : 1; -+ u32 pi_ha :20; -+ u32 pi_d : 8; -+ } pi_604; -+ -+ struct { -+ u32 pi_busy_n : 1; -+ u32 pi_wait_n : 1; -+ u32 pi_timeout_status : 1; -+ u32 pi_CiMax_IRQ_n : 1; -+ u32 config_cclk : 1; -+ u32 config_cs_n : 1; -+ u32 config_wr_n : 1; -+ u32 config_Prog_n : 1; -+ u32 config_Init_stat : 1; -+ u32 config_Done_stat : 1; -+ u32 pcmcia_b_mod_pwr_n : 1; -+ u32 pcmcia_a_mod_pwr_n : 1; -+ u32 reserved : 3; -+ u32 Timer_addr : 5; -+ u32 unused : 1; -+ u32 timer_data : 7; -+ u32 Timer_Load_req : 1; -+ u32 Timer_Read_req : 1; -+ u32 oncecycle_read : 1; -+ u32 serialReset : 1; -+ } pi_608; -+ -+ struct { -+ u32 reserved : 6; -+ u32 rw_flag : 1; -+ u32 dvb_en : 1; -+ u32 key_array_row : 5; -+ u32 key_array_col : 3; -+ u32 key_code : 2; -+ u32 key_enable : 1; -+ u32 PID :13; -+ } dvb_reg_60c; -+ -+ struct { -+ u32 start_sram_ibi : 1; -+ u32 reserved2 : 1; -+ u32 ce_pin_reg : 1; -+ u32 oe_pin_reg : 1; -+ u32 reserved1 : 3; -+ u32 sc_xfer_bit : 1; -+ u32 sram_data : 8; -+ u32 sram_rw : 1; -+ u32 sram_addr :15; -+ } sram_ctrl_reg_700; -+ -+ struct { -+ u32 net_addr_write :16; -+ u32 net_addr_read :16; -+ } net_buf_reg_704; -+ -+ struct { -+ u32 cai_cnt : 4; -+ u32 reserved2 : 6; -+ u32 cai_write :11; -+ u32 reserved1 : 5; -+ u32 cai_read :11; -+ } cai_buf_reg_708; -+ -+ struct { -+ u32 cao_cnt : 4; -+ u32 reserved2 : 6; -+ u32 cap_write :11; -+ u32 reserved1 : 5; -+ u32 cao_read :11; -+ } cao_buf_reg_70c; -+ -+ struct { -+ u32 media_cnt : 4; -+ u32 reserved2 : 6; -+ u32 media_write :11; -+ u32 reserved1 : 5; -+ u32 media_read :11; -+ } media_buf_reg_710; -+ -+ struct { -+ u32 reserved :17; -+ u32 ctrl_maximumfill : 1; -+ u32 ctrl_sramdma : 1; -+ u32 ctrl_usb_wan : 1; -+ u32 cao_ovflow_error : 1; -+ u32 cai_ovflow_error : 1; -+ u32 media_ovflow_error : 1; -+ u32 net_ovflow_error : 1; -+ u32 MEDIA_Dest : 2; -+ u32 CAO_Dest : 2; -+ u32 CAI_Dest : 2; -+ u32 NET_Dest : 2; -+ } sram_dest_reg_714; -+ -+ struct { -+ u32 reserved3 :11; -+ u32 net_addr_write : 1; -+ u32 reserved2 : 3; -+ u32 net_addr_read : 1; -+ u32 reserved1 : 4; -+ u32 net_cnt :12; -+ } net_buf_reg_718; -+ -+ struct { -+ u32 reserved3 : 4; -+ u32 wan_pkt_frame : 4; -+ u32 reserved2 : 4; -+ u32 sram_memmap : 2; -+ u32 sram_chip : 2; -+ u32 wan_wait_state : 8; -+ u32 reserved1 : 6; -+ u32 wan_speed_sig : 2; -+ } wan_ctrl_reg_71c; -+} flexcop_ibi_value; -+ -+#endif -diff --git a/drivers/media/common/b2c2/flexcop_ibi_value_le.h b/drivers/media/common/b2c2/flexcop_ibi_value_le.h -new file mode 100644 -index 0000000..c75830d ---- /dev/null -+++ b/drivers/media/common/b2c2/flexcop_ibi_value_le.h -@@ -0,0 +1,455 @@ -+/* Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III -+ * register descriptions -+ * see flexcop.c for copyright information -+ */ -+/* This file is automatically generated, do not edit things here. */ -+#ifndef __FLEXCOP_IBI_VALUE_INCLUDED__ -+#define __FLEXCOP_IBI_VALUE_INCLUDED__ -+ -+typedef union { -+ u32 raw; -+ -+ struct { -+ u32 dma_0start : 1; -+ u32 dma_0No_update : 1; -+ u32 dma_address0 :30; -+ } dma_0x0; -+ -+ struct { -+ u32 DMA_maxpackets : 8; -+ u32 dma_addr_size :24; -+ } dma_0x4_remap; -+ -+ struct { -+ u32 dma1timer : 7; -+ u32 unused : 1; -+ u32 dma_addr_size :24; -+ } dma_0x4_read; -+ -+ struct { -+ u32 unused : 1; -+ u32 dmatimer : 7; -+ u32 dma_addr_size :24; -+ } dma_0x4_write; -+ -+ struct { -+ u32 unused : 2; -+ u32 dma_cur_addr :30; -+ } dma_0x8; -+ -+ struct { -+ u32 dma_1start : 1; -+ u32 remap_enable : 1; -+ u32 dma_address1 :30; -+ } dma_0xc; -+ -+ struct { -+ u32 chipaddr : 7; -+ u32 reserved1 : 1; -+ u32 baseaddr : 8; -+ u32 data1_reg : 8; -+ u32 working_start : 1; -+ u32 twoWS_rw : 1; -+ u32 total_bytes : 2; -+ u32 twoWS_port_reg : 2; -+ u32 no_base_addr_ack_error : 1; -+ u32 st_done : 1; -+ } tw_sm_c_100; -+ -+ struct { -+ u32 data2_reg : 8; -+ u32 data3_reg : 8; -+ u32 data4_reg : 8; -+ u32 exlicit_stops : 1; -+ u32 force_stop : 1; -+ u32 unused : 6; -+ } tw_sm_c_104; -+ -+ struct { -+ u32 thi1 : 6; -+ u32 reserved1 : 2; -+ u32 tlo1 : 5; -+ u32 reserved2 :19; -+ } tw_sm_c_108; -+ -+ struct { -+ u32 thi1 : 6; -+ u32 reserved1 : 2; -+ u32 tlo1 : 5; -+ u32 reserved2 :19; -+ } tw_sm_c_10c; -+ -+ struct { -+ u32 thi1 : 6; -+ u32 reserved1 : 2; -+ u32 tlo1 : 5; -+ u32 reserved2 :19; -+ } tw_sm_c_110; -+ -+ struct { -+ u32 LNB_CTLHighCount_sig :15; -+ u32 LNB_CTLLowCount_sig :15; -+ u32 LNB_CTLPrescaler_sig : 2; -+ } lnb_switch_freq_200; -+ -+ struct { -+ u32 ACPI1_sig : 1; -+ u32 ACPI3_sig : 1; -+ u32 LNB_L_H_sig : 1; -+ u32 Per_reset_sig : 1; -+ u32 reserved :20; -+ u32 Rev_N_sig_revision_hi : 4; -+ u32 Rev_N_sig_reserved1 : 2; -+ u32 Rev_N_sig_caps : 1; -+ u32 Rev_N_sig_reserved2 : 1; -+ } misc_204; -+ -+ struct { -+ u32 Stream1_filter_sig : 1; -+ u32 Stream2_filter_sig : 1; -+ u32 PCR_filter_sig : 1; -+ u32 PMT_filter_sig : 1; -+ u32 EMM_filter_sig : 1; -+ u32 ECM_filter_sig : 1; -+ u32 Null_filter_sig : 1; -+ u32 Mask_filter_sig : 1; -+ u32 WAN_Enable_sig : 1; -+ u32 WAN_CA_Enable_sig : 1; -+ u32 CA_Enable_sig : 1; -+ u32 SMC_Enable_sig : 1; -+ u32 Per_CA_Enable_sig : 1; -+ u32 Multi2_Enable_sig : 1; -+ u32 MAC_filter_Mode_sig : 1; -+ u32 Rcv_Data_sig : 1; -+ u32 DMA1_IRQ_Enable_sig : 1; -+ u32 DMA1_Timer_Enable_sig : 1; -+ u32 DMA2_IRQ_Enable_sig : 1; -+ u32 DMA2_Timer_Enable_sig : 1; -+ u32 DMA1_Size_IRQ_Enable_sig : 1; -+ u32 DMA2_Size_IRQ_Enable_sig : 1; -+ u32 Mailbox_from_V8_Enable_sig : 1; -+ u32 unused : 9; -+ } ctrl_208; -+ -+ struct { -+ u32 DMA1_IRQ_Status : 1; -+ u32 DMA1_Timer_Status : 1; -+ u32 DMA2_IRQ_Status : 1; -+ u32 DMA2_Timer_Status : 1; -+ u32 DMA1_Size_IRQ_Status : 1; -+ u32 DMA2_Size_IRQ_Status : 1; -+ u32 Mailbox_from_V8_Status_sig : 1; -+ u32 Data_receiver_error : 1; -+ u32 Continuity_error_flag : 1; -+ u32 LLC_SNAP_FLAG_set : 1; -+ u32 Transport_Error : 1; -+ u32 reserved :21; -+ } irq_20c; -+ -+ struct { -+ u32 reset_block_000 : 1; -+ u32 reset_block_100 : 1; -+ u32 reset_block_200 : 1; -+ u32 reset_block_300 : 1; -+ u32 reset_block_400 : 1; -+ u32 reset_block_500 : 1; -+ u32 reset_block_600 : 1; -+ u32 reset_block_700 : 1; -+ u32 Block_reset_enable : 8; -+ u32 Special_controls :16; -+ } sw_reset_210; -+ -+ struct { -+ u32 vuart_oe_sig : 1; -+ u32 v2WS_oe_sig : 1; -+ u32 halt_V8_sig : 1; -+ u32 section_pkg_enable_sig : 1; -+ u32 s2p_sel_sig : 1; -+ u32 unused1 : 3; -+ u32 polarity_PS_CLK_sig : 1; -+ u32 polarity_PS_VALID_sig : 1; -+ u32 polarity_PS_SYNC_sig : 1; -+ u32 polarity_PS_ERR_sig : 1; -+ u32 unused2 :20; -+ } misc_214; -+ -+ struct { -+ u32 Mailbox_from_V8 :32; -+ } mbox_v8_to_host_218; -+ -+ struct { -+ u32 sysramaccess_data : 8; -+ u32 sysramaccess_addr :15; -+ u32 unused : 7; -+ u32 sysramaccess_write : 1; -+ u32 sysramaccess_busmuster : 1; -+ } mbox_host_to_v8_21c; -+ -+ struct { -+ u32 Stream1_PID :13; -+ u32 Stream1_trans : 1; -+ u32 MAC_Multicast_filter : 1; -+ u32 debug_flag_pid_saved : 1; -+ u32 Stream2_PID :13; -+ u32 Stream2_trans : 1; -+ u32 debug_flag_write_status00 : 1; -+ u32 debug_fifo_problem : 1; -+ } pid_filter_300; -+ -+ struct { -+ u32 PCR_PID :13; -+ u32 PCR_trans : 1; -+ u32 debug_overrun3 : 1; -+ u32 debug_overrun2 : 1; -+ u32 PMT_PID :13; -+ u32 PMT_trans : 1; -+ u32 reserved : 2; -+ } pid_filter_304; -+ -+ struct { -+ u32 EMM_PID :13; -+ u32 EMM_trans : 1; -+ u32 EMM_filter_4 : 1; -+ u32 EMM_filter_6 : 1; -+ u32 ECM_PID :13; -+ u32 ECM_trans : 1; -+ u32 reserved : 2; -+ } pid_filter_308; -+ -+ struct { -+ u32 Group_PID :13; -+ u32 Group_trans : 1; -+ u32 unused1 : 2; -+ u32 Group_mask :13; -+ u32 unused2 : 3; -+ } pid_filter_30c_ext_ind_0_7; -+ -+ struct { -+ u32 net_master_read :17; -+ u32 unused :15; -+ } pid_filter_30c_ext_ind_1; -+ -+ struct { -+ u32 net_master_write :17; -+ u32 unused :15; -+ } pid_filter_30c_ext_ind_2; -+ -+ struct { -+ u32 next_net_master_write :17; -+ u32 unused :15; -+ } pid_filter_30c_ext_ind_3; -+ -+ struct { -+ u32 unused1 : 1; -+ u32 state_write :10; -+ u32 reserved1 : 6; -+ u32 stack_read :10; -+ u32 reserved2 : 5; -+ } pid_filter_30c_ext_ind_4; -+ -+ struct { -+ u32 stack_cnt :10; -+ u32 unused :22; -+ } pid_filter_30c_ext_ind_5; -+ -+ struct { -+ u32 pid_fsm_save_reg0 : 2; -+ u32 pid_fsm_save_reg1 : 2; -+ u32 pid_fsm_save_reg2 : 2; -+ u32 pid_fsm_save_reg3 : 2; -+ u32 pid_fsm_save_reg4 : 2; -+ u32 pid_fsm_save_reg300 : 2; -+ u32 write_status1 : 2; -+ u32 write_status4 : 2; -+ u32 data_size_reg :12; -+ u32 unused : 4; -+ } pid_filter_30c_ext_ind_6; -+ -+ struct { -+ u32 index_reg : 5; -+ u32 extra_index_reg : 3; -+ u32 AB_select : 1; -+ u32 pass_alltables : 1; -+ u32 unused :22; -+ } index_reg_310; -+ -+ struct { -+ u32 PID :13; -+ u32 PID_trans : 1; -+ u32 PID_enable_bit : 1; -+ u32 reserved :17; -+ } pid_n_reg_314; -+ -+ struct { -+ u32 A4_byte : 8; -+ u32 A5_byte : 8; -+ u32 A6_byte : 8; -+ u32 Enable_bit : 1; -+ u32 HighAB_bit : 1; -+ u32 reserved : 6; -+ } mac_low_reg_318; -+ -+ struct { -+ u32 A1_byte : 8; -+ u32 A2_byte : 8; -+ u32 A3_byte : 8; -+ u32 reserved : 8; -+ } mac_high_reg_31c; -+ -+ struct { -+ u32 reserved :16; -+ u32 data_Tag_ID :16; -+ } data_tag_400; -+ -+ struct { -+ u32 Card_IDbyte6 : 8; -+ u32 Card_IDbyte5 : 8; -+ u32 Card_IDbyte4 : 8; -+ u32 Card_IDbyte3 : 8; -+ } card_id_408; -+ -+ struct { -+ u32 Card_IDbyte2 : 8; -+ u32 Card_IDbyte1 : 8; -+ } card_id_40c; -+ -+ struct { -+ u32 MAC1 : 8; -+ u32 MAC2 : 8; -+ u32 MAC3 : 8; -+ u32 MAC6 : 8; -+ } mac_address_418; -+ -+ struct { -+ u32 MAC7 : 8; -+ u32 MAC8 : 8; -+ u32 reserved :16; -+ } mac_address_41c; -+ -+ struct { -+ u32 transmitter_data_byte : 8; -+ u32 ReceiveDataReady : 1; -+ u32 ReceiveByteFrameError : 1; -+ u32 txbuffempty : 1; -+ u32 reserved :21; -+ } ci_600; -+ -+ struct { -+ u32 pi_d : 8; -+ u32 pi_ha :20; -+ u32 pi_rw : 1; -+ u32 pi_component_reg : 3; -+ } pi_604; -+ -+ struct { -+ u32 serialReset : 1; -+ u32 oncecycle_read : 1; -+ u32 Timer_Read_req : 1; -+ u32 Timer_Load_req : 1; -+ u32 timer_data : 7; -+ u32 unused : 1; -+ u32 Timer_addr : 5; -+ u32 reserved : 3; -+ u32 pcmcia_a_mod_pwr_n : 1; -+ u32 pcmcia_b_mod_pwr_n : 1; -+ u32 config_Done_stat : 1; -+ u32 config_Init_stat : 1; -+ u32 config_Prog_n : 1; -+ u32 config_wr_n : 1; -+ u32 config_cs_n : 1; -+ u32 config_cclk : 1; -+ u32 pi_CiMax_IRQ_n : 1; -+ u32 pi_timeout_status : 1; -+ u32 pi_wait_n : 1; -+ u32 pi_busy_n : 1; -+ } pi_608; -+ -+ struct { -+ u32 PID :13; -+ u32 key_enable : 1; -+ u32 key_code : 2; -+ u32 key_array_col : 3; -+ u32 key_array_row : 5; -+ u32 dvb_en : 1; -+ u32 rw_flag : 1; -+ u32 reserved : 6; -+ } dvb_reg_60c; -+ -+ struct { -+ u32 sram_addr :15; -+ u32 sram_rw : 1; -+ u32 sram_data : 8; -+ u32 sc_xfer_bit : 1; -+ u32 reserved1 : 3; -+ u32 oe_pin_reg : 1; -+ u32 ce_pin_reg : 1; -+ u32 reserved2 : 1; -+ u32 start_sram_ibi : 1; -+ } sram_ctrl_reg_700; -+ -+ struct { -+ u32 net_addr_read :16; -+ u32 net_addr_write :16; -+ } net_buf_reg_704; -+ -+ struct { -+ u32 cai_read :11; -+ u32 reserved1 : 5; -+ u32 cai_write :11; -+ u32 reserved2 : 6; -+ u32 cai_cnt : 4; -+ } cai_buf_reg_708; -+ -+ struct { -+ u32 cao_read :11; -+ u32 reserved1 : 5; -+ u32 cap_write :11; -+ u32 reserved2 : 6; -+ u32 cao_cnt : 4; -+ } cao_buf_reg_70c; -+ -+ struct { -+ u32 media_read :11; -+ u32 reserved1 : 5; -+ u32 media_write :11; -+ u32 reserved2 : 6; -+ u32 media_cnt : 4; -+ } media_buf_reg_710; -+ -+ struct { -+ u32 NET_Dest : 2; -+ u32 CAI_Dest : 2; -+ u32 CAO_Dest : 2; -+ u32 MEDIA_Dest : 2; -+ u32 net_ovflow_error : 1; -+ u32 media_ovflow_error : 1; -+ u32 cai_ovflow_error : 1; -+ u32 cao_ovflow_error : 1; -+ u32 ctrl_usb_wan : 1; -+ u32 ctrl_sramdma : 1; -+ u32 ctrl_maximumfill : 1; -+ u32 reserved :17; -+ } sram_dest_reg_714; -+ -+ struct { -+ u32 net_cnt :12; -+ u32 reserved1 : 4; -+ u32 net_addr_read : 1; -+ u32 reserved2 : 3; -+ u32 net_addr_write : 1; -+ u32 reserved3 :11; -+ } net_buf_reg_718; -+ -+ struct { -+ u32 wan_speed_sig : 2; -+ u32 reserved1 : 6; -+ u32 wan_wait_state : 8; -+ u32 sram_chip : 2; -+ u32 sram_memmap : 2; -+ u32 reserved2 : 4; -+ u32 wan_pkt_frame : 4; -+ u32 reserved3 : 4; -+ } wan_ctrl_reg_71c; -+} flexcop_ibi_value; -+ -+#endif -diff --git a/drivers/media/common/saa7146/Kconfig b/drivers/media/common/saa7146/Kconfig -new file mode 100644 -index 0000000..769c6f8 ---- /dev/null -+++ b/drivers/media/common/saa7146/Kconfig -@@ -0,0 +1,9 @@ -+config VIDEO_SAA7146 -+ tristate -+ depends on I2C && PCI -+ -+config VIDEO_SAA7146_VV -+ tristate -+ depends on VIDEO_V4L2 -+ select VIDEOBUF_DMA_SG -+ select VIDEO_SAA7146 -diff --git a/drivers/media/common/saa7146/Makefile b/drivers/media/common/saa7146/Makefile -new file mode 100644 -index 0000000..3219b00 ---- /dev/null -+++ b/drivers/media/common/saa7146/Makefile -@@ -0,0 +1,5 @@ -+saa7146-objs := saa7146_i2c.o saa7146_core.o -+saa7146_vv-objs := saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o -+ -+obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o -+obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o -diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c -new file mode 100644 -index 0000000..bb6ee51 ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_core.c -@@ -0,0 +1,592 @@ -+/* -+ saa7146.o - driver for generic saa7146-based hardware -+ -+ Copyright (C) 1998-2003 Michael Hunold -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+*/ -+ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+ -+static int saa7146_num; -+ -+unsigned int saa7146_debug; -+ -+module_param(saa7146_debug, uint, 0644); -+MODULE_PARM_DESC(saa7146_debug, "debug level (default: 0)"); -+ -+#if 0 -+static void dump_registers(struct saa7146_dev* dev) -+{ -+ int i = 0; -+ -+ pr_info(" @ %li jiffies:\n", jiffies); -+ for (i = 0; i <= 0x148; i += 4) -+ pr_info("0x%03x: 0x%08x\n", i, saa7146_read(dev, i)); -+} -+#endif -+ -+/**************************************************************************** -+ * gpio and debi helper functions -+ ****************************************************************************/ -+ -+void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data) -+{ -+ u32 value = 0; -+ -+ BUG_ON(port > 3); -+ -+ value = saa7146_read(dev, GPIO_CTRL); -+ value &= ~(0xff << (8*port)); -+ value |= (data << (8*port)); -+ saa7146_write(dev, GPIO_CTRL, value); -+} -+ -+/* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */ -+static inline int saa7146_wait_for_debi_done_sleep(struct saa7146_dev *dev, -+ unsigned long us1, unsigned long us2) -+{ -+ unsigned long timeout; -+ int err; -+ -+ /* wait for registers to be programmed */ -+ timeout = jiffies + usecs_to_jiffies(us1); -+ while (1) { -+ err = time_after(jiffies, timeout); -+ if (saa7146_read(dev, MC2) & 2) -+ break; -+ if (err) { -+ pr_err("%s: %s timed out while waiting for registers getting programmed\n", -+ dev->name, __func__); -+ return -ETIMEDOUT; -+ } -+ msleep(1); -+ } -+ -+ /* wait for transfer to complete */ -+ timeout = jiffies + usecs_to_jiffies(us2); -+ while (1) { -+ err = time_after(jiffies, timeout); -+ if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) -+ break; -+ saa7146_read(dev, MC2); -+ if (err) { -+ DEB_S("%s: %s timed out while waiting for transfer completion\n", -+ dev->name, __func__); -+ return -ETIMEDOUT; -+ } -+ msleep(1); -+ } -+ -+ return 0; -+} -+ -+static inline int saa7146_wait_for_debi_done_busyloop(struct saa7146_dev *dev, -+ unsigned long us1, unsigned long us2) -+{ -+ unsigned long loops; -+ -+ /* wait for registers to be programmed */ -+ loops = us1; -+ while (1) { -+ if (saa7146_read(dev, MC2) & 2) -+ break; -+ if (!loops--) { -+ pr_err("%s: %s timed out while waiting for registers getting programmed\n", -+ dev->name, __func__); -+ return -ETIMEDOUT; -+ } -+ udelay(1); -+ } -+ -+ /* wait for transfer to complete */ -+ loops = us2 / 5; -+ while (1) { -+ if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) -+ break; -+ saa7146_read(dev, MC2); -+ if (!loops--) { -+ DEB_S("%s: %s timed out while waiting for transfer completion\n", -+ dev->name, __func__); -+ return -ETIMEDOUT; -+ } -+ udelay(5); -+ } -+ -+ return 0; -+} -+ -+int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) -+{ -+ if (nobusyloop) -+ return saa7146_wait_for_debi_done_sleep(dev, 50000, 250000); -+ else -+ return saa7146_wait_for_debi_done_busyloop(dev, 50000, 250000); -+} -+ -+/**************************************************************************** -+ * general helper functions -+ ****************************************************************************/ -+ -+/* this is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c -+ make sure virt has been allocated with vmalloc_32(), otherwise the BUG() -+ may be triggered on highmem machines */ -+static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) -+{ -+ struct scatterlist *sglist; -+ struct page *pg; -+ int i; -+ -+ sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); -+ if (NULL == sglist) -+ return NULL; -+ sg_init_table(sglist, nr_pages); -+ for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { -+ pg = vmalloc_to_page(virt); -+ if (NULL == pg) -+ goto err; -+ BUG_ON(PageHighMem(pg)); -+ sg_set_page(&sglist[i], pg, PAGE_SIZE, 0); -+ } -+ return sglist; -+ -+ err: -+ kfree(sglist); -+ return NULL; -+} -+ -+/********************************************************************************/ -+/* common page table functions */ -+ -+void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt) -+{ -+ int pages = (length+PAGE_SIZE-1)/PAGE_SIZE; -+ void *mem = vmalloc_32(length); -+ int slen = 0; -+ -+ if (NULL == mem) -+ goto err_null; -+ -+ if (!(pt->slist = vmalloc_to_sg(mem, pages))) -+ goto err_free_mem; -+ -+ if (saa7146_pgtable_alloc(pci, pt)) -+ goto err_free_slist; -+ -+ pt->nents = pages; -+ slen = pci_map_sg(pci,pt->slist,pt->nents,PCI_DMA_FROMDEVICE); -+ if (0 == slen) -+ goto err_free_pgtable; -+ -+ if (0 != saa7146_pgtable_build_single(pci, pt, pt->slist, slen)) -+ goto err_unmap_sg; -+ -+ return mem; -+ -+err_unmap_sg: -+ pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); -+err_free_pgtable: -+ saa7146_pgtable_free(pci, pt); -+err_free_slist: -+ kfree(pt->slist); -+ pt->slist = NULL; -+err_free_mem: -+ vfree(mem); -+err_null: -+ return NULL; -+} -+ -+void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa7146_pgtable *pt) -+{ -+ pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); -+ saa7146_pgtable_free(pci, pt); -+ kfree(pt->slist); -+ pt->slist = NULL; -+ vfree(mem); -+} -+ -+void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt) -+{ -+ if (NULL == pt->cpu) -+ return; -+ pci_free_consistent(pci, pt->size, pt->cpu, pt->dma); -+ pt->cpu = NULL; -+} -+ -+int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt) -+{ -+ __le32 *cpu; -+ dma_addr_t dma_addr = 0; -+ -+ cpu = pci_alloc_consistent(pci, PAGE_SIZE, &dma_addr); -+ if (NULL == cpu) { -+ return -ENOMEM; -+ } -+ pt->size = PAGE_SIZE; -+ pt->cpu = cpu; -+ pt->dma = dma_addr; -+ -+ return 0; -+} -+ -+int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, -+ struct scatterlist *list, int sglen ) -+{ -+ __le32 *ptr, fill; -+ int nr_pages = 0; -+ int i,p; -+ -+ BUG_ON(0 == sglen); -+ BUG_ON(list->offset > PAGE_SIZE); -+ -+ /* if we have a user buffer, the first page may not be -+ aligned to a page boundary. */ -+ pt->offset = list->offset; -+ -+ ptr = pt->cpu; -+ for (i = 0; i < sglen; i++, list++) { -+/* -+ pr_debug("i:%d, adr:0x%08x, len:%d, offset:%d\n", -+ i, sg_dma_address(list), sg_dma_len(list), -+ list->offset); -+*/ -+ for (p = 0; p * 4096 < list->length; p++, ptr++) { -+ *ptr = cpu_to_le32(sg_dma_address(list) + p * 4096); -+ nr_pages++; -+ } -+ } -+ -+ -+ /* safety; fill the page table up with the last valid page */ -+ fill = *(ptr-1); -+ for(i=nr_pages;i<1024;i++) { -+ *ptr++ = fill; -+ } -+ -+/* -+ ptr = pt->cpu; -+ pr_debug("offset: %d\n", pt->offset); -+ for(i=0;i<5;i++) { -+ pr_debug("ptr1 %d: 0x%08x\n", i, ptr[i]); -+ } -+*/ -+ return 0; -+} -+ -+/********************************************************************************/ -+/* interrupt handler */ -+static irqreturn_t interrupt_hw(int irq, void *dev_id) -+{ -+ struct saa7146_dev *dev = dev_id; -+ u32 isr; -+ u32 ack_isr; -+ -+ /* read out the interrupt status register */ -+ ack_isr = isr = saa7146_read(dev, ISR); -+ -+ /* is this our interrupt? */ -+ if ( 0 == isr ) { -+ /* nope, some other device */ -+ return IRQ_NONE; -+ } -+ -+ if (dev->ext) { -+ if (dev->ext->irq_mask & isr) { -+ if (dev->ext->irq_func) -+ dev->ext->irq_func(dev, &isr); -+ isr &= ~dev->ext->irq_mask; -+ } -+ } -+ if (0 != (isr & (MASK_27))) { -+ DEB_INT("irq: RPS0 (0x%08x)\n", isr); -+ if (dev->vv_data && dev->vv_callback) -+ dev->vv_callback(dev,isr); -+ isr &= ~MASK_27; -+ } -+ if (0 != (isr & (MASK_28))) { -+ if (dev->vv_data && dev->vv_callback) -+ dev->vv_callback(dev,isr); -+ isr &= ~MASK_28; -+ } -+ if (0 != (isr & (MASK_16|MASK_17))) { -+ SAA7146_IER_DISABLE(dev, MASK_16|MASK_17); -+ /* only wake up if we expect something */ -+ if (0 != dev->i2c_op) { -+ dev->i2c_op = 0; -+ wake_up(&dev->i2c_wq); -+ } else { -+ u32 psr = saa7146_read(dev, PSR); -+ u32 ssr = saa7146_read(dev, SSR); -+ pr_warn("%s: unexpected i2c irq: isr %08x psr %08x ssr %08x\n", -+ dev->name, isr, psr, ssr); -+ } -+ isr &= ~(MASK_16|MASK_17); -+ } -+ if( 0 != isr ) { -+ ERR("warning: interrupt enabled, but not handled properly.(0x%08x)\n", -+ isr); -+ ERR("disabling interrupt source(s)!\n"); -+ SAA7146_IER_DISABLE(dev,isr); -+ } -+ saa7146_write(dev, ISR, ack_isr); -+ return IRQ_HANDLED; -+} -+ -+/*********************************************************************************/ -+/* configuration-functions */ -+ -+static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent) -+{ -+ struct saa7146_pci_extension_data *pci_ext = (struct saa7146_pci_extension_data *)ent->driver_data; -+ struct saa7146_extension *ext = pci_ext->ext; -+ struct saa7146_dev *dev; -+ int err = -ENOMEM; -+ -+ /* clear out mem for sure */ -+ dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL); -+ if (!dev) { -+ ERR("out of memory\n"); -+ goto out; -+ } -+ -+ DEB_EE("pci:%p\n", pci); -+ -+ err = pci_enable_device(pci); -+ if (err < 0) { -+ ERR("pci_enable_device() failed\n"); -+ goto err_free; -+ } -+ -+ /* enable bus-mastering */ -+ pci_set_master(pci); -+ -+ dev->pci = pci; -+ -+ /* get chip-revision; this is needed to enable bug-fixes */ -+ dev->revision = pci->revision; -+ -+ /* remap the memory from virtual to physical address */ -+ -+ err = pci_request_region(pci, 0, "saa7146"); -+ if (err < 0) -+ goto err_disable; -+ -+ dev->mem = ioremap(pci_resource_start(pci, 0), -+ pci_resource_len(pci, 0)); -+ if (!dev->mem) { -+ ERR("ioremap() failed\n"); -+ err = -ENODEV; -+ goto err_release; -+ } -+ -+ /* we don't do a master reset here anymore, it screws up -+ some boards that don't have an i2c-eeprom for configuration -+ values */ -+/* -+ saa7146_write(dev, MC1, MASK_31); -+*/ -+ -+ /* disable all irqs */ -+ saa7146_write(dev, IER, 0); -+ -+ /* shut down all dma transfers and rps tasks */ -+ saa7146_write(dev, MC1, 0x30ff0000); -+ -+ /* clear out any rps-signals pending */ -+ saa7146_write(dev, MC2, 0xf8000000); -+ -+ /* request an interrupt for the saa7146 */ -+ err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED | IRQF_DISABLED, -+ dev->name, dev); -+ if (err < 0) { -+ ERR("request_irq() failed\n"); -+ goto err_unmap; -+ } -+ -+ err = -ENOMEM; -+ -+ /* get memory for various stuff */ -+ dev->d_rps0.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -+ &dev->d_rps0.dma_handle); -+ if (!dev->d_rps0.cpu_addr) -+ goto err_free_irq; -+ memset(dev->d_rps0.cpu_addr, 0x0, SAA7146_RPS_MEM); -+ -+ dev->d_rps1.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -+ &dev->d_rps1.dma_handle); -+ if (!dev->d_rps1.cpu_addr) -+ goto err_free_rps0; -+ memset(dev->d_rps1.cpu_addr, 0x0, SAA7146_RPS_MEM); -+ -+ dev->d_i2c.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -+ &dev->d_i2c.dma_handle); -+ if (!dev->d_i2c.cpu_addr) -+ goto err_free_rps1; -+ memset(dev->d_i2c.cpu_addr, 0x0, SAA7146_RPS_MEM); -+ -+ /* the rest + print status message */ -+ -+ /* create a nice device name */ -+ sprintf(dev->name, "saa7146 (%d)", saa7146_num); -+ -+ pr_info("found saa7146 @ mem %p (revision %d, irq %d) (0x%04x,0x%04x)\n", -+ dev->mem, dev->revision, pci->irq, -+ pci->subsystem_vendor, pci->subsystem_device); -+ dev->ext = ext; -+ -+ mutex_init(&dev->v4l2_lock); -+ spin_lock_init(&dev->int_slock); -+ spin_lock_init(&dev->slock); -+ -+ mutex_init(&dev->i2c_lock); -+ -+ dev->module = THIS_MODULE; -+ init_waitqueue_head(&dev->i2c_wq); -+ -+ /* set some sane pci arbitrition values */ -+ saa7146_write(dev, PCI_BT_V1, 0x1c00101f); -+ -+ /* TODO: use the status code of the callback */ -+ -+ err = -ENODEV; -+ -+ if (ext->probe && ext->probe(dev)) { -+ DEB_D("ext->probe() failed for %p. skipping device.\n", dev); -+ goto err_free_i2c; -+ } -+ -+ if (ext->attach(dev, pci_ext)) { -+ DEB_D("ext->attach() failed for %p. skipping device.\n", dev); -+ goto err_free_i2c; -+ } -+ /* V4L extensions will set the pci drvdata to the v4l2_device in the -+ attach() above. So for those cards that do not use V4L we have to -+ set it explicitly. */ -+ pci_set_drvdata(pci, &dev->v4l2_dev); -+ -+ saa7146_num++; -+ -+ err = 0; -+out: -+ return err; -+ -+err_free_i2c: -+ pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_i2c.cpu_addr, -+ dev->d_i2c.dma_handle); -+err_free_rps1: -+ pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_rps1.cpu_addr, -+ dev->d_rps1.dma_handle); -+err_free_rps0: -+ pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_rps0.cpu_addr, -+ dev->d_rps0.dma_handle); -+err_free_irq: -+ free_irq(pci->irq, (void *)dev); -+err_unmap: -+ iounmap(dev->mem); -+err_release: -+ pci_release_region(pci, 0); -+err_disable: -+ pci_disable_device(pci); -+err_free: -+ kfree(dev); -+ goto out; -+} -+ -+static void saa7146_remove_one(struct pci_dev *pdev) -+{ -+ struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); -+ struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev); -+ struct { -+ void *addr; -+ dma_addr_t dma; -+ } dev_map[] = { -+ { dev->d_i2c.cpu_addr, dev->d_i2c.dma_handle }, -+ { dev->d_rps1.cpu_addr, dev->d_rps1.dma_handle }, -+ { dev->d_rps0.cpu_addr, dev->d_rps0.dma_handle }, -+ { NULL, 0 } -+ }, *p; -+ -+ DEB_EE("dev:%p\n", dev); -+ -+ dev->ext->detach(dev); -+ /* Zero the PCI drvdata after use. */ -+ pci_set_drvdata(pdev, NULL); -+ -+ /* shut down all video dma transfers */ -+ saa7146_write(dev, MC1, 0x00ff0000); -+ -+ /* disable all irqs, release irq-routine */ -+ saa7146_write(dev, IER, 0); -+ -+ free_irq(pdev->irq, dev); -+ -+ for (p = dev_map; p->addr; p++) -+ pci_free_consistent(pdev, SAA7146_RPS_MEM, p->addr, p->dma); -+ -+ iounmap(dev->mem); -+ pci_release_region(pdev, 0); -+ pci_disable_device(pdev); -+ kfree(dev); -+ -+ saa7146_num--; -+} -+ -+/*********************************************************************************/ -+/* extension handling functions */ -+ -+int saa7146_register_extension(struct saa7146_extension* ext) -+{ -+ DEB_EE("ext:%p\n", ext); -+ -+ ext->driver.name = ext->name; -+ ext->driver.id_table = ext->pci_tbl; -+ ext->driver.probe = saa7146_init_one; -+ ext->driver.remove = saa7146_remove_one; -+ -+ pr_info("register extension '%s'\n", ext->name); -+ return pci_register_driver(&ext->driver); -+} -+ -+int saa7146_unregister_extension(struct saa7146_extension* ext) -+{ -+ DEB_EE("ext:%p\n", ext); -+ pr_info("unregister extension '%s'\n", ext->name); -+ pci_unregister_driver(&ext->driver); -+ return 0; -+} -+ -+EXPORT_SYMBOL_GPL(saa7146_register_extension); -+EXPORT_SYMBOL_GPL(saa7146_unregister_extension); -+ -+/* misc functions used by extension modules */ -+EXPORT_SYMBOL_GPL(saa7146_pgtable_alloc); -+EXPORT_SYMBOL_GPL(saa7146_pgtable_free); -+EXPORT_SYMBOL_GPL(saa7146_pgtable_build_single); -+EXPORT_SYMBOL_GPL(saa7146_vmalloc_build_pgtable); -+EXPORT_SYMBOL_GPL(saa7146_vfree_destroy_pgtable); -+EXPORT_SYMBOL_GPL(saa7146_wait_for_debi_done); -+ -+EXPORT_SYMBOL_GPL(saa7146_setgpio); -+ -+EXPORT_SYMBOL_GPL(saa7146_i2c_adapter_prepare); -+ -+EXPORT_SYMBOL_GPL(saa7146_debug); -+ -+MODULE_AUTHOR("Michael Hunold "); -+MODULE_DESCRIPTION("driver for generic saa7146-based hardware"); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c -new file mode 100644 -index 0000000..eda01bc ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_fops.c -@@ -0,0 +1,663 @@ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+ -+/****************************************************************************/ -+/* resource management functions, shamelessly stolen from saa7134 driver */ -+ -+int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ if (fh->resources & bit) { -+ DEB_D("already allocated! want: 0x%02x, cur:0x%02x\n", -+ bit, vv->resources); -+ /* have it already allocated */ -+ return 1; -+ } -+ -+ /* is it free? */ -+ if (vv->resources & bit) { -+ DEB_D("locked! vv->resources:0x%02x, we want:0x%02x\n", -+ vv->resources, bit); -+ /* no, someone else uses it */ -+ return 0; -+ } -+ /* it's free, grab it */ -+ fh->resources |= bit; -+ vv->resources |= bit; -+ DEB_D("res: get 0x%02x, cur:0x%02x\n", bit, vv->resources); -+ return 1; -+} -+ -+void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ BUG_ON((fh->resources & bits) != bits); -+ -+ fh->resources &= ~bits; -+ vv->resources &= ~bits; -+ DEB_D("res: put 0x%02x, cur:0x%02x\n", bits, vv->resources); -+} -+ -+ -+/********************************************************************************/ -+/* common dma functions */ -+ -+void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q, -+ struct saa7146_buf *buf) -+{ -+ struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -+ DEB_EE("dev:%p, buf:%p\n", dev, buf); -+ -+ BUG_ON(in_interrupt()); -+ -+ videobuf_waiton(q, &buf->vb, 0, 0); -+ videobuf_dma_unmap(q->dev, dma); -+ videobuf_dma_free(dma); -+ buf->vb.state = VIDEOBUF_NEEDS_INIT; -+} -+ -+ -+/********************************************************************************/ -+/* common buffer functions */ -+ -+int saa7146_buffer_queue(struct saa7146_dev *dev, -+ struct saa7146_dmaqueue *q, -+ struct saa7146_buf *buf) -+{ -+ assert_spin_locked(&dev->slock); -+ DEB_EE("dev:%p, dmaq:%p, buf:%p\n", dev, q, buf); -+ -+ BUG_ON(!q); -+ -+ if (NULL == q->curr) { -+ q->curr = buf; -+ DEB_D("immediately activating buffer %p\n", buf); -+ buf->activate(dev,buf,NULL); -+ } else { -+ list_add_tail(&buf->vb.queue,&q->queue); -+ buf->vb.state = VIDEOBUF_QUEUED; -+ DEB_D("adding buffer %p to queue. (active buffer present)\n", -+ buf); -+ } -+ return 0; -+} -+ -+void saa7146_buffer_finish(struct saa7146_dev *dev, -+ struct saa7146_dmaqueue *q, -+ int state) -+{ -+ assert_spin_locked(&dev->slock); -+ DEB_EE("dev:%p, dmaq:%p, state:%d\n", dev, q, state); -+ DEB_EE("q->curr:%p\n", q->curr); -+ -+ BUG_ON(!q->curr); -+ -+ /* finish current buffer */ -+ if (NULL == q->curr) { -+ DEB_D("aiii. no current buffer\n"); -+ return; -+ } -+ -+ q->curr->vb.state = state; -+ v4l2_get_timestamp(&q->curr->vb.ts); -+ wake_up(&q->curr->vb.done); -+ -+ q->curr = NULL; -+} -+ -+void saa7146_buffer_next(struct saa7146_dev *dev, -+ struct saa7146_dmaqueue *q, int vbi) -+{ -+ struct saa7146_buf *buf,*next = NULL; -+ -+ BUG_ON(!q); -+ -+ DEB_INT("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi); -+ -+ assert_spin_locked(&dev->slock); -+ if (!list_empty(&q->queue)) { -+ /* activate next one from queue */ -+ buf = list_entry(q->queue.next,struct saa7146_buf,vb.queue); -+ list_del(&buf->vb.queue); -+ if (!list_empty(&q->queue)) -+ next = list_entry(q->queue.next,struct saa7146_buf, vb.queue); -+ q->curr = buf; -+ DEB_INT("next buffer: buf:%p, prev:%p, next:%p\n", -+ buf, q->queue.prev, q->queue.next); -+ buf->activate(dev,buf,next); -+ } else { -+ DEB_INT("no next buffer. stopping.\n"); -+ if( 0 != vbi ) { -+ /* turn off video-dma3 */ -+ saa7146_write(dev,MC1, MASK_20); -+ } else { -+ /* nothing to do -- just prevent next video-dma1 transfer -+ by lowering the protection address */ -+ -+ // fixme: fix this for vflip != 0 -+ -+ saa7146_write(dev, PROT_ADDR1, 0); -+ saa7146_write(dev, MC2, (MASK_02|MASK_18)); -+ -+ /* write the address of the rps-program */ -+ saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); -+ /* turn on rps */ -+ saa7146_write(dev, MC1, (MASK_12 | MASK_28)); -+ -+/* -+ printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); -+ printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); -+ printk("vdma%d.prot_addr: 0x%08x\n", 1,saa7146_read(dev,PROT_ADDR1)); -+ printk("vdma%d.base_page: 0x%08x\n", 1,saa7146_read(dev,BASE_PAGE1)); -+ printk("vdma%d.pitch: 0x%08x\n", 1,saa7146_read(dev,PITCH1)); -+ printk("vdma%d.num_line_byte: 0x%08x\n", 1,saa7146_read(dev,NUM_LINE_BYTE1)); -+*/ -+ } -+ del_timer(&q->timeout); -+ } -+} -+ -+void saa7146_buffer_timeout(unsigned long data) -+{ -+ struct saa7146_dmaqueue *q = (struct saa7146_dmaqueue*)data; -+ struct saa7146_dev *dev = q->dev; -+ unsigned long flags; -+ -+ DEB_EE("dev:%p, dmaq:%p\n", dev, q); -+ -+ spin_lock_irqsave(&dev->slock,flags); -+ if (q->curr) { -+ DEB_D("timeout on %p\n", q->curr); -+ saa7146_buffer_finish(dev,q,VIDEOBUF_ERROR); -+ } -+ -+ /* we don't restart the transfer here like other drivers do. when -+ a streaming capture is disabled, the timeout function will be -+ called for the current buffer. if we activate the next buffer now, -+ we mess up our capture logic. if a timeout occurs on another buffer, -+ then something is seriously broken before, so no need to buffer the -+ next capture IMHO... */ -+/* -+ saa7146_buffer_next(dev,q); -+*/ -+ spin_unlock_irqrestore(&dev->slock,flags); -+} -+ -+/********************************************************************************/ -+/* file operations */ -+ -+static int fops_open(struct file *file) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_dev *dev = video_drvdata(file); -+ struct saa7146_fh *fh = NULL; -+ int result = 0; -+ -+ DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); -+ -+ if (mutex_lock_interruptible(vdev->lock)) -+ return -ERESTARTSYS; -+ -+ DEB_D("using: %p\n", dev); -+ -+ /* check if an extension is registered */ -+ if( NULL == dev->ext ) { -+ DEB_S("no extension registered for this device\n"); -+ result = -ENODEV; -+ goto out; -+ } -+ -+ /* allocate per open data */ -+ fh = kzalloc(sizeof(*fh),GFP_KERNEL); -+ if (NULL == fh) { -+ DEB_S("cannot allocate memory for per open data\n"); -+ result = -ENOMEM; -+ goto out; -+ } -+ -+ v4l2_fh_init(&fh->fh, vdev); -+ -+ file->private_data = &fh->fh; -+ fh->dev = dev; -+ -+ if (vdev->vfl_type == VFL_TYPE_VBI) { -+ DEB_S("initializing vbi...\n"); -+ if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -+ result = saa7146_vbi_uops.open(dev,file); -+ if (dev->ext_vv_data->vbi_fops.open) -+ dev->ext_vv_data->vbi_fops.open(file); -+ } else { -+ DEB_S("initializing video...\n"); -+ result = saa7146_video_uops.open(dev,file); -+ } -+ -+ if (0 != result) { -+ goto out; -+ } -+ -+ if( 0 == try_module_get(dev->ext->module)) { -+ result = -EINVAL; -+ goto out; -+ } -+ -+ result = 0; -+ v4l2_fh_add(&fh->fh); -+out: -+ if (fh && result != 0) { -+ kfree(fh); -+ file->private_data = NULL; -+ } -+ mutex_unlock(vdev->lock); -+ return result; -+} -+ -+static int fops_release(struct file *file) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ -+ DEB_EE("file:%p\n", file); -+ -+ mutex_lock(vdev->lock); -+ -+ if (vdev->vfl_type == VFL_TYPE_VBI) { -+ if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -+ saa7146_vbi_uops.release(dev,file); -+ if (dev->ext_vv_data->vbi_fops.release) -+ dev->ext_vv_data->vbi_fops.release(file); -+ } else { -+ saa7146_video_uops.release(dev,file); -+ } -+ -+ v4l2_fh_del(&fh->fh); -+ v4l2_fh_exit(&fh->fh); -+ module_put(dev->ext->module); -+ file->private_data = NULL; -+ kfree(fh); -+ -+ mutex_unlock(vdev->lock); -+ -+ return 0; -+} -+ -+static int fops_mmap(struct file *file, struct vm_area_struct * vma) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_fh *fh = file->private_data; -+ struct videobuf_queue *q; -+ int res; -+ -+ switch (vdev->vfl_type) { -+ case VFL_TYPE_GRABBER: { -+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, vma:%p\n", -+ file, vma); -+ q = &fh->video_q; -+ break; -+ } -+ case VFL_TYPE_VBI: { -+ DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, vma:%p\n", -+ file, vma); -+ if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT) -+ return -ENODEV; -+ q = &fh->vbi_q; -+ break; -+ } -+ default: -+ BUG(); -+ return 0; -+ } -+ -+ if (mutex_lock_interruptible(vdev->lock)) -+ return -ERESTARTSYS; -+ res = videobuf_mmap_mapper(q, vma); -+ mutex_unlock(vdev->lock); -+ return res; -+} -+ -+static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wait) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_fh *fh = file->private_data; -+ struct videobuf_buffer *buf = NULL; -+ struct videobuf_queue *q; -+ unsigned int res = v4l2_ctrl_poll(file, wait); -+ -+ DEB_EE("file:%p, poll:%p\n", file, wait); -+ -+ if (vdev->vfl_type == VFL_TYPE_VBI) { -+ if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT) -+ return res | POLLOUT | POLLWRNORM; -+ if( 0 == fh->vbi_q.streaming ) -+ return res | videobuf_poll_stream(file, &fh->vbi_q, wait); -+ q = &fh->vbi_q; -+ } else { -+ DEB_D("using video queue\n"); -+ q = &fh->video_q; -+ } -+ -+ if (!list_empty(&q->stream)) -+ buf = list_entry(q->stream.next, struct videobuf_buffer, stream); -+ -+ if (!buf) { -+ DEB_D("buf == NULL!\n"); -+ return res | POLLERR; -+ } -+ -+ poll_wait(file, &buf->done, wait); -+ if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) { -+ DEB_D("poll succeeded!\n"); -+ return res | POLLIN | POLLRDNORM; -+ } -+ -+ DEB_D("nothing to poll for, buf->state:%d\n", buf->state); -+ return res; -+} -+ -+static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) -+{ -+ struct video_device *vdev = video_devdata(file); -+ unsigned int res; -+ -+ mutex_lock(vdev->lock); -+ res = __fops_poll(file, wait); -+ mutex_unlock(vdev->lock); -+ return res; -+} -+ -+static ssize_t fops_read(struct file *file, char __user *data, size_t count, loff_t *ppos) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_fh *fh = file->private_data; -+ int ret; -+ -+ switch (vdev->vfl_type) { -+ case VFL_TYPE_GRABBER: -+/* -+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, data:%p, count:%lun", -+ file, data, (unsigned long)count); -+*/ -+ return saa7146_video_uops.read(file,data,count,ppos); -+ case VFL_TYPE_VBI: -+/* -+ DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, data:%p, count:%lu\n", -+ file, data, (unsigned long)count); -+*/ -+ if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) { -+ if (mutex_lock_interruptible(vdev->lock)) -+ return -ERESTARTSYS; -+ ret = saa7146_vbi_uops.read(file, data, count, ppos); -+ mutex_unlock(vdev->lock); -+ return ret; -+ } -+ return -EINVAL; -+ default: -+ BUG(); -+ return 0; -+ } -+} -+ -+static ssize_t fops_write(struct file *file, const char __user *data, size_t count, loff_t *ppos) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_fh *fh = file->private_data; -+ int ret; -+ -+ switch (vdev->vfl_type) { -+ case VFL_TYPE_GRABBER: -+ return -EINVAL; -+ case VFL_TYPE_VBI: -+ if (fh->dev->ext_vv_data->vbi_fops.write) { -+ if (mutex_lock_interruptible(vdev->lock)) -+ return -ERESTARTSYS; -+ ret = fh->dev->ext_vv_data->vbi_fops.write(file, data, count, ppos); -+ mutex_unlock(vdev->lock); -+ return ret; -+ } -+ return -EINVAL; -+ default: -+ BUG(); -+ return -EINVAL; -+ } -+} -+ -+static const struct v4l2_file_operations video_fops = -+{ -+ .owner = THIS_MODULE, -+ .open = fops_open, -+ .release = fops_release, -+ .read = fops_read, -+ .write = fops_write, -+ .poll = fops_poll, -+ .mmap = fops_mmap, -+ .unlocked_ioctl = video_ioctl2, -+}; -+ -+static void vv_callback(struct saa7146_dev *dev, unsigned long status) -+{ -+ u32 isr = status; -+ -+ DEB_INT("dev:%p, isr:0x%08x\n", dev, (u32)status); -+ -+ if (0 != (isr & (MASK_27))) { -+ DEB_INT("irq: RPS0 (0x%08x)\n", isr); -+ saa7146_video_uops.irq_done(dev,isr); -+ } -+ -+ if (0 != (isr & (MASK_28))) { -+ u32 mc2 = saa7146_read(dev, MC2); -+ if( 0 != (mc2 & MASK_15)) { -+ DEB_INT("irq: RPS1 vbi workaround (0x%08x)\n", isr); -+ wake_up(&dev->vv_data->vbi_wq); -+ saa7146_write(dev,MC2, MASK_31); -+ return; -+ } -+ DEB_INT("irq: RPS1 (0x%08x)\n", isr); -+ saa7146_vbi_uops.irq_done(dev,isr); -+ } -+} -+ -+static const struct v4l2_ctrl_ops saa7146_ctrl_ops = { -+ .s_ctrl = saa7146_s_ctrl, -+}; -+ -+int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) -+{ -+ struct v4l2_ctrl_handler *hdl = &dev->ctrl_handler; -+ struct v4l2_pix_format *fmt; -+ struct v4l2_vbi_format *vbi; -+ struct saa7146_vv *vv; -+ int err; -+ -+ err = v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev); -+ if (err) -+ return err; -+ -+ v4l2_ctrl_handler_init(hdl, 6); -+ v4l2_ctrl_new_std(hdl, &saa7146_ctrl_ops, -+ V4L2_CID_BRIGHTNESS, 0, 255, 1, 128); -+ v4l2_ctrl_new_std(hdl, &saa7146_ctrl_ops, -+ V4L2_CID_CONTRAST, 0, 127, 1, 64); -+ v4l2_ctrl_new_std(hdl, &saa7146_ctrl_ops, -+ V4L2_CID_SATURATION, 0, 127, 1, 64); -+ v4l2_ctrl_new_std(hdl, &saa7146_ctrl_ops, -+ V4L2_CID_VFLIP, 0, 1, 1, 0); -+ v4l2_ctrl_new_std(hdl, &saa7146_ctrl_ops, -+ V4L2_CID_HFLIP, 0, 1, 1, 0); -+ if (hdl->error) { -+ err = hdl->error; -+ v4l2_ctrl_handler_free(hdl); -+ return err; -+ } -+ dev->v4l2_dev.ctrl_handler = hdl; -+ -+ vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); -+ if (vv == NULL) { -+ ERR("out of memory. aborting.\n"); -+ v4l2_ctrl_handler_free(hdl); -+ return -ENOMEM; -+ } -+ ext_vv->vid_ops = saa7146_video_ioctl_ops; -+ ext_vv->vbi_ops = saa7146_vbi_ioctl_ops; -+ ext_vv->core_ops = &saa7146_video_ioctl_ops; -+ -+ DEB_EE("dev:%p\n", dev); -+ -+ /* set default values for video parts of the saa7146 */ -+ saa7146_write(dev, BCS_CTRL, 0x80400040); -+ -+ /* enable video-port pins */ -+ saa7146_write(dev, MC1, (MASK_10 | MASK_26)); -+ -+ /* save per-device extension data (one extension can -+ handle different devices that might need different -+ configuration data) */ -+ dev->ext_vv_data = ext_vv; -+ -+ vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); -+ if( NULL == vv->d_clipping.cpu_addr ) { -+ ERR("out of memory. aborting.\n"); -+ kfree(vv); -+ v4l2_ctrl_handler_free(hdl); -+ return -1; -+ } -+ memset(vv->d_clipping.cpu_addr, 0x0, SAA7146_CLIPPING_MEM); -+ -+ saa7146_video_uops.init(dev,vv); -+ if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -+ saa7146_vbi_uops.init(dev,vv); -+ -+ fmt = &vv->ov_fb.fmt; -+ fmt->width = vv->standard->h_max_out; -+ fmt->height = vv->standard->v_max_out; -+ fmt->pixelformat = V4L2_PIX_FMT_RGB565; -+ fmt->bytesperline = 2 * fmt->width; -+ fmt->sizeimage = fmt->bytesperline * fmt->height; -+ fmt->colorspace = V4L2_COLORSPACE_SRGB; -+ -+ fmt = &vv->video_fmt; -+ fmt->width = 384; -+ fmt->height = 288; -+ fmt->pixelformat = V4L2_PIX_FMT_BGR24; -+ fmt->field = V4L2_FIELD_ANY; -+ fmt->colorspace = V4L2_COLORSPACE_SMPTE170M; -+ fmt->bytesperline = 3 * fmt->width; -+ fmt->sizeimage = fmt->bytesperline * fmt->height; -+ -+ vbi = &vv->vbi_fmt; -+ vbi->sampling_rate = 27000000; -+ vbi->offset = 248; /* todo */ -+ vbi->samples_per_line = 720 * 2; -+ vbi->sample_format = V4L2_PIX_FMT_GREY; -+ -+ /* fixme: this only works for PAL */ -+ vbi->start[0] = 5; -+ vbi->count[0] = 16; -+ vbi->start[1] = 312; -+ vbi->count[1] = 16; -+ -+ init_timer(&vv->vbi_read_timeout); -+ -+ vv->ov_fb.capability = V4L2_FBUF_CAP_LIST_CLIPPING; -+ vv->ov_fb.flags = V4L2_FBUF_FLAG_PRIMARY; -+ dev->vv_data = vv; -+ dev->vv_callback = &vv_callback; -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_vv_init); -+ -+int saa7146_vv_release(struct saa7146_dev* dev) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ DEB_EE("dev:%p\n", dev); -+ -+ v4l2_device_unregister(&dev->v4l2_dev); -+ pci_free_consistent(dev->pci, SAA7146_CLIPPING_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle); -+ v4l2_ctrl_handler_free(&dev->ctrl_handler); -+ kfree(vv); -+ dev->vv_data = NULL; -+ dev->vv_callback = NULL; -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_vv_release); -+ -+int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, -+ char *name, int type) -+{ -+ struct video_device *vfd; -+ int err; -+ int i; -+ -+ DEB_EE("dev:%p, name:'%s', type:%d\n", dev, name, type); -+ -+ // released by vfd->release -+ vfd = video_device_alloc(); -+ if (vfd == NULL) -+ return -ENOMEM; -+ -+ vfd->fops = &video_fops; -+ if (type == VFL_TYPE_GRABBER) -+ vfd->ioctl_ops = &dev->ext_vv_data->vid_ops; -+ else -+ vfd->ioctl_ops = &dev->ext_vv_data->vbi_ops; -+ vfd->release = video_device_release; -+ vfd->lock = &dev->v4l2_lock; -+ vfd->v4l2_dev = &dev->v4l2_dev; -+ vfd->tvnorms = 0; -+ set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); -+ for (i = 0; i < dev->ext_vv_data->num_stds; i++) -+ vfd->tvnorms |= dev->ext_vv_data->stds[i].id; -+ strlcpy(vfd->name, name, sizeof(vfd->name)); -+ video_set_drvdata(vfd, dev); -+ -+ err = video_register_device(vfd, type, -1); -+ if (err < 0) { -+ ERR("cannot register v4l2 device. skipping.\n"); -+ video_device_release(vfd); -+ return err; -+ } -+ -+ pr_info("%s: registered device %s [v4l2]\n", -+ dev->name, video_device_node_name(vfd)); -+ -+ *vid = vfd; -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_register_device); -+ -+int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev) -+{ -+ DEB_EE("dev:%p\n", dev); -+ -+ video_unregister_device(*vid); -+ *vid = NULL; -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_unregister_device); -+ -+static int __init saa7146_vv_init_module(void) -+{ -+ return 0; -+} -+ -+ -+static void __exit saa7146_vv_cleanup_module(void) -+{ -+} -+ -+module_init(saa7146_vv_init_module); -+module_exit(saa7146_vv_cleanup_module); -+ -+MODULE_AUTHOR("Michael Hunold "); -+MODULE_DESCRIPTION("video4linux driver for saa7146-based hardware"); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c -new file mode 100644 -index 0000000..be746d1 ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_hlp.c -@@ -0,0 +1,1048 @@ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+#include -+ -+static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) -+{ -+ /* clear out the necessary bits */ -+ *clip_format &= 0x0000ffff; -+ /* set these bits new */ -+ *clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) << 16)); -+} -+ -+static void calculate_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync, u32* hps_ctrl) -+{ -+ *hps_ctrl &= ~(MASK_30 | MASK_31 | MASK_28); -+ *hps_ctrl |= (source << 30) | (sync << 28); -+} -+ -+static void calculate_hxo_and_hyo(struct saa7146_vv *vv, u32* hps_h_scale, u32* hps_ctrl) -+{ -+ int hyo = 0, hxo = 0; -+ -+ hyo = vv->standard->v_offset; -+ hxo = vv->standard->h_offset; -+ -+ *hps_h_scale &= ~(MASK_B0 | 0xf00); -+ *hps_h_scale |= (hxo << 0); -+ -+ *hps_ctrl &= ~(MASK_W0 | MASK_B2); -+ *hps_ctrl |= (hyo << 12); -+} -+ -+/* helper functions for the calculation of the horizontal- and vertical -+ scaling registers, clip-format-register etc ... -+ these functions take pointers to the (most-likely read-out -+ original-values) and manipulate them according to the requested -+ changes. -+*/ -+ -+/* hps_coeff used for CXY and CXUV; scale 1/1 -> scale 1/64 */ -+static struct { -+ u16 hps_coeff; -+ u16 weight_sum; -+} hps_h_coeff_tab [] = { -+ {0x00, 2}, {0x02, 4}, {0x00, 4}, {0x06, 8}, {0x02, 8}, -+ {0x08, 8}, {0x00, 8}, {0x1E, 16}, {0x0E, 8}, {0x26, 8}, -+ {0x06, 8}, {0x42, 8}, {0x02, 8}, {0x80, 8}, {0x00, 8}, -+ {0xFE, 16}, {0xFE, 8}, {0x7E, 8}, {0x7E, 8}, {0x3E, 8}, -+ {0x3E, 8}, {0x1E, 8}, {0x1E, 8}, {0x0E, 8}, {0x0E, 8}, -+ {0x06, 8}, {0x06, 8}, {0x02, 8}, {0x02, 8}, {0x00, 8}, -+ {0x00, 8}, {0xFE, 16}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -+ {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -+ {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -+ {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0x7E, 8}, -+ {0x7E, 8}, {0x3E, 8}, {0x3E, 8}, {0x1E, 8}, {0x1E, 8}, -+ {0x0E, 8}, {0x0E, 8}, {0x06, 8}, {0x06, 8}, {0x02, 8}, -+ {0x02, 8}, {0x00, 8}, {0x00, 8}, {0xFE, 16} -+}; -+ -+/* table of attenuation values for horizontal scaling */ -+static u8 h_attenuation[] = { 1, 2, 4, 8, 2, 4, 8, 16, 0}; -+ -+/* calculate horizontal scale registers */ -+static int calculate_h_scale_registers(struct saa7146_dev *dev, -+ int in_x, int out_x, int flip_lr, -+ u32* hps_ctrl, u32* hps_v_gain, u32* hps_h_prescale, u32* hps_h_scale) -+{ -+ /* horizontal prescaler */ -+ u32 dcgx = 0, xpsc = 0, xacm = 0, cxy = 0, cxuv = 0; -+ /* horizontal scaler */ -+ u32 xim = 0, xp = 0, xsci =0; -+ /* vertical scale & gain */ -+ u32 pfuv = 0; -+ -+ /* helper variables */ -+ u32 h_atten = 0, i = 0; -+ -+ if ( 0 == out_x ) { -+ return -EINVAL; -+ } -+ -+ /* mask out vanity-bit */ -+ *hps_ctrl &= ~MASK_29; -+ -+ /* calculate prescale-(xspc)-value: [n .. 1/2) : 1 -+ [1/2 .. 1/3) : 2 -+ [1/3 .. 1/4) : 3 -+ ... */ -+ if (in_x > out_x) { -+ xpsc = in_x / out_x; -+ } -+ else { -+ /* zooming */ -+ xpsc = 1; -+ } -+ -+ /* if flip_lr-bit is set, number of pixels after -+ horizontal prescaling must be < 384 */ -+ if ( 0 != flip_lr ) { -+ -+ /* set vanity bit */ -+ *hps_ctrl |= MASK_29; -+ -+ while (in_x / xpsc >= 384 ) -+ xpsc++; -+ } -+ /* if zooming is wanted, number of pixels after -+ horizontal prescaling must be < 768 */ -+ else { -+ while ( in_x / xpsc >= 768 ) -+ xpsc++; -+ } -+ -+ /* maximum prescale is 64 (p.69) */ -+ if ( xpsc > 64 ) -+ xpsc = 64; -+ -+ /* keep xacm clear*/ -+ xacm = 0; -+ -+ /* set horizontal filter parameters (CXY = CXUV) */ -+ cxy = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].hps_coeff; -+ cxuv = cxy; -+ -+ /* calculate and set horizontal fine scale (xsci) */ -+ -+ /* bypass the horizontal scaler ? */ -+ if ( (in_x == out_x) && ( 1 == xpsc ) ) -+ xsci = 0x400; -+ else -+ xsci = ( (1024 * in_x) / (out_x * xpsc) ) + xpsc; -+ -+ /* set start phase for horizontal fine scale (xp) to 0 */ -+ xp = 0; -+ -+ /* set xim, if we bypass the horizontal scaler */ -+ if ( 0x400 == xsci ) -+ xim = 1; -+ else -+ xim = 0; -+ -+ /* if the prescaler is bypassed, enable horizontal -+ accumulation mode (xacm) and clear dcgx */ -+ if( 1 == xpsc ) { -+ xacm = 1; -+ dcgx = 0; -+ } else { -+ xacm = 0; -+ /* get best match in the table of attenuations -+ for horizontal scaling */ -+ h_atten = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].weight_sum; -+ -+ for (i = 0; h_attenuation[i] != 0; i++) { -+ if (h_attenuation[i] >= h_atten) -+ break; -+ } -+ -+ dcgx = i; -+ } -+ -+ /* the horizontal scaling increment controls the UV filter -+ to reduce the bandwidth to improve the display quality, -+ so set it ... */ -+ if ( xsci == 0x400) -+ pfuv = 0x00; -+ else if ( xsci < 0x600) -+ pfuv = 0x01; -+ else if ( xsci < 0x680) -+ pfuv = 0x11; -+ else if ( xsci < 0x700) -+ pfuv = 0x22; -+ else -+ pfuv = 0x33; -+ -+ -+ *hps_v_gain &= MASK_W0|MASK_B2; -+ *hps_v_gain |= (pfuv << 24); -+ -+ *hps_h_scale &= ~(MASK_W1 | 0xf000); -+ *hps_h_scale |= (xim << 31) | (xp << 24) | (xsci << 12); -+ -+ *hps_h_prescale |= (dcgx << 27) | ((xpsc-1) << 18) | (xacm << 17) | (cxy << 8) | (cxuv << 0); -+ -+ return 0; -+} -+ -+static struct { -+ u16 hps_coeff; -+ u16 weight_sum; -+} hps_v_coeff_tab [] = { -+ {0x0100, 2}, {0x0102, 4}, {0x0300, 4}, {0x0106, 8}, {0x0502, 8}, -+ {0x0708, 8}, {0x0F00, 8}, {0x011E, 16}, {0x110E, 16}, {0x1926, 16}, -+ {0x3906, 16}, {0x3D42, 16}, {0x7D02, 16}, {0x7F80, 16}, {0xFF00, 16}, -+ {0x01FE, 32}, {0x01FE, 32}, {0x817E, 32}, {0x817E, 32}, {0xC13E, 32}, -+ {0xC13E, 32}, {0xE11E, 32}, {0xE11E, 32}, {0xF10E, 32}, {0xF10E, 32}, -+ {0xF906, 32}, {0xF906, 32}, {0xFD02, 32}, {0xFD02, 32}, {0xFF00, 32}, -+ {0xFF00, 32}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -+ {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -+ {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -+ {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x817E, 64}, -+ {0x817E, 64}, {0xC13E, 64}, {0xC13E, 64}, {0xE11E, 64}, {0xE11E, 64}, -+ {0xF10E, 64}, {0xF10E, 64}, {0xF906, 64}, {0xF906, 64}, {0xFD02, 64}, -+ {0xFD02, 64}, {0xFF00, 64}, {0xFF00, 64}, {0x01FE, 128} -+}; -+ -+/* table of attenuation values for vertical scaling */ -+static u16 v_attenuation[] = { 2, 4, 8, 16, 32, 64, 128, 256, 0}; -+ -+/* calculate vertical scale registers */ -+static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, -+ int in_y, int out_y, u32* hps_v_scale, u32* hps_v_gain) -+{ -+ int lpi = 0; -+ -+ /* vertical scaling */ -+ u32 yacm = 0, ysci = 0, yacl = 0, ypo = 0, ype = 0; -+ /* vertical scale & gain */ -+ u32 dcgy = 0, cya_cyb = 0; -+ -+ /* helper variables */ -+ u32 v_atten = 0, i = 0; -+ -+ /* error, if vertical zooming */ -+ if ( in_y < out_y ) { -+ return -EINVAL; -+ } -+ -+ /* linear phase interpolation may be used -+ if scaling is between 1 and 1/2 (both fields used) -+ or scaling is between 1/2 and 1/4 (if only one field is used) */ -+ -+ if (V4L2_FIELD_HAS_BOTH(field)) { -+ if( 2*out_y >= in_y) { -+ lpi = 1; -+ } -+ } else if (field == V4L2_FIELD_TOP -+ || field == V4L2_FIELD_ALTERNATE -+ || field == V4L2_FIELD_BOTTOM) { -+ if( 4*out_y >= in_y ) { -+ lpi = 1; -+ } -+ out_y *= 2; -+ } -+ if( 0 != lpi ) { -+ -+ yacm = 0; -+ yacl = 0; -+ cya_cyb = 0x00ff; -+ -+ /* calculate scaling increment */ -+ if ( in_y > out_y ) -+ ysci = ((1024 * in_y) / (out_y + 1)) - 1024; -+ else -+ ysci = 0; -+ -+ dcgy = 0; -+ -+ /* calculate ype and ypo */ -+ ype = ysci / 16; -+ ypo = ype + (ysci / 64); -+ -+ } else { -+ yacm = 1; -+ -+ /* calculate scaling increment */ -+ ysci = (((10 * 1024 * (in_y - out_y - 1)) / in_y) + 9) / 10; -+ -+ /* calculate ype and ypo */ -+ ypo = ype = ((ysci + 15) / 16); -+ -+ /* the sequence length interval (yacl) has to be set according -+ to the prescale value, e.g. [n .. 1/2) : 0 -+ [1/2 .. 1/3) : 1 -+ [1/3 .. 1/4) : 2 -+ ... */ -+ if ( ysci < 512) { -+ yacl = 0; -+ } else { -+ yacl = ( ysci / (1024 - ysci) ); -+ } -+ -+ /* get filter coefficients for cya, cyb from table hps_v_coeff_tab */ -+ cya_cyb = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].hps_coeff; -+ -+ /* get best match in the table of attenuations for vertical scaling */ -+ v_atten = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].weight_sum; -+ -+ for (i = 0; v_attenuation[i] != 0; i++) { -+ if (v_attenuation[i] >= v_atten) -+ break; -+ } -+ -+ dcgy = i; -+ } -+ -+ /* ypo and ype swapped in spec ? */ -+ *hps_v_scale |= (yacm << 31) | (ysci << 21) | (yacl << 15) | (ypo << 8 ) | (ype << 1); -+ -+ *hps_v_gain &= ~(MASK_W0|MASK_B2); -+ *hps_v_gain |= (dcgy << 16) | (cya_cyb << 0); -+ -+ return 0; -+} -+ -+/* simple bubble-sort algorithm with duplicate elimination */ -+static int sort_and_eliminate(u32* values, int* count) -+{ -+ int low = 0, high = 0, top = 0, temp = 0; -+ int cur = 0, next = 0; -+ -+ /* sanity checks */ -+ if( (0 > *count) || (NULL == values) ) { -+ return -EINVAL; -+ } -+ -+ /* bubble sort the first @count items of the array @values */ -+ for( top = *count; top > 0; top--) { -+ for( low = 0, high = 1; high < top; low++, high++) { -+ if( values[low] > values[high] ) { -+ temp = values[low]; -+ values[low] = values[high]; -+ values[high] = temp; -+ } -+ } -+ } -+ -+ /* remove duplicate items */ -+ for( cur = 0, next = 1; next < *count; next++) { -+ if( values[cur] != values[next]) -+ values[++cur] = values[next]; -+ } -+ -+ *count = cur + 1; -+ -+ return 0; -+} -+ -+static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_fh *fh, -+ struct saa7146_video_dma *vdma2, u32* clip_format, u32* arbtr_ctrl, enum v4l2_field field) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ __le32 *clipping = vv->d_clipping.cpu_addr; -+ -+ int width = vv->ov.win.w.width; -+ int height = vv->ov.win.w.height; -+ int clipcount = vv->ov.nclips; -+ -+ u32 line_list[32]; -+ u32 pixel_list[32]; -+ int numdwords = 0; -+ -+ int i = 0, j = 0; -+ int cnt_line = 0, cnt_pixel = 0; -+ -+ int x[32], y[32], w[32], h[32]; -+ -+ /* clear out memory */ -+ memset(&line_list[0], 0x00, sizeof(u32)*32); -+ memset(&pixel_list[0], 0x00, sizeof(u32)*32); -+ memset(clipping, 0x00, SAA7146_CLIPPING_MEM); -+ -+ /* fill the line and pixel-lists */ -+ for(i = 0; i < clipcount; i++) { -+ int l = 0, r = 0, t = 0, b = 0; -+ -+ x[i] = vv->ov.clips[i].c.left; -+ y[i] = vv->ov.clips[i].c.top; -+ w[i] = vv->ov.clips[i].c.width; -+ h[i] = vv->ov.clips[i].c.height; -+ -+ if( w[i] < 0) { -+ x[i] += w[i]; w[i] = -w[i]; -+ } -+ if( h[i] < 0) { -+ y[i] += h[i]; h[i] = -h[i]; -+ } -+ if( x[i] < 0) { -+ w[i] += x[i]; x[i] = 0; -+ } -+ if( y[i] < 0) { -+ h[i] += y[i]; y[i] = 0; -+ } -+ if( 0 != vv->vflip ) { -+ y[i] = height - y[i] - h[i]; -+ } -+ -+ l = x[i]; -+ r = x[i]+w[i]; -+ t = y[i]; -+ b = y[i]+h[i]; -+ -+ /* insert left/right coordinates */ -+ pixel_list[ 2*i ] = min_t(int, l, width); -+ pixel_list[(2*i)+1] = min_t(int, r, width); -+ /* insert top/bottom coordinates */ -+ line_list[ 2*i ] = min_t(int, t, height); -+ line_list[(2*i)+1] = min_t(int, b, height); -+ } -+ -+ /* sort and eliminate lists */ -+ cnt_line = cnt_pixel = 2*clipcount; -+ sort_and_eliminate( &pixel_list[0], &cnt_pixel ); -+ sort_and_eliminate( &line_list[0], &cnt_line ); -+ -+ /* calculate the number of used u32s */ -+ numdwords = max_t(int, (cnt_line+1), (cnt_pixel+1))*2; -+ numdwords = max_t(int, 4, numdwords); -+ numdwords = min_t(int, 64, numdwords); -+ -+ /* fill up cliptable */ -+ for(i = 0; i < cnt_pixel; i++) { -+ clipping[2*i] |= cpu_to_le32(pixel_list[i] << 16); -+ } -+ for(i = 0; i < cnt_line; i++) { -+ clipping[(2*i)+1] |= cpu_to_le32(line_list[i] << 16); -+ } -+ -+ /* fill up cliptable with the display infos */ -+ for(j = 0; j < clipcount; j++) { -+ -+ for(i = 0; i < cnt_pixel; i++) { -+ -+ if( x[j] < 0) -+ x[j] = 0; -+ -+ if( pixel_list[i] < (x[j] + w[j])) { -+ -+ if ( pixel_list[i] >= x[j] ) { -+ clipping[2*i] |= cpu_to_le32(1 << j); -+ } -+ } -+ } -+ for(i = 0; i < cnt_line; i++) { -+ -+ if( y[j] < 0) -+ y[j] = 0; -+ -+ if( line_list[i] < (y[j] + h[j]) ) { -+ -+ if( line_list[i] >= y[j] ) { -+ clipping[(2*i)+1] |= cpu_to_le32(1 << j); -+ } -+ } -+ } -+ } -+ -+ /* adjust arbitration control register */ -+ *arbtr_ctrl &= 0xffff00ff; -+ *arbtr_ctrl |= 0x00001c00; -+ -+ vdma2->base_even = vv->d_clipping.dma_handle; -+ vdma2->base_odd = vv->d_clipping.dma_handle; -+ vdma2->prot_addr = vv->d_clipping.dma_handle+((sizeof(u32))*(numdwords)); -+ vdma2->base_page = 0x04; -+ vdma2->pitch = 0x00; -+ vdma2->num_line_byte = (0 << 16 | (sizeof(u32))*(numdwords-1) ); -+ -+ /* set clipping-mode. this depends on the field(s) used */ -+ *clip_format &= 0xfffffff7; -+ if (V4L2_FIELD_HAS_BOTH(field)) { -+ *clip_format |= 0x00000008; -+ } else { -+ *clip_format |= 0x00000000; -+ } -+} -+ -+/* disable clipping */ -+static void saa7146_disable_clipping(struct saa7146_dev *dev) -+{ -+ u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -+ -+ /* mask out relevant bits (=lower word)*/ -+ clip_format &= MASK_W1; -+ -+ /* upload clipping-registers*/ -+ saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); -+ saa7146_write(dev, MC2, (MASK_05 | MASK_21)); -+ -+ /* disable video dma2 */ -+ saa7146_write(dev, MC1, MASK_21); -+} -+ -+static void saa7146_set_clipping_rect(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ enum v4l2_field field = vv->ov.win.field; -+ struct saa7146_video_dma vdma2; -+ u32 clip_format; -+ u32 arbtr_ctrl; -+ -+ /* check clipcount, disable clipping if clipcount == 0*/ -+ if (vv->ov.nclips == 0) { -+ saa7146_disable_clipping(dev); -+ return; -+ } -+ -+ clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -+ arbtr_ctrl = saa7146_read(dev, PCI_BT_V1); -+ -+ calculate_clipping_registers_rect(dev, fh, &vdma2, &clip_format, &arbtr_ctrl, field); -+ -+ /* set clipping format */ -+ clip_format &= 0xffff0008; -+ clip_format |= (SAA7146_CLIPPING_RECT << 4); -+ -+ /* prepare video dma2 */ -+ saa7146_write(dev, BASE_EVEN2, vdma2.base_even); -+ saa7146_write(dev, BASE_ODD2, vdma2.base_odd); -+ saa7146_write(dev, PROT_ADDR2, vdma2.prot_addr); -+ saa7146_write(dev, BASE_PAGE2, vdma2.base_page); -+ saa7146_write(dev, PITCH2, vdma2.pitch); -+ saa7146_write(dev, NUM_LINE_BYTE2, vdma2.num_line_byte); -+ -+ /* prepare the rest */ -+ saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); -+ saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); -+ -+ /* upload clip_control-register, clipping-registers, enable video dma2 */ -+ saa7146_write(dev, MC2, (MASK_05 | MASK_21 | MASK_03 | MASK_19)); -+ saa7146_write(dev, MC1, (MASK_05 | MASK_21)); -+} -+ -+static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l2_field field) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ int source = vv->current_hps_source; -+ int sync = vv->current_hps_sync; -+ -+ u32 hps_v_scale = 0, hps_v_gain = 0, hps_ctrl = 0, hps_h_prescale = 0, hps_h_scale = 0; -+ -+ /* set vertical scale */ -+ hps_v_scale = 0; /* all bits get set by the function-call */ -+ hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ -+ calculate_v_scale_registers(dev, field, vv->standard->v_field*2, height, &hps_v_scale, &hps_v_gain); -+ -+ /* set horizontal scale */ -+ hps_ctrl = 0; -+ hps_h_prescale = 0; /* all bits get set in the function */ -+ hps_h_scale = 0; -+ calculate_h_scale_registers(dev, vv->standard->h_pixels, width, vv->hflip, &hps_ctrl, &hps_v_gain, &hps_h_prescale, &hps_h_scale); -+ -+ /* set hyo and hxo */ -+ calculate_hxo_and_hyo(vv, &hps_h_scale, &hps_ctrl); -+ calculate_hps_source_and_sync(dev, source, sync, &hps_ctrl); -+ -+ /* write out new register contents */ -+ saa7146_write(dev, HPS_V_SCALE, hps_v_scale); -+ saa7146_write(dev, HPS_V_GAIN, hps_v_gain); -+ saa7146_write(dev, HPS_CTRL, hps_ctrl); -+ saa7146_write(dev, HPS_H_PRESCALE,hps_h_prescale); -+ saa7146_write(dev, HPS_H_SCALE, hps_h_scale); -+ -+ /* upload shadow-ram registers */ -+ saa7146_write(dev, MC2, (MASK_05 | MASK_06 | MASK_21 | MASK_22) ); -+} -+ -+/* calculate the new memory offsets for a desired position */ -+static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_height, enum v4l2_field field, u32 pixelformat) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pixelformat); -+ -+ int b_depth = vv->ov_fmt->depth; -+ int b_bpl = vv->ov_fb.fmt.bytesperline; -+ /* The unsigned long cast is to remove a 64-bit compile warning since -+ it looks like a 64-bit address is cast to a 32-bit value, even -+ though the base pointer is really a 32-bit physical address that -+ goes into a 32-bit DMA register. -+ FIXME: might not work on some 64-bit platforms, but see the FIXME -+ in struct v4l2_framebuffer (videodev2.h) for that. -+ */ -+ u32 base = (u32)(unsigned long)vv->ov_fb.base; -+ -+ struct saa7146_video_dma vdma1; -+ -+ /* calculate memory offsets for picture, look if we shall top-down-flip */ -+ vdma1.pitch = 2*b_bpl; -+ if ( 0 == vv->vflip ) { -+ vdma1.base_even = base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); -+ vdma1.base_odd = vdma1.base_even + (vdma1.pitch / 2); -+ vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2)); -+ } -+ else { -+ vdma1.base_even = base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); -+ vdma1.base_odd = vdma1.base_even - (vdma1.pitch / 2); -+ vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2)); -+ } -+ -+ if (V4L2_FIELD_HAS_BOTH(field)) { -+ } else if (field == V4L2_FIELD_ALTERNATE) { -+ /* fixme */ -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } else if (field == V4L2_FIELD_TOP) { -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } else if (field == V4L2_FIELD_BOTTOM) { -+ vdma1.base_odd = vdma1.base_even; -+ vdma1.base_even = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } -+ -+ if ( 0 != vv->vflip ) { -+ vdma1.pitch *= -1; -+ } -+ -+ vdma1.base_page = sfmt->swap; -+ vdma1.num_line_byte = (vv->standard->v_field<<16)+vv->standard->h_pixels; -+ -+ saa7146_write_out_dma(dev, 1, &vdma1); -+} -+ -+static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) -+{ -+ u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -+ -+ /* call helper function */ -+ calculate_output_format_register(dev,palette,&clip_format); -+ -+ /* update the hps registers */ -+ saa7146_write(dev, CLIP_FORMAT_CTRL, clip_format); -+ saa7146_write(dev, MC2, (MASK_05 | MASK_21)); -+} -+ -+/* select input-source */ -+void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ u32 hps_ctrl = 0; -+ -+ /* read old state */ -+ hps_ctrl = saa7146_read(dev, HPS_CTRL); -+ -+ hps_ctrl &= ~( MASK_31 | MASK_30 | MASK_28 ); -+ hps_ctrl |= (source << 30) | (sync << 28); -+ -+ /* write back & upload register */ -+ saa7146_write(dev, HPS_CTRL, hps_ctrl); -+ saa7146_write(dev, MC2, (MASK_05 | MASK_21)); -+ -+ vv->current_hps_source = source; -+ vv->current_hps_sync = sync; -+} -+EXPORT_SYMBOL_GPL(saa7146_set_hps_source_and_sync); -+ -+int saa7146_enable_overlay(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ saa7146_set_window(dev, vv->ov.win.w.width, vv->ov.win.w.height, vv->ov.win.field); -+ saa7146_set_position(dev, vv->ov.win.w.left, vv->ov.win.w.top, vv->ov.win.w.height, vv->ov.win.field, vv->ov_fmt->pixelformat); -+ saa7146_set_output_format(dev, vv->ov_fmt->trans); -+ saa7146_set_clipping_rect(fh); -+ -+ /* enable video dma1 */ -+ saa7146_write(dev, MC1, (MASK_06 | MASK_22)); -+ return 0; -+} -+ -+void saa7146_disable_overlay(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ -+ /* disable clipping + video dma1 */ -+ saa7146_disable_clipping(dev); -+ saa7146_write(dev, MC1, MASK_22); -+} -+ -+void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) -+{ -+ int where = 0; -+ -+ if( which < 1 || which > 3) { -+ return; -+ } -+ -+ /* calculate starting address */ -+ where = (which-1)*0x18; -+ -+ saa7146_write(dev, where, vdma->base_odd); -+ saa7146_write(dev, where+0x04, vdma->base_even); -+ saa7146_write(dev, where+0x08, vdma->prot_addr); -+ saa7146_write(dev, where+0x0c, vdma->pitch); -+ saa7146_write(dev, where+0x10, vdma->base_page); -+ saa7146_write(dev, where+0x14, vdma->num_line_byte); -+ -+ /* upload */ -+ saa7146_write(dev, MC2, (MASK_02<<(which-1))|(MASK_18<<(which-1))); -+/* -+ printk("vdma%d.base_even: 0x%08x\n", which,vdma->base_even); -+ printk("vdma%d.base_odd: 0x%08x\n", which,vdma->base_odd); -+ printk("vdma%d.prot_addr: 0x%08x\n", which,vdma->prot_addr); -+ printk("vdma%d.base_page: 0x%08x\n", which,vdma->base_page); -+ printk("vdma%d.pitch: 0x%08x\n", which,vdma->pitch); -+ printk("vdma%d.num_line_byte: 0x%08x\n", which,vdma->num_line_byte); -+*/ -+} -+ -+static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_video_dma vdma1; -+ -+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -+ -+ int width = buf->fmt->width; -+ int height = buf->fmt->height; -+ int bytesperline = buf->fmt->bytesperline; -+ enum v4l2_field field = buf->fmt->field; -+ -+ int depth = sfmt->depth; -+ -+ DEB_CAP("[size=%dx%d,fields=%s]\n", -+ width, height, v4l2_field_names[field]); -+ -+ if( bytesperline != 0) { -+ vdma1.pitch = bytesperline*2; -+ } else { -+ vdma1.pitch = (width*depth*2)/8; -+ } -+ vdma1.num_line_byte = ((vv->standard->v_field<<16) + vv->standard->h_pixels); -+ vdma1.base_page = buf->pt[0].dma | ME1 | sfmt->swap; -+ -+ if( 0 != vv->vflip ) { -+ vdma1.prot_addr = buf->pt[0].offset; -+ vdma1.base_even = buf->pt[0].offset+(vdma1.pitch/2)*height; -+ vdma1.base_odd = vdma1.base_even - (vdma1.pitch/2); -+ } else { -+ vdma1.base_even = buf->pt[0].offset; -+ vdma1.base_odd = vdma1.base_even + (vdma1.pitch/2); -+ vdma1.prot_addr = buf->pt[0].offset+(vdma1.pitch/2)*height; -+ } -+ -+ if (V4L2_FIELD_HAS_BOTH(field)) { -+ } else if (field == V4L2_FIELD_ALTERNATE) { -+ /* fixme */ -+ if ( vv->last_field == V4L2_FIELD_TOP ) { -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -+ vdma1.base_odd = vdma1.base_even; -+ vdma1.base_even = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } -+ } else if (field == V4L2_FIELD_TOP) { -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } else if (field == V4L2_FIELD_BOTTOM) { -+ vdma1.base_odd = vdma1.base_even; -+ vdma1.base_even = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ } -+ -+ if( 0 != vv->vflip ) { -+ vdma1.pitch *= -1; -+ } -+ -+ saa7146_write_out_dma(dev, 1, &vdma1); -+ return 0; -+} -+ -+static int calc_planar_422(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3) -+{ -+ int height = buf->fmt->height; -+ int width = buf->fmt->width; -+ -+ vdma2->pitch = width; -+ vdma3->pitch = width; -+ -+ /* fixme: look at bytesperline! */ -+ -+ if( 0 != vv->vflip ) { -+ vdma2->prot_addr = buf->pt[1].offset; -+ vdma2->base_even = ((vdma2->pitch/2)*height)+buf->pt[1].offset; -+ vdma2->base_odd = vdma2->base_even - (vdma2->pitch/2); -+ -+ vdma3->prot_addr = buf->pt[2].offset; -+ vdma3->base_even = ((vdma3->pitch/2)*height)+buf->pt[2].offset; -+ vdma3->base_odd = vdma3->base_even - (vdma3->pitch/2); -+ } else { -+ vdma3->base_even = buf->pt[2].offset; -+ vdma3->base_odd = vdma3->base_even + (vdma3->pitch/2); -+ vdma3->prot_addr = (vdma3->pitch/2)*height+buf->pt[2].offset; -+ -+ vdma2->base_even = buf->pt[1].offset; -+ vdma2->base_odd = vdma2->base_even + (vdma2->pitch/2); -+ vdma2->prot_addr = (vdma2->pitch/2)*height+buf->pt[1].offset; -+ } -+ -+ return 0; -+} -+ -+static int calc_planar_420(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3) -+{ -+ int height = buf->fmt->height; -+ int width = buf->fmt->width; -+ -+ vdma2->pitch = width/2; -+ vdma3->pitch = width/2; -+ -+ if( 0 != vv->vflip ) { -+ vdma2->prot_addr = buf->pt[2].offset; -+ vdma2->base_even = ((vdma2->pitch/2)*height)+buf->pt[2].offset; -+ vdma2->base_odd = vdma2->base_even - (vdma2->pitch/2); -+ -+ vdma3->prot_addr = buf->pt[1].offset; -+ vdma3->base_even = ((vdma3->pitch/2)*height)+buf->pt[1].offset; -+ vdma3->base_odd = vdma3->base_even - (vdma3->pitch/2); -+ -+ } else { -+ vdma3->base_even = buf->pt[2].offset; -+ vdma3->base_odd = vdma3->base_even + (vdma3->pitch); -+ vdma3->prot_addr = (vdma3->pitch/2)*height+buf->pt[2].offset; -+ -+ vdma2->base_even = buf->pt[1].offset; -+ vdma2->base_odd = vdma2->base_even + (vdma2->pitch); -+ vdma2->prot_addr = (vdma2->pitch/2)*height+buf->pt[1].offset; -+ } -+ return 0; -+} -+ -+static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_video_dma vdma1; -+ struct saa7146_video_dma vdma2; -+ struct saa7146_video_dma vdma3; -+ -+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -+ -+ int width = buf->fmt->width; -+ int height = buf->fmt->height; -+ enum v4l2_field field = buf->fmt->field; -+ -+ BUG_ON(0 == buf->pt[0].dma); -+ BUG_ON(0 == buf->pt[1].dma); -+ BUG_ON(0 == buf->pt[2].dma); -+ -+ DEB_CAP("[size=%dx%d,fields=%s]\n", -+ width, height, v4l2_field_names[field]); -+ -+ /* fixme: look at bytesperline! */ -+ -+ /* fixme: what happens for user space buffers here?. The offsets are -+ most likely wrong, this version here only works for page-aligned -+ buffers, modifications to the pagetable-functions are necessary...*/ -+ -+ vdma1.pitch = width*2; -+ vdma1.num_line_byte = ((vv->standard->v_field<<16) + vv->standard->h_pixels); -+ vdma1.base_page = buf->pt[0].dma | ME1; -+ -+ if( 0 != vv->vflip ) { -+ vdma1.prot_addr = buf->pt[0].offset; -+ vdma1.base_even = ((vdma1.pitch/2)*height)+buf->pt[0].offset; -+ vdma1.base_odd = vdma1.base_even - (vdma1.pitch/2); -+ } else { -+ vdma1.base_even = buf->pt[0].offset; -+ vdma1.base_odd = vdma1.base_even + (vdma1.pitch/2); -+ vdma1.prot_addr = (vdma1.pitch/2)*height+buf->pt[0].offset; -+ } -+ -+ vdma2.num_line_byte = 0; /* unused */ -+ vdma2.base_page = buf->pt[1].dma | ME1; -+ -+ vdma3.num_line_byte = 0; /* unused */ -+ vdma3.base_page = buf->pt[2].dma | ME1; -+ -+ switch( sfmt->depth ) { -+ case 12: { -+ calc_planar_420(vv,buf,&vdma2,&vdma3); -+ break; -+ } -+ case 16: { -+ calc_planar_422(vv,buf,&vdma2,&vdma3); -+ break; -+ } -+ default: { -+ return -1; -+ } -+ } -+ -+ if (V4L2_FIELD_HAS_BOTH(field)) { -+ } else if (field == V4L2_FIELD_ALTERNATE) { -+ /* fixme */ -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ vdma2.base_odd = vdma2.prot_addr; -+ vdma2.pitch /= 2; -+ vdma3.base_odd = vdma3.prot_addr; -+ vdma3.pitch /= 2; -+ } else if (field == V4L2_FIELD_TOP) { -+ vdma1.base_odd = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ vdma2.base_odd = vdma2.prot_addr; -+ vdma2.pitch /= 2; -+ vdma3.base_odd = vdma3.prot_addr; -+ vdma3.pitch /= 2; -+ } else if (field == V4L2_FIELD_BOTTOM) { -+ vdma1.base_odd = vdma1.base_even; -+ vdma1.base_even = vdma1.prot_addr; -+ vdma1.pitch /= 2; -+ vdma2.base_odd = vdma2.base_even; -+ vdma2.base_even = vdma2.prot_addr; -+ vdma2.pitch /= 2; -+ vdma3.base_odd = vdma3.base_even; -+ vdma3.base_even = vdma3.prot_addr; -+ vdma3.pitch /= 2; -+ } -+ -+ if( 0 != vv->vflip ) { -+ vdma1.pitch *= -1; -+ vdma2.pitch *= -1; -+ vdma3.pitch *= -1; -+ } -+ -+ saa7146_write_out_dma(dev, 1, &vdma1); -+ if( (sfmt->flags & FORMAT_BYTE_SWAP) != 0 ) { -+ saa7146_write_out_dma(dev, 3, &vdma2); -+ saa7146_write_out_dma(dev, 2, &vdma3); -+ } else { -+ saa7146_write_out_dma(dev, 2, &vdma2); -+ saa7146_write_out_dma(dev, 3, &vdma3); -+ } -+ return 0; -+} -+ -+static void program_capture_engine(struct saa7146_dev *dev, int planar) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ int count = 0; -+ -+ unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; -+ unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; -+ -+ /* wait for o_fid_a/b / e_fid_a/b toggle only if rps register 0 is not set*/ -+ WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | o_wait); -+ WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | e_wait); -+ -+ /* set rps register 0 */ -+ WRITE_RPS0(CMD_WR_REG | (1 << 8) | (MC2/4)); -+ WRITE_RPS0(MASK_27 | MASK_11); -+ -+ /* turn on video-dma1 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_06 | MASK_22); /* => mask */ -+ WRITE_RPS0(MASK_06 | MASK_22); /* => values */ -+ if( 0 != planar ) { -+ /* turn on video-dma2 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ -+ WRITE_RPS0(MASK_05 | MASK_21); /* => values */ -+ -+ /* turn on video-dma3 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ -+ WRITE_RPS0(MASK_04 | MASK_20); /* => values */ -+ } -+ -+ /* wait for o_fid_a/b / e_fid_a/b toggle */ -+ if ( vv->last_field == V4L2_FIELD_INTERLACED ) { -+ WRITE_RPS0(CMD_PAUSE | o_wait); -+ WRITE_RPS0(CMD_PAUSE | e_wait); -+ } else if ( vv->last_field == V4L2_FIELD_TOP ) { -+ WRITE_RPS0(CMD_PAUSE | (vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? MASK_10 : MASK_09)); -+ WRITE_RPS0(CMD_PAUSE | o_wait); -+ } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -+ WRITE_RPS0(CMD_PAUSE | (vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? MASK_10 : MASK_09)); -+ WRITE_RPS0(CMD_PAUSE | e_wait); -+ } -+ -+ /* turn off video-dma1 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_22 | MASK_06); /* => mask */ -+ WRITE_RPS0(MASK_22); /* => values */ -+ if( 0 != planar ) { -+ /* turn off video-dma2 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ -+ WRITE_RPS0(MASK_21); /* => values */ -+ -+ /* turn off video-dma3 */ -+ WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ -+ WRITE_RPS0(MASK_20); /* => values */ -+ } -+ -+ /* generate interrupt */ -+ WRITE_RPS0(CMD_INTERRUPT); -+ -+ /* stop */ -+ WRITE_RPS0(CMD_STOP); -+} -+ -+void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) -+{ -+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -+ struct saa7146_vv *vv = dev->vv_data; -+ u32 vdma1_prot_addr; -+ -+ DEB_CAP("buf:%p, next:%p\n", buf, next); -+ -+ vdma1_prot_addr = saa7146_read(dev, PROT_ADDR1); -+ if( 0 == vdma1_prot_addr ) { -+ /* clear out beginning of streaming bit (rps register 0)*/ -+ DEB_CAP("forcing sync to new frame\n"); -+ saa7146_write(dev, MC2, MASK_27 ); -+ } -+ -+ saa7146_set_window(dev, buf->fmt->width, buf->fmt->height, buf->fmt->field); -+ saa7146_set_output_format(dev, sfmt->trans); -+ saa7146_disable_clipping(dev); -+ -+ if ( vv->last_field == V4L2_FIELD_INTERLACED ) { -+ } else if ( vv->last_field == V4L2_FIELD_TOP ) { -+ vv->last_field = V4L2_FIELD_BOTTOM; -+ } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -+ vv->last_field = V4L2_FIELD_TOP; -+ } -+ -+ if( 0 != IS_PLANAR(sfmt->trans)) { -+ calculate_video_dma_grab_planar(dev, buf); -+ program_capture_engine(dev,1); -+ } else { -+ calculate_video_dma_grab_packed(dev, buf); -+ program_capture_engine(dev,0); -+ } -+ -+/* -+ printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); -+ printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); -+ printk("vdma%d.prot_addr: 0x%08x\n", 1,saa7146_read(dev,PROT_ADDR1)); -+ printk("vdma%d.base_page: 0x%08x\n", 1,saa7146_read(dev,BASE_PAGE1)); -+ printk("vdma%d.pitch: 0x%08x\n", 1,saa7146_read(dev,PITCH1)); -+ printk("vdma%d.num_line_byte: 0x%08x\n", 1,saa7146_read(dev,NUM_LINE_BYTE1)); -+ printk("vdma%d => vptr : 0x%08x\n", 1,saa7146_read(dev,PCI_VDP1)); -+*/ -+ -+ /* write the address of the rps-program */ -+ saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); -+ -+ /* turn on rps */ -+ saa7146_write(dev, MC1, (MASK_12 | MASK_28)); -+} -diff --git a/drivers/media/common/saa7146/saa7146_i2c.c b/drivers/media/common/saa7146/saa7146_i2c.c -new file mode 100644 -index 0000000..2202719 ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_i2c.c -@@ -0,0 +1,423 @@ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+ -+static u32 saa7146_i2c_func(struct i2c_adapter *adapter) -+{ -+ /* DEB_I2C("'%s'\n", adapter->name); */ -+ -+ return I2C_FUNC_I2C -+ | I2C_FUNC_SMBUS_QUICK -+ | I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE -+ | I2C_FUNC_SMBUS_READ_BYTE_DATA | I2C_FUNC_SMBUS_WRITE_BYTE_DATA; -+} -+ -+/* this function returns the status-register of our i2c-device */ -+static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) -+{ -+ u32 iicsta = saa7146_read(dev, I2C_STATUS); -+ /* DEB_I2C("status: 0x%08x\n", iicsta); */ -+ return iicsta; -+} -+ -+/* this function runs through the i2c-messages and prepares the data to be -+ sent through the saa7146. have a look at the specifications p. 122 ff -+ to understand this. it returns the number of u32s to send, or -1 -+ in case of an error. */ -+static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, __le32 *op) -+{ -+ int h1, h2; -+ int i, j, addr; -+ int mem = 0, op_count = 0; -+ -+ /* first determine size of needed memory */ -+ for(i = 0; i < num; i++) { -+ mem += m[i].len + 1; -+ } -+ -+ /* worst case: we need one u32 for three bytes to be send -+ plus one extra byte to address the device */ -+ mem = 1 + ((mem-1) / 3); -+ -+ /* we assume that op points to a memory of at least -+ * SAA7146_I2C_MEM bytes size. if we exceed this limit... -+ */ -+ if ((4 * mem) > SAA7146_I2C_MEM) { -+ /* DEB_I2C("cannot prepare i2c-message\n"); */ -+ return -ENOMEM; -+ } -+ -+ /* be careful: clear out the i2c-mem first */ -+ memset(op,0,sizeof(__le32)*mem); -+ -+ /* loop through all messages */ -+ for(i = 0; i < num; i++) { -+ -+ /* insert the address of the i2c-slave. -+ note: we get 7 bit i2c-addresses, -+ so we have to perform a translation */ -+ addr = (m[i].addr*2) + ( (0 != (m[i].flags & I2C_M_RD)) ? 1 : 0); -+ h1 = op_count/3; h2 = op_count%3; -+ op[h1] |= cpu_to_le32( (u8)addr << ((3-h2)*8)); -+ op[h1] |= cpu_to_le32(SAA7146_I2C_START << ((3-h2)*2)); -+ op_count++; -+ -+ /* loop through all bytes of message i */ -+ for(j = 0; j < m[i].len; j++) { -+ /* insert the data bytes */ -+ h1 = op_count/3; h2 = op_count%3; -+ op[h1] |= cpu_to_le32( (u32)((u8)m[i].buf[j]) << ((3-h2)*8)); -+ op[h1] |= cpu_to_le32( SAA7146_I2C_CONT << ((3-h2)*2)); -+ op_count++; -+ } -+ -+ } -+ -+ /* have a look at the last byte inserted: -+ if it was: ...CONT change it to ...STOP */ -+ h1 = (op_count-1)/3; h2 = (op_count-1)%3; -+ if ( SAA7146_I2C_CONT == (0x3 & (le32_to_cpu(op[h1]) >> ((3-h2)*2))) ) { -+ op[h1] &= ~cpu_to_le32(0x2 << ((3-h2)*2)); -+ op[h1] |= cpu_to_le32(SAA7146_I2C_STOP << ((3-h2)*2)); -+ } -+ -+ /* return the number of u32s to send */ -+ return mem; -+} -+ -+/* this functions loops through all i2c-messages. normally, it should determine -+ which bytes were read through the adapter and write them back to the corresponding -+ i2c-message. but instead, we simply write back all bytes. -+ fixme: this could be improved. */ -+static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, __le32 *op) -+{ -+ int i, j; -+ int op_count = 0; -+ -+ /* loop through all messages */ -+ for(i = 0; i < num; i++) { -+ -+ op_count++; -+ -+ /* loop through all bytes of message i */ -+ for(j = 0; j < m[i].len; j++) { -+ /* write back all bytes that could have been read */ -+ m[i].buf[j] = (le32_to_cpu(op[op_count/3]) >> ((3-(op_count%3))*8)); -+ op_count++; -+ } -+ } -+ -+ return 0; -+} -+ -+/* this functions resets the i2c-device and returns 0 if everything was fine, otherwise -1 */ -+static int saa7146_i2c_reset(struct saa7146_dev *dev) -+{ -+ /* get current status */ -+ u32 status = saa7146_i2c_status(dev); -+ -+ /* clear registers for sure */ -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, I2C_TRANSFER, 0); -+ -+ /* check if any operation is still in progress */ -+ if ( 0 != ( status & SAA7146_I2C_BUSY) ) { -+ -+ /* yes, kill ongoing operation */ -+ DEB_I2C("busy_state detected\n"); -+ -+ /* set "ABORT-OPERATION"-bit (bit 7)*/ -+ saa7146_write(dev, I2C_STATUS, (dev->i2c_bitrate | MASK_07)); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ msleep(SAA7146_I2C_DELAY); -+ -+ /* clear all error-bits pending; this is needed because p.123, note 1 */ -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ msleep(SAA7146_I2C_DELAY); -+ } -+ -+ /* check if any error is (still) present. (this can be necessary because p.123, note 1) */ -+ status = saa7146_i2c_status(dev); -+ -+ if ( dev->i2c_bitrate != status ) { -+ -+ DEB_I2C("error_state detected. status:0x%08x\n", status); -+ -+ /* Repeat the abort operation. This seems to be necessary -+ after serious protocol errors caused by e.g. the SAA7740 */ -+ saa7146_write(dev, I2C_STATUS, (dev->i2c_bitrate | MASK_07)); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ msleep(SAA7146_I2C_DELAY); -+ -+ /* clear all error-bits pending */ -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ msleep(SAA7146_I2C_DELAY); -+ -+ /* the data sheet says it might be necessary to clear the status -+ twice after an abort */ -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ msleep(SAA7146_I2C_DELAY); -+ } -+ -+ /* if any error is still present, a fatal error has occurred ... */ -+ status = saa7146_i2c_status(dev); -+ if ( dev->i2c_bitrate != status ) { -+ DEB_I2C("fatal error. status:0x%08x\n", status); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+/* this functions writes out the data-byte 'dword' to the i2c-device. -+ it returns 0 if ok, -1 if the transfer failed, -2 if the transfer -+ failed badly (e.g. address error) */ -+static int saa7146_i2c_writeout(struct saa7146_dev *dev, __le32 *dword, int short_delay) -+{ -+ u32 status = 0, mc2 = 0; -+ int trial = 0; -+ unsigned long timeout; -+ -+ /* write out i2c-command */ -+ DEB_I2C("before: 0x%08x (status: 0x%08x), %d\n", -+ *dword, saa7146_read(dev, I2C_STATUS), dev->i2c_op); -+ -+ if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) { -+ -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, I2C_TRANSFER, le32_to_cpu(*dword)); -+ -+ dev->i2c_op = 1; -+ SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17); -+ SAA7146_IER_ENABLE(dev, MASK_16|MASK_17); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ -+ timeout = HZ/100 + 1; /* 10ms */ -+ timeout = wait_event_interruptible_timeout(dev->i2c_wq, dev->i2c_op == 0, timeout); -+ if (timeout == -ERESTARTSYS || dev->i2c_op) { -+ SAA7146_IER_DISABLE(dev, MASK_16|MASK_17); -+ SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17); -+ if (timeout == -ERESTARTSYS) -+ /* a signal arrived */ -+ return -ERESTARTSYS; -+ -+ pr_warn("%s %s [irq]: timed out waiting for end of xfer\n", -+ dev->name, __func__); -+ return -EIO; -+ } -+ status = saa7146_read(dev, I2C_STATUS); -+ } else { -+ saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -+ saa7146_write(dev, I2C_TRANSFER, le32_to_cpu(*dword)); -+ saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -+ -+ /* do not poll for i2c-status before upload is complete */ -+ timeout = jiffies + HZ/100 + 1; /* 10ms */ -+ while(1) { -+ mc2 = (saa7146_read(dev, MC2) & 0x1); -+ if( 0 != mc2 ) { -+ break; -+ } -+ if (time_after(jiffies,timeout)) { -+ pr_warn("%s %s: timed out waiting for MC2\n", -+ dev->name, __func__); -+ return -EIO; -+ } -+ } -+ /* wait until we get a transfer done or error */ -+ timeout = jiffies + HZ/100 + 1; /* 10ms */ -+ /* first read usually delivers bogus results... */ -+ saa7146_i2c_status(dev); -+ while(1) { -+ status = saa7146_i2c_status(dev); -+ if ((status & 0x3) != 1) -+ break; -+ if (time_after(jiffies,timeout)) { -+ /* this is normal when probing the bus -+ * (no answer from nonexisistant device...) -+ */ -+ pr_warn("%s %s [poll]: timed out waiting for end of xfer\n", -+ dev->name, __func__); -+ return -EIO; -+ } -+ if (++trial < 50 && short_delay) -+ udelay(10); -+ else -+ msleep(1); -+ } -+ } -+ -+ /* give a detailed status report */ -+ if ( 0 != (status & (SAA7146_I2C_SPERR | SAA7146_I2C_APERR | -+ SAA7146_I2C_DTERR | SAA7146_I2C_DRERR | -+ SAA7146_I2C_AL | SAA7146_I2C_ERR | -+ SAA7146_I2C_BUSY)) ) { -+ -+ if ( 0 == (status & SAA7146_I2C_ERR) || -+ 0 == (status & SAA7146_I2C_BUSY) ) { -+ /* it may take some time until ERR goes high - ignore */ -+ DEB_I2C("unexpected i2c status %04x\n", status); -+ } -+ if( 0 != (status & SAA7146_I2C_SPERR) ) { -+ DEB_I2C("error due to invalid start/stop condition\n"); -+ } -+ if( 0 != (status & SAA7146_I2C_DTERR) ) { -+ DEB_I2C("error in data transmission\n"); -+ } -+ if( 0 != (status & SAA7146_I2C_DRERR) ) { -+ DEB_I2C("error when receiving data\n"); -+ } -+ if( 0 != (status & SAA7146_I2C_AL) ) { -+ DEB_I2C("error because arbitration lost\n"); -+ } -+ -+ /* we handle address-errors here */ -+ if( 0 != (status & SAA7146_I2C_APERR) ) { -+ DEB_I2C("error in address phase\n"); -+ return -EREMOTEIO; -+ } -+ -+ return -EIO; -+ } -+ -+ /* read back data, just in case we were reading ... */ -+ *dword = cpu_to_le32(saa7146_read(dev, I2C_TRANSFER)); -+ -+ DEB_I2C("after: 0x%08x\n", *dword); -+ return 0; -+} -+ -+static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries) -+{ -+ int i = 0, count = 0; -+ __le32 *buffer = dev->d_i2c.cpu_addr; -+ int err = 0; -+ int short_delay = 0; -+ -+ if (mutex_lock_interruptible(&dev->i2c_lock)) -+ return -ERESTARTSYS; -+ -+ for(i=0;i count ) { -+ err = -1; -+ goto out; -+ } -+ -+ if ( count > 3 || 0 != (SAA7146_I2C_SHORT_DELAY & dev->ext->flags) ) -+ short_delay = 1; -+ -+ do { -+ /* reset the i2c-device if necessary */ -+ err = saa7146_i2c_reset(dev); -+ if ( 0 > err ) { -+ DEB_I2C("could not reset i2c-device\n"); -+ goto out; -+ } -+ -+ /* write out the u32s one after another */ -+ for(i = 0; i < count; i++) { -+ err = saa7146_i2c_writeout(dev, &buffer[i], short_delay); -+ if ( 0 != err) { -+ /* this one is unsatisfying: some i2c slaves on some -+ dvb cards don't acknowledge correctly, so the saa7146 -+ thinks that an address error occurred. in that case, the -+ transaction should be retrying, even if an address error -+ occurred. analog saa7146 based cards extensively rely on -+ i2c address probing, however, and address errors indicate that a -+ device is really *not* there. retrying in that case -+ increases the time the device needs to probe greatly, so -+ it should be avoided. So we bail out in irq mode after an -+ address error and trust the saa7146 address error detection. */ -+ if (-EREMOTEIO == err && 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) -+ goto out; -+ DEB_I2C("error while sending message(s). starting again\n"); -+ break; -+ } -+ } -+ if( 0 == err ) { -+ err = num; -+ break; -+ } -+ -+ /* delay a bit before retrying */ -+ msleep(10); -+ -+ } while (err != num && retries--); -+ -+ /* quit if any error occurred */ -+ if (err != num) -+ goto out; -+ -+ /* if any things had to be read, get the results */ -+ if ( 0 != saa7146_i2c_msg_cleanup(msgs, num, buffer)) { -+ DEB_I2C("could not cleanup i2c-message\n"); -+ err = -1; -+ goto out; -+ } -+ -+ /* return the number of delivered messages */ -+ DEB_I2C("transmission successful. (msg:%d)\n", err); -+out: -+ /* another bug in revision 0: the i2c-registers get uploaded randomly by other -+ uploads, so we better clear them out before continuing */ -+ if( 0 == dev->revision ) { -+ __le32 zero = 0; -+ saa7146_i2c_reset(dev); -+ if( 0 != saa7146_i2c_writeout(dev, &zero, short_delay)) { -+ pr_info("revision 0 error. this should never happen\n"); -+ } -+ } -+ -+ mutex_unlock(&dev->i2c_lock); -+ return err; -+} -+ -+/* utility functions */ -+static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) -+{ -+ struct v4l2_device *v4l2_dev = i2c_get_adapdata(adapter); -+ struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev); -+ -+ /* use helper function to transfer data */ -+ return saa7146_i2c_transfer(dev, msg, num, adapter->retries); -+} -+ -+ -+/*****************************************************************************/ -+/* i2c-adapter helper functions */ -+ -+/* exported algorithm data */ -+static struct i2c_algorithm saa7146_algo = { -+ .master_xfer = saa7146_i2c_xfer, -+ .functionality = saa7146_i2c_func, -+}; -+ -+int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate) -+{ -+ DEB_EE("bitrate: 0x%08x\n", bitrate); -+ -+ /* enable i2c-port pins */ -+ saa7146_write(dev, MC1, (MASK_08 | MASK_24)); -+ -+ dev->i2c_bitrate = bitrate; -+ saa7146_i2c_reset(dev); -+ -+ if (i2c_adapter) { -+ i2c_set_adapdata(i2c_adapter, &dev->v4l2_dev); -+ i2c_adapter->dev.parent = &dev->pci->dev; -+ i2c_adapter->algo = &saa7146_algo; -+ i2c_adapter->algo_data = NULL; -+ i2c_adapter->timeout = SAA7146_I2C_TIMEOUT; -+ i2c_adapter->retries = SAA7146_I2C_RETRIES; -+ } -+ -+ return 0; -+} -diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c -new file mode 100644 -index 0000000..1e71e37 ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_vbi.c -@@ -0,0 +1,498 @@ -+#include -+ -+static int vbi_pixel_to_capture = 720 * 2; -+ -+static int vbi_workaround(struct saa7146_dev *dev) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ u32 *cpu; -+ dma_addr_t dma_addr; -+ -+ int count = 0; -+ int i; -+ -+ DECLARE_WAITQUEUE(wait, current); -+ -+ DEB_VBI("dev:%p\n", dev); -+ -+ /* once again, a bug in the saa7146: the brs acquisition -+ is buggy and especially the BXO-counter does not work -+ as specified. there is this workaround, but please -+ don't let me explain it. ;-) */ -+ -+ cpu = pci_alloc_consistent(dev->pci, 4096, &dma_addr); -+ if (NULL == cpu) -+ return -ENOMEM; -+ -+ /* setup some basic programming, just for the workaround */ -+ saa7146_write(dev, BASE_EVEN3, dma_addr); -+ saa7146_write(dev, BASE_ODD3, dma_addr+vbi_pixel_to_capture); -+ saa7146_write(dev, PROT_ADDR3, dma_addr+4096); -+ saa7146_write(dev, PITCH3, vbi_pixel_to_capture); -+ saa7146_write(dev, BASE_PAGE3, 0x0); -+ saa7146_write(dev, NUM_LINE_BYTE3, (2<<16)|((vbi_pixel_to_capture)<<0)); -+ saa7146_write(dev, MC2, MASK_04|MASK_20); -+ -+ /* load brs-control register */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -+ /* BXO = 1h, BRS to outbound */ -+ WRITE_RPS1(0xc000008c); -+ /* wait for vbi_a or vbi_b*/ -+ if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) { -+ DEB_D("...using port b\n"); -+ WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_E_FID_B); -+ WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_O_FID_B); -+/* -+ WRITE_RPS1(CMD_PAUSE | MASK_09); -+*/ -+ } else { -+ DEB_D("...using port a\n"); -+ WRITE_RPS1(CMD_PAUSE | MASK_10); -+ } -+ /* upload brs */ -+ WRITE_RPS1(CMD_UPLOAD | MASK_08); -+ /* load brs-control register */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -+ /* BYO = 1, BXO = NQBIL (=1728 for PAL, for NTSC this is 858*2) - NumByte3 (=1440) = 288 */ -+ WRITE_RPS1(((1728-(vbi_pixel_to_capture)) << 7) | MASK_19); -+ /* wait for brs_done */ -+ WRITE_RPS1(CMD_PAUSE | MASK_08); -+ /* upload brs */ -+ WRITE_RPS1(CMD_UPLOAD | MASK_08); -+ /* load video-dma3 NumLines3 and NumBytes3 */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (NUM_LINE_BYTE3/4)); -+ /* dev->vbi_count*2 lines, 720 pixel (= 1440 Bytes) */ -+ WRITE_RPS1((2 << 16) | (vbi_pixel_to_capture)); -+ /* load brs-control register */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -+ /* Set BRS right: note: this is an experimental value for BXO (=> PAL!) */ -+ WRITE_RPS1((540 << 7) | (5 << 19)); // 5 == vbi_start -+ /* wait for brs_done */ -+ WRITE_RPS1(CMD_PAUSE | MASK_08); -+ /* upload brs and video-dma3*/ -+ WRITE_RPS1(CMD_UPLOAD | MASK_08 | MASK_04); -+ /* load mc2 register: enable dma3 */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC1/4)); -+ WRITE_RPS1(MASK_20 | MASK_04); -+ /* generate interrupt */ -+ WRITE_RPS1(CMD_INTERRUPT); -+ /* stop rps1 */ -+ WRITE_RPS1(CMD_STOP); -+ -+ /* we have to do the workaround twice to be sure that -+ everything is ok */ -+ for(i = 0; i < 2; i++) { -+ -+ /* indicate to the irq handler that we do the workaround */ -+ saa7146_write(dev, MC2, MASK_31|MASK_15); -+ -+ saa7146_write(dev, NUM_LINE_BYTE3, (1<<16)|(2<<0)); -+ saa7146_write(dev, MC2, MASK_04|MASK_20); -+ -+ /* enable rps1 irqs */ -+ SAA7146_IER_ENABLE(dev,MASK_28); -+ -+ /* prepare to wait to be woken up by the irq-handler */ -+ add_wait_queue(&vv->vbi_wq, &wait); -+ current->state = TASK_INTERRUPTIBLE; -+ -+ /* start rps1 to enable workaround */ -+ saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); -+ saa7146_write(dev, MC1, (MASK_13 | MASK_29)); -+ -+ schedule(); -+ -+ DEB_VBI("brs bug workaround %d/1\n", i); -+ -+ remove_wait_queue(&vv->vbi_wq, &wait); -+ current->state = TASK_RUNNING; -+ -+ /* disable rps1 irqs */ -+ SAA7146_IER_DISABLE(dev,MASK_28); -+ -+ /* stop video-dma3 */ -+ saa7146_write(dev, MC1, MASK_20); -+ -+ if(signal_pending(current)) { -+ -+ DEB_VBI("aborted (rps:0x%08x)\n", -+ saa7146_read(dev, RPS_ADDR1)); -+ -+ /* stop rps1 for sure */ -+ saa7146_write(dev, MC1, MASK_29); -+ -+ pci_free_consistent(dev->pci, 4096, cpu, dma_addr); -+ return -EINTR; -+ } -+ } -+ -+ pci_free_consistent(dev->pci, 4096, cpu, dma_addr); -+ return 0; -+} -+ -+static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ struct saa7146_video_dma vdma3; -+ -+ int count = 0; -+ unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; -+ unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; -+ -+/* -+ vdma3.base_even = 0xc8000000+2560*70; -+ vdma3.base_odd = 0xc8000000; -+ vdma3.prot_addr = 0xc8000000+2560*164; -+ vdma3.pitch = 2560; -+ vdma3.base_page = 0; -+ vdma3.num_line_byte = (64<<16)|((vbi_pixel_to_capture)<<0); // set above! -+*/ -+ vdma3.base_even = buf->pt[2].offset; -+ vdma3.base_odd = buf->pt[2].offset + 16 * vbi_pixel_to_capture; -+ vdma3.prot_addr = buf->pt[2].offset + 16 * 2 * vbi_pixel_to_capture; -+ vdma3.pitch = vbi_pixel_to_capture; -+ vdma3.base_page = buf->pt[2].dma | ME1; -+ vdma3.num_line_byte = (16 << 16) | vbi_pixel_to_capture; -+ -+ saa7146_write_out_dma(dev, 3, &vdma3); -+ -+ /* write beginning of rps-program */ -+ count = 0; -+ -+ /* wait for o_fid_a/b / e_fid_a/b toggle only if bit 1 is not set */ -+ -+ /* we don't wait here for the first field anymore. this is different from the video -+ capture and might cause that the first buffer is only half filled (with only -+ one field). but since this is some sort of streaming data, this is not that negative. -+ but by doing this, we can use the whole engine from videobuf-dma-sg.c... */ -+ -+/* -+ WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait); -+ WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | o_wait); -+*/ -+ /* set bit 1 */ -+ WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC2/4)); -+ WRITE_RPS1(MASK_28 | MASK_12); -+ -+ /* turn on video-dma3 */ -+ WRITE_RPS1(CMD_WR_REG_MASK | (MC1/4)); -+ WRITE_RPS1(MASK_04 | MASK_20); /* => mask */ -+ WRITE_RPS1(MASK_04 | MASK_20); /* => values */ -+ -+ /* wait for o_fid_a/b / e_fid_a/b toggle */ -+ WRITE_RPS1(CMD_PAUSE | o_wait); -+ WRITE_RPS1(CMD_PAUSE | e_wait); -+ -+ /* generate interrupt */ -+ WRITE_RPS1(CMD_INTERRUPT); -+ -+ /* stop */ -+ WRITE_RPS1(CMD_STOP); -+ -+ /* enable rps1 irqs */ -+ SAA7146_IER_ENABLE(dev, MASK_28); -+ -+ /* write the address of the rps-program */ -+ saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); -+ -+ /* turn on rps */ -+ saa7146_write(dev, MC1, (MASK_13 | MASK_29)); -+} -+ -+static int buffer_activate(struct saa7146_dev *dev, -+ struct saa7146_buf *buf, -+ struct saa7146_buf *next) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ buf->vb.state = VIDEOBUF_ACTIVE; -+ -+ DEB_VBI("dev:%p, buf:%p, next:%p\n", dev, buf, next); -+ saa7146_set_vbi_capture(dev,buf,next); -+ -+ mod_timer(&vv->vbi_dmaq.timeout, jiffies+BUFFER_TIMEOUT); -+ return 0; -+} -+ -+static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ -+ int err = 0; -+ int lines, llength, size; -+ -+ lines = 16 * 2 ; /* 2 fields */ -+ llength = vbi_pixel_to_capture; -+ size = lines * llength; -+ -+ DEB_VBI("vb:%p\n", vb); -+ -+ if (0 != buf->vb.baddr && buf->vb.bsize < size) { -+ DEB_VBI("size mismatch\n"); -+ return -EINVAL; -+ } -+ -+ if (buf->vb.size != size) -+ saa7146_dma_free(dev,q,buf); -+ -+ if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { -+ struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -+ -+ buf->vb.width = llength; -+ buf->vb.height = lines; -+ buf->vb.size = size; -+ buf->vb.field = field; // FIXME: check this -+ -+ saa7146_pgtable_free(dev->pci, &buf->pt[2]); -+ saa7146_pgtable_alloc(dev->pci, &buf->pt[2]); -+ -+ err = videobuf_iolock(q,&buf->vb, NULL); -+ if (err) -+ goto oops; -+ err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], -+ dma->sglist, dma->sglen); -+ if (0 != err) -+ return err; -+ } -+ buf->vb.state = VIDEOBUF_PREPARED; -+ buf->activate = buffer_activate; -+ -+ return 0; -+ -+ oops: -+ DEB_VBI("error out\n"); -+ saa7146_dma_free(dev,q,buf); -+ -+ return err; -+} -+ -+static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) -+{ -+ int llength,lines; -+ -+ lines = 16 * 2 ; /* 2 fields */ -+ llength = vbi_pixel_to_capture; -+ -+ *size = lines * llength; -+ *count = 2; -+ -+ DEB_VBI("count:%d, size:%d\n", *count, *size); -+ -+ return 0; -+} -+ -+static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ -+ DEB_VBI("vb:%p\n", vb); -+ saa7146_buffer_queue(dev, &vv->vbi_dmaq, buf); -+} -+ -+static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ -+ DEB_VBI("vb:%p\n", vb); -+ saa7146_dma_free(dev,q,buf); -+} -+ -+static struct videobuf_queue_ops vbi_qops = { -+ .buf_setup = buffer_setup, -+ .buf_prepare = buffer_prepare, -+ .buf_queue = buffer_queue, -+ .buf_release = buffer_release, -+}; -+ -+/* ------------------------------------------------------------------ */ -+ -+static void vbi_stop(struct saa7146_fh *fh, struct file *file) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ unsigned long flags; -+ DEB_VBI("dev:%p, fh:%p\n", dev, fh); -+ -+ spin_lock_irqsave(&dev->slock,flags); -+ -+ /* disable rps1 */ -+ saa7146_write(dev, MC1, MASK_29); -+ -+ /* disable rps1 irqs */ -+ SAA7146_IER_DISABLE(dev, MASK_28); -+ -+ /* shut down dma 3 transfers */ -+ saa7146_write(dev, MC1, MASK_20); -+ -+ if (vv->vbi_dmaq.curr) -+ saa7146_buffer_finish(dev, &vv->vbi_dmaq, VIDEOBUF_DONE); -+ -+ videobuf_queue_cancel(&fh->vbi_q); -+ -+ vv->vbi_streaming = NULL; -+ -+ del_timer(&vv->vbi_dmaq.timeout); -+ del_timer(&vv->vbi_read_timeout); -+ -+ spin_unlock_irqrestore(&dev->slock, flags); -+} -+ -+static void vbi_read_timeout(unsigned long data) -+{ -+ struct file *file = (struct file*)data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ -+ DEB_VBI("dev:%p, fh:%p\n", dev, fh); -+ -+ vbi_stop(fh, file); -+} -+ -+static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv) -+{ -+ DEB_VBI("dev:%p\n", dev); -+ -+ INIT_LIST_HEAD(&vv->vbi_dmaq.queue); -+ -+ init_timer(&vv->vbi_dmaq.timeout); -+ vv->vbi_dmaq.timeout.function = saa7146_buffer_timeout; -+ vv->vbi_dmaq.timeout.data = (unsigned long)(&vv->vbi_dmaq); -+ vv->vbi_dmaq.dev = dev; -+ -+ init_waitqueue_head(&vv->vbi_wq); -+} -+ -+static int vbi_open(struct saa7146_dev *dev, struct file *file) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_vv *vv = fh->dev->vv_data; -+ -+ u32 arbtr_ctrl = saa7146_read(dev, PCI_BT_V1); -+ int ret = 0; -+ -+ DEB_VBI("dev:%p, fh:%p\n", dev, fh); -+ -+ ret = saa7146_res_get(fh, RESOURCE_DMA3_BRS); -+ if (0 == ret) { -+ DEB_S("cannot get vbi RESOURCE_DMA3_BRS resource\n"); -+ return -EBUSY; -+ } -+ -+ /* adjust arbitrition control for video dma 3 */ -+ arbtr_ctrl &= ~0x1f0000; -+ arbtr_ctrl |= 0x1d0000; -+ saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); -+ saa7146_write(dev, MC2, (MASK_04|MASK_20)); -+ -+ videobuf_queue_sg_init(&fh->vbi_q, &vbi_qops, -+ &dev->pci->dev, &dev->slock, -+ V4L2_BUF_TYPE_VBI_CAPTURE, -+ V4L2_FIELD_SEQ_TB, // FIXME: does this really work? -+ sizeof(struct saa7146_buf), -+ file, &dev->v4l2_lock); -+ -+ vv->vbi_read_timeout.function = vbi_read_timeout; -+ vv->vbi_read_timeout.data = (unsigned long)file; -+ -+ /* initialize the brs */ -+ if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) { -+ saa7146_write(dev, BRS_CTRL, MASK_30|MASK_29 | (7 << 19)); -+ } else { -+ saa7146_write(dev, BRS_CTRL, 0x00000001); -+ -+ if (0 != (ret = vbi_workaround(dev))) { -+ DEB_VBI("vbi workaround failed!\n"); -+ /* return ret;*/ -+ } -+ } -+ -+ /* upload brs register */ -+ saa7146_write(dev, MC2, (MASK_08|MASK_24)); -+ return 0; -+} -+ -+static void vbi_close(struct saa7146_dev *dev, struct file *file) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_vv *vv = dev->vv_data; -+ DEB_VBI("dev:%p, fh:%p\n", dev, fh); -+ -+ if( fh == vv->vbi_streaming ) { -+ vbi_stop(fh, file); -+ } -+ saa7146_res_free(fh, RESOURCE_DMA3_BRS); -+} -+ -+static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ spin_lock(&dev->slock); -+ -+ if (vv->vbi_dmaq.curr) { -+ DEB_VBI("dev:%p, curr:%p\n", dev, vv->vbi_dmaq.curr); -+ /* this must be += 2, one count for each field */ -+ vv->vbi_fieldcount+=2; -+ vv->vbi_dmaq.curr->vb.field_count = vv->vbi_fieldcount; -+ saa7146_buffer_finish(dev, &vv->vbi_dmaq, VIDEOBUF_DONE); -+ } else { -+ DEB_VBI("dev:%p\n", dev); -+ } -+ saa7146_buffer_next(dev, &vv->vbi_dmaq, 1); -+ -+ spin_unlock(&dev->slock); -+} -+ -+static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ ssize_t ret = 0; -+ -+ DEB_VBI("dev:%p, fh:%p\n", dev, fh); -+ -+ if( NULL == vv->vbi_streaming ) { -+ // fixme: check if dma3 is available -+ // fixme: activate vbi engine here if necessary. (really?) -+ vv->vbi_streaming = fh; -+ } -+ -+ if( fh != vv->vbi_streaming ) { -+ DEB_VBI("open %p is already using vbi capture\n", -+ vv->vbi_streaming); -+ return -EBUSY; -+ } -+ -+ mod_timer(&vv->vbi_read_timeout, jiffies+BUFFER_TIMEOUT); -+ ret = videobuf_read_stream(&fh->vbi_q, data, count, ppos, 1, -+ file->f_flags & O_NONBLOCK); -+/* -+ printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3)); -+ printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3)); -+ printk("PROT_ADDR3: 0x%08x\n", saa7146_read(dev, PROT_ADDR3)); -+ printk("PITCH3: 0x%08x\n", saa7146_read(dev, PITCH3)); -+ printk("BASE_PAGE3: 0x%08x\n", saa7146_read(dev, BASE_PAGE3)); -+ printk("NUM_LINE_BYTE3: 0x%08x\n", saa7146_read(dev, NUM_LINE_BYTE3)); -+ printk("BRS_CTRL: 0x%08x\n", saa7146_read(dev, BRS_CTRL)); -+*/ -+ return ret; -+} -+ -+struct saa7146_use_ops saa7146_vbi_uops = { -+ .init = vbi_init, -+ .open = vbi_open, -+ .release = vbi_close, -+ .irq_done = vbi_irq_done, -+ .read = vbi_read, -+}; -diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c -new file mode 100644 -index 0000000..4143d61 ---- /dev/null -+++ b/drivers/media/common/saa7146/saa7146_video.c -@@ -0,0 +1,1332 @@ -+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -+ -+#include -+#include -+#include -+#include -+#include -+ -+static int max_memory = 32; -+ -+module_param(max_memory, int, 0644); -+MODULE_PARM_DESC(max_memory, "maximum memory usage for capture buffers (default: 32Mb)"); -+ -+#define IS_CAPTURE_ACTIVE(fh) \ -+ (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh)) -+ -+#define IS_OVERLAY_ACTIVE(fh) \ -+ (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh)) -+ -+/* format descriptions for capture and preview */ -+static struct saa7146_format formats[] = { -+ { -+ .name = "RGB-8 (3-3-2)", -+ .pixelformat = V4L2_PIX_FMT_RGB332, -+ .trans = RGB08_COMPOSED, -+ .depth = 8, -+ .flags = 0, -+ }, { -+ .name = "RGB-16 (5/B-6/G-5/R)", -+ .pixelformat = V4L2_PIX_FMT_RGB565, -+ .trans = RGB16_COMPOSED, -+ .depth = 16, -+ .flags = 0, -+ }, { -+ .name = "RGB-24 (B-G-R)", -+ .pixelformat = V4L2_PIX_FMT_BGR24, -+ .trans = RGB24_COMPOSED, -+ .depth = 24, -+ .flags = 0, -+ }, { -+ .name = "RGB-32 (B-G-R)", -+ .pixelformat = V4L2_PIX_FMT_BGR32, -+ .trans = RGB32_COMPOSED, -+ .depth = 32, -+ .flags = 0, -+ }, { -+ .name = "RGB-32 (R-G-B)", -+ .pixelformat = V4L2_PIX_FMT_RGB32, -+ .trans = RGB32_COMPOSED, -+ .depth = 32, -+ .flags = 0, -+ .swap = 0x2, -+ }, { -+ .name = "Greyscale-8", -+ .pixelformat = V4L2_PIX_FMT_GREY, -+ .trans = Y8, -+ .depth = 8, -+ .flags = 0, -+ }, { -+ .name = "YUV 4:2:2 planar (Y-Cb-Cr)", -+ .pixelformat = V4L2_PIX_FMT_YUV422P, -+ .trans = YUV422_DECOMPOSED, -+ .depth = 16, -+ .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, -+ }, { -+ .name = "YVU 4:2:0 planar (Y-Cb-Cr)", -+ .pixelformat = V4L2_PIX_FMT_YVU420, -+ .trans = YUV420_DECOMPOSED, -+ .depth = 12, -+ .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, -+ }, { -+ .name = "YUV 4:2:0 planar (Y-Cb-Cr)", -+ .pixelformat = V4L2_PIX_FMT_YUV420, -+ .trans = YUV420_DECOMPOSED, -+ .depth = 12, -+ .flags = FORMAT_IS_PLANAR, -+ }, { -+ .name = "YUV 4:2:2 (U-Y-V-Y)", -+ .pixelformat = V4L2_PIX_FMT_UYVY, -+ .trans = YUV422_COMPOSED, -+ .depth = 16, -+ .flags = 0, -+ } -+}; -+ -+/* unfortunately, the saa7146 contains a bug which prevents it from doing on-the-fly byte swaps. -+ due to this, it's impossible to provide additional *packed* formats, which are simply byte swapped -+ (like V4L2_PIX_FMT_YUYV) ... 8-( */ -+ -+static int NUM_FORMATS = sizeof(formats)/sizeof(struct saa7146_format); -+ -+struct saa7146_format* saa7146_format_by_fourcc(struct saa7146_dev *dev, int fourcc) -+{ -+ int i, j = NUM_FORMATS; -+ -+ for (i = 0; i < j; i++) { -+ if (formats[i].pixelformat == fourcc) { -+ return formats+i; -+ } -+ } -+ -+ DEB_D("unknown pixelformat:'%4.4s'\n", (char *)&fourcc); -+ return NULL; -+} -+ -+static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f); -+ -+int saa7146_start_preview(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct v4l2_format fmt; -+ int ret = 0, err = 0; -+ -+ DEB_EE("dev:%p, fh:%p\n", dev, fh); -+ -+ /* check if we have overlay information */ -+ if (vv->ov.fh == NULL) { -+ DEB_D("no overlay data available. try S_FMT first.\n"); -+ return -EAGAIN; -+ } -+ -+ /* check if streaming capture is running */ -+ if (IS_CAPTURE_ACTIVE(fh) != 0) { -+ DEB_D("streaming capture is active\n"); -+ return -EBUSY; -+ } -+ -+ /* check if overlay is running */ -+ if (IS_OVERLAY_ACTIVE(fh) != 0) { -+ if (vv->video_fh == fh) { -+ DEB_D("overlay is already active\n"); -+ return 0; -+ } -+ DEB_D("overlay is already active in another open\n"); -+ return -EBUSY; -+ } -+ -+ if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) { -+ DEB_D("cannot get necessary overlay resources\n"); -+ return -EBUSY; -+ } -+ -+ fmt.fmt.win = vv->ov.win; -+ err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt); -+ if (0 != err) { -+ saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -+ return -EBUSY; -+ } -+ vv->ov.win = fmt.fmt.win; -+ -+ DEB_D("%dx%d+%d+%d %s field=%s\n", -+ vv->ov.win.w.width, vv->ov.win.w.height, -+ vv->ov.win.w.left, vv->ov.win.w.top, -+ vv->ov_fmt->name, v4l2_field_names[vv->ov.win.field]); -+ -+ if (0 != (ret = saa7146_enable_overlay(fh))) { -+ DEB_D("enabling overlay failed: %d\n", ret); -+ saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -+ return ret; -+ } -+ -+ vv->video_status = STATUS_OVERLAY; -+ vv->video_fh = fh; -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_start_preview); -+ -+int saa7146_stop_preview(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ DEB_EE("dev:%p, fh:%p\n", dev, fh); -+ -+ /* check if streaming capture is running */ -+ if (IS_CAPTURE_ACTIVE(fh) != 0) { -+ DEB_D("streaming capture is active\n"); -+ return -EBUSY; -+ } -+ -+ /* check if overlay is running at all */ -+ if ((vv->video_status & STATUS_OVERLAY) == 0) { -+ DEB_D("no active overlay\n"); -+ return 0; -+ } -+ -+ if (vv->video_fh != fh) { -+ DEB_D("overlay is active, but in another open\n"); -+ return -EBUSY; -+ } -+ -+ vv->video_status = 0; -+ vv->video_fh = NULL; -+ -+ saa7146_disable_overlay(fh); -+ -+ saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(saa7146_stop_preview); -+ -+/********************************************************************************/ -+/* common pagetable functions */ -+ -+static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) -+{ -+ struct pci_dev *pci = dev->pci; -+ struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -+ struct scatterlist *list = dma->sglist; -+ int length = dma->sglen; -+ struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -+ -+ DEB_EE("dev:%p, buf:%p, sg_len:%d\n", dev, buf, length); -+ -+ if( 0 != IS_PLANAR(sfmt->trans)) { -+ struct saa7146_pgtable *pt1 = &buf->pt[0]; -+ struct saa7146_pgtable *pt2 = &buf->pt[1]; -+ struct saa7146_pgtable *pt3 = &buf->pt[2]; -+ __le32 *ptr1, *ptr2, *ptr3; -+ __le32 fill; -+ -+ int size = buf->fmt->width*buf->fmt->height; -+ int i,p,m1,m2,m3,o1,o2; -+ -+ switch( sfmt->depth ) { -+ case 12: { -+ /* create some offsets inside the page table */ -+ m1 = ((size+PAGE_SIZE)/PAGE_SIZE)-1; -+ m2 = ((size+(size/4)+PAGE_SIZE)/PAGE_SIZE)-1; -+ m3 = ((size+(size/2)+PAGE_SIZE)/PAGE_SIZE)-1; -+ o1 = size%PAGE_SIZE; -+ o2 = (size+(size/4))%PAGE_SIZE; -+ DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n", -+ size, m1, m2, m3, o1, o2); -+ break; -+ } -+ case 16: { -+ /* create some offsets inside the page table */ -+ m1 = ((size+PAGE_SIZE)/PAGE_SIZE)-1; -+ m2 = ((size+(size/2)+PAGE_SIZE)/PAGE_SIZE)-1; -+ m3 = ((2*size+PAGE_SIZE)/PAGE_SIZE)-1; -+ o1 = size%PAGE_SIZE; -+ o2 = (size+(size/2))%PAGE_SIZE; -+ DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n", -+ size, m1, m2, m3, o1, o2); -+ break; -+ } -+ default: { -+ return -1; -+ } -+ } -+ -+ ptr1 = pt1->cpu; -+ ptr2 = pt2->cpu; -+ ptr3 = pt3->cpu; -+ -+ /* walk all pages, copy all page addresses to ptr1 */ -+ for (i = 0; i < length; i++, list++) { -+ for (p = 0; p * 4096 < list->length; p++, ptr1++) { -+ *ptr1 = cpu_to_le32(sg_dma_address(list) - list->offset); -+ } -+ } -+/* -+ ptr1 = pt1->cpu; -+ for(j=0;j<40;j++) { -+ printk("ptr1 %d: 0x%08x\n",j,ptr1[j]); -+ } -+*/ -+ -+ /* if we have a user buffer, the first page may not be -+ aligned to a page boundary. */ -+ pt1->offset = dma->sglist->offset; -+ pt2->offset = pt1->offset+o1; -+ pt3->offset = pt1->offset+o2; -+ -+ /* create video-dma2 page table */ -+ ptr1 = pt1->cpu; -+ for(i = m1; i <= m2 ; i++, ptr2++) { -+ *ptr2 = ptr1[i]; -+ } -+ fill = *(ptr2-1); -+ for(;i<1024;i++,ptr2++) { -+ *ptr2 = fill; -+ } -+ /* create video-dma3 page table */ -+ ptr1 = pt1->cpu; -+ for(i = m2; i <= m3; i++,ptr3++) { -+ *ptr3 = ptr1[i]; -+ } -+ fill = *(ptr3-1); -+ for(;i<1024;i++,ptr3++) { -+ *ptr3 = fill; -+ } -+ /* finally: finish up video-dma1 page table */ -+ ptr1 = pt1->cpu+m1; -+ fill = pt1->cpu[m1]; -+ for(i=m1;i<1024;i++,ptr1++) { -+ *ptr1 = fill; -+ } -+/* -+ ptr1 = pt1->cpu; -+ ptr2 = pt2->cpu; -+ ptr3 = pt3->cpu; -+ for(j=0;j<40;j++) { -+ printk("ptr1 %d: 0x%08x\n",j,ptr1[j]); -+ } -+ for(j=0;j<40;j++) { -+ printk("ptr2 %d: 0x%08x\n",j,ptr2[j]); -+ } -+ for(j=0;j<40;j++) { -+ printk("ptr3 %d: 0x%08x\n",j,ptr3[j]); -+ } -+*/ -+ } else { -+ struct saa7146_pgtable *pt = &buf->pt[0]; -+ return saa7146_pgtable_build_single(pci, pt, list, length); -+ } -+ -+ return 0; -+} -+ -+ -+/********************************************************************************/ -+/* file operations */ -+ -+static int video_begin(struct saa7146_fh *fh) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_format *fmt = NULL; -+ unsigned int resource; -+ int ret = 0, err = 0; -+ -+ DEB_EE("dev:%p, fh:%p\n", dev, fh); -+ -+ if ((vv->video_status & STATUS_CAPTURE) != 0) { -+ if (vv->video_fh == fh) { -+ DEB_S("already capturing\n"); -+ return 0; -+ } -+ DEB_S("already capturing in another open\n"); -+ return -EBUSY; -+ } -+ -+ if ((vv->video_status & STATUS_OVERLAY) != 0) { -+ DEB_S("warning: suspending overlay video for streaming capture\n"); -+ vv->ov_suspend = vv->video_fh; -+ err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */ -+ if (0 != err) { -+ DEB_D("suspending video failed. aborting\n"); -+ return err; -+ } -+ } -+ -+ fmt = saa7146_format_by_fourcc(dev, vv->video_fmt.pixelformat); -+ /* we need to have a valid format set here */ -+ BUG_ON(NULL == fmt); -+ -+ if (0 != (fmt->flags & FORMAT_IS_PLANAR)) { -+ resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; -+ } else { -+ resource = RESOURCE_DMA1_HPS; -+ } -+ -+ ret = saa7146_res_get(fh, resource); -+ if (0 == ret) { -+ DEB_S("cannot get capture resource %d\n", resource); -+ if (vv->ov_suspend != NULL) { -+ saa7146_start_preview(vv->ov_suspend); -+ vv->ov_suspend = NULL; -+ } -+ return -EBUSY; -+ } -+ -+ /* clear out beginning of streaming bit (rps register 0)*/ -+ saa7146_write(dev, MC2, MASK_27 ); -+ -+ /* enable rps0 irqs */ -+ SAA7146_IER_ENABLE(dev, MASK_27); -+ -+ vv->video_fh = fh; -+ vv->video_status = STATUS_CAPTURE; -+ -+ return 0; -+} -+ -+static int video_end(struct saa7146_fh *fh, struct file *file) -+{ -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_format *fmt = NULL; -+ unsigned long flags; -+ unsigned int resource; -+ u32 dmas = 0; -+ DEB_EE("dev:%p, fh:%p\n", dev, fh); -+ -+ if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) { -+ DEB_S("not capturing\n"); -+ return 0; -+ } -+ -+ if (vv->video_fh != fh) { -+ DEB_S("capturing, but in another open\n"); -+ return -EBUSY; -+ } -+ -+ fmt = saa7146_format_by_fourcc(dev, vv->video_fmt.pixelformat); -+ /* we need to have a valid format set here */ -+ BUG_ON(NULL == fmt); -+ -+ if (0 != (fmt->flags & FORMAT_IS_PLANAR)) { -+ resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; -+ dmas = MASK_22 | MASK_21 | MASK_20; -+ } else { -+ resource = RESOURCE_DMA1_HPS; -+ dmas = MASK_22; -+ } -+ spin_lock_irqsave(&dev->slock,flags); -+ -+ /* disable rps0 */ -+ saa7146_write(dev, MC1, MASK_28); -+ -+ /* disable rps0 irqs */ -+ SAA7146_IER_DISABLE(dev, MASK_27); -+ -+ /* shut down all used video dma transfers */ -+ saa7146_write(dev, MC1, dmas); -+ -+ spin_unlock_irqrestore(&dev->slock, flags); -+ -+ vv->video_fh = NULL; -+ vv->video_status = 0; -+ -+ saa7146_res_free(fh, resource); -+ -+ if (vv->ov_suspend != NULL) { -+ saa7146_start_preview(vv->ov_suspend); -+ vv->ov_suspend = NULL; -+ } -+ -+ return 0; -+} -+ -+static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *cap) -+{ -+ struct video_device *vdev = video_devdata(file); -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ -+ strcpy((char *)cap->driver, "saa7146 v4l2"); -+ strlcpy((char *)cap->card, dev->ext->name, sizeof(cap->card)); -+ sprintf((char *)cap->bus_info, "PCI:%s", pci_name(dev->pci)); -+ cap->device_caps = -+ V4L2_CAP_VIDEO_CAPTURE | -+ V4L2_CAP_VIDEO_OVERLAY | -+ V4L2_CAP_READWRITE | -+ V4L2_CAP_STREAMING; -+ cap->device_caps |= dev->ext_vv_data->capabilities; -+ cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS; -+ if (vdev->vfl_type == VFL_TYPE_GRABBER) -+ cap->device_caps &= -+ ~(V4L2_CAP_VBI_CAPTURE | V4L2_CAP_SLICED_VBI_OUTPUT); -+ else -+ cap->device_caps &= -+ ~(V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_AUDIO); -+ return 0; -+} -+ -+static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ *fb = vv->ov_fb; -+ fb->capability = V4L2_FBUF_CAP_LIST_CLIPPING; -+ fb->flags = V4L2_FBUF_FLAG_PRIMARY; -+ return 0; -+} -+ -+static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *fb) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_format *fmt; -+ -+ DEB_EE("VIDIOC_S_FBUF\n"); -+ -+ if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO)) -+ return -EPERM; -+ -+ /* check args */ -+ fmt = saa7146_format_by_fourcc(dev, fb->fmt.pixelformat); -+ if (NULL == fmt) -+ return -EINVAL; -+ -+ /* planar formats are not allowed for overlay video, clipping and video dma would clash */ -+ if (fmt->flags & FORMAT_IS_PLANAR) -+ DEB_S("planar pixelformat '%4.4s' not allowed for overlay\n", -+ (char *)&fmt->pixelformat); -+ -+ /* check if overlay is running */ -+ if (IS_OVERLAY_ACTIVE(fh) != 0) { -+ if (vv->video_fh != fh) { -+ DEB_D("refusing to change framebuffer informations while overlay is active in another open\n"); -+ return -EBUSY; -+ } -+ } -+ -+ /* ok, accept it */ -+ vv->ov_fb = *fb; -+ vv->ov_fmt = fmt; -+ -+ if (vv->ov_fb.fmt.bytesperline < vv->ov_fb.fmt.width) { -+ vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8; -+ DEB_D("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline); -+ } -+ return 0; -+} -+ -+static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) -+{ -+ if (f->index >= NUM_FORMATS) -+ return -EINVAL; -+ strlcpy((char *)f->description, formats[f->index].name, -+ sizeof(f->description)); -+ f->pixelformat = formats[f->index].pixelformat; -+ return 0; -+} -+ -+int saa7146_s_ctrl(struct v4l2_ctrl *ctrl) -+{ -+ struct saa7146_dev *dev = container_of(ctrl->handler, -+ struct saa7146_dev, ctrl_handler); -+ struct saa7146_vv *vv = dev->vv_data; -+ u32 val; -+ -+ switch (ctrl->id) { -+ case V4L2_CID_BRIGHTNESS: -+ val = saa7146_read(dev, BCS_CTRL); -+ val &= 0x00ffffff; -+ val |= (ctrl->val << 24); -+ saa7146_write(dev, BCS_CTRL, val); -+ saa7146_write(dev, MC2, MASK_22 | MASK_06); -+ break; -+ -+ case V4L2_CID_CONTRAST: -+ val = saa7146_read(dev, BCS_CTRL); -+ val &= 0xff00ffff; -+ val |= (ctrl->val << 16); -+ saa7146_write(dev, BCS_CTRL, val); -+ saa7146_write(dev, MC2, MASK_22 | MASK_06); -+ break; -+ -+ case V4L2_CID_SATURATION: -+ val = saa7146_read(dev, BCS_CTRL); -+ val &= 0xffffff00; -+ val |= (ctrl->val << 0); -+ saa7146_write(dev, BCS_CTRL, val); -+ saa7146_write(dev, MC2, MASK_22 | MASK_06); -+ break; -+ -+ case V4L2_CID_HFLIP: -+ /* fixme: we can support changing VFLIP and HFLIP here... */ -+ if ((vv->video_status & STATUS_CAPTURE)) -+ return -EBUSY; -+ vv->hflip = ctrl->val; -+ break; -+ -+ case V4L2_CID_VFLIP: -+ if ((vv->video_status & STATUS_CAPTURE)) -+ return -EBUSY; -+ vv->vflip = ctrl->val; -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ if ((vv->video_status & STATUS_OVERLAY) != 0) { /* CHECK: && (vv->video_fh == fh)) */ -+ struct saa7146_fh *fh = vv->video_fh; -+ -+ saa7146_stop_preview(fh); -+ saa7146_start_preview(fh); -+ } -+ return 0; -+} -+ -+static int vidioc_g_parm(struct file *file, void *fh, -+ struct v4l2_streamparm *parm) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return -EINVAL; -+ parm->parm.capture.readbuffers = 1; -+ v4l2_video_std_frame_period(vv->standard->id, -+ &parm->parm.capture.timeperframe); -+ return 0; -+} -+ -+static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ f->fmt.pix = vv->video_fmt; -+ return 0; -+} -+ -+static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ f->fmt.win = vv->ov.win; -+ return 0; -+} -+ -+static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ f->fmt.vbi = vv->vbi_fmt; -+ return 0; -+} -+ -+static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_format *fmt; -+ enum v4l2_field field; -+ int maxw, maxh; -+ int calc_bpl; -+ -+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); -+ -+ fmt = saa7146_format_by_fourcc(dev, f->fmt.pix.pixelformat); -+ if (NULL == fmt) -+ return -EINVAL; -+ -+ field = f->fmt.pix.field; -+ maxw = vv->standard->h_max_out; -+ maxh = vv->standard->v_max_out; -+ -+ if (V4L2_FIELD_ANY == field) { -+ field = (f->fmt.pix.height > maxh / 2) -+ ? V4L2_FIELD_INTERLACED -+ : V4L2_FIELD_BOTTOM; -+ } -+ switch (field) { -+ case V4L2_FIELD_ALTERNATE: -+ vv->last_field = V4L2_FIELD_TOP; -+ maxh = maxh / 2; -+ break; -+ case V4L2_FIELD_TOP: -+ case V4L2_FIELD_BOTTOM: -+ vv->last_field = V4L2_FIELD_INTERLACED; -+ maxh = maxh / 2; -+ break; -+ case V4L2_FIELD_INTERLACED: -+ vv->last_field = V4L2_FIELD_INTERLACED; -+ break; -+ default: -+ DEB_D("no known field mode '%d'\n", field); -+ return -EINVAL; -+ } -+ -+ f->fmt.pix.field = field; -+ f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; -+ if (f->fmt.pix.width > maxw) -+ f->fmt.pix.width = maxw; -+ if (f->fmt.pix.height > maxh) -+ f->fmt.pix.height = maxh; -+ -+ calc_bpl = (f->fmt.pix.width * fmt->depth) / 8; -+ -+ if (f->fmt.pix.bytesperline < calc_bpl) -+ f->fmt.pix.bytesperline = calc_bpl; -+ -+ if (f->fmt.pix.bytesperline > (2 * PAGE_SIZE * fmt->depth) / 8) /* arbitrary constraint */ -+ f->fmt.pix.bytesperline = calc_bpl; -+ -+ f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.height; -+ DEB_D("w:%d, h:%d, bytesperline:%d, sizeimage:%d\n", -+ f->fmt.pix.width, f->fmt.pix.height, -+ f->fmt.pix.bytesperline, f->fmt.pix.sizeimage); -+ -+ return 0; -+} -+ -+ -+static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct v4l2_window *win = &f->fmt.win; -+ enum v4l2_field field; -+ int maxw, maxh; -+ -+ DEB_EE("dev:%p\n", dev); -+ -+ if (NULL == vv->ov_fb.base) { -+ DEB_D("no fb base set\n"); -+ return -EINVAL; -+ } -+ if (NULL == vv->ov_fmt) { -+ DEB_D("no fb fmt set\n"); -+ return -EINVAL; -+ } -+ if (win->w.width < 48 || win->w.height < 32) { -+ DEB_D("min width/height. (%d,%d)\n", -+ win->w.width, win->w.height); -+ return -EINVAL; -+ } -+ if (win->clipcount > 16) { -+ DEB_D("clipcount too big\n"); -+ return -EINVAL; -+ } -+ -+ field = win->field; -+ maxw = vv->standard->h_max_out; -+ maxh = vv->standard->v_max_out; -+ -+ if (V4L2_FIELD_ANY == field) { -+ field = (win->w.height > maxh / 2) -+ ? V4L2_FIELD_INTERLACED -+ : V4L2_FIELD_TOP; -+ } -+ switch (field) { -+ case V4L2_FIELD_TOP: -+ case V4L2_FIELD_BOTTOM: -+ case V4L2_FIELD_ALTERNATE: -+ maxh = maxh / 2; -+ break; -+ case V4L2_FIELD_INTERLACED: -+ break; -+ default: -+ DEB_D("no known field mode '%d'\n", field); -+ return -EINVAL; -+ } -+ -+ win->field = field; -+ if (win->w.width > maxw) -+ win->w.width = maxw; -+ if (win->w.height > maxh) -+ win->w.height = maxh; -+ -+ return 0; -+} -+ -+static int vidioc_s_fmt_vid_cap(struct file *file, void *__fh, struct v4l2_format *f) -+{ -+ struct saa7146_fh *fh = __fh; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ int err; -+ -+ DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); -+ if (IS_CAPTURE_ACTIVE(fh) != 0) { -+ DEB_EE("streaming capture is active\n"); -+ return -EBUSY; -+ } -+ err = vidioc_try_fmt_vid_cap(file, fh, f); -+ if (0 != err) -+ return err; -+ vv->video_fmt = f->fmt.pix; -+ DEB_EE("set to pixelformat '%4.4s'\n", -+ (char *)&vv->video_fmt.pixelformat); -+ return 0; -+} -+ -+static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_format *f) -+{ -+ struct saa7146_fh *fh = __fh; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ int err; -+ -+ DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh); -+ err = vidioc_try_fmt_vid_overlay(file, fh, f); -+ if (0 != err) -+ return err; -+ vv->ov.win = f->fmt.win; -+ vv->ov.nclips = f->fmt.win.clipcount; -+ if (vv->ov.nclips > 16) -+ vv->ov.nclips = 16; -+ if (copy_from_user(vv->ov.clips, f->fmt.win.clips, -+ sizeof(struct v4l2_clip) * vv->ov.nclips)) { -+ return -EFAULT; -+ } -+ -+ /* vv->ov.fh is used to indicate that we have valid overlay informations, too */ -+ vv->ov.fh = fh; -+ -+ /* check if our current overlay is active */ -+ if (IS_OVERLAY_ACTIVE(fh) != 0) { -+ saa7146_stop_preview(fh); -+ saa7146_start_preview(fh); -+ } -+ return 0; -+} -+ -+static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ *norm = vv->standard->id; -+ return 0; -+} -+ -+ /* the saa7146 supfhrts (used in conjunction with the saa7111a for example) -+ PAL / NTSC / SECAM. if your hardware does not (or does more) -+ -- override this function in your extension */ -+/* -+ case VIDIOC_ENUMSTD: -+ { -+ struct v4l2_standard *e = arg; -+ if (e->index < 0 ) -+ return -EINVAL; -+ if( e->index < dev->ext_vv_data->num_stds ) { -+ DEB_EE("VIDIOC_ENUMSTD: index:%d\n", e->index); -+ v4l2_video_std_construct(e, dev->ext_vv_data->stds[e->index].id, dev->ext_vv_data->stds[e->index].name); -+ return 0; -+ } -+ return -EINVAL; -+ } -+ */ -+ -+static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id) -+{ -+ struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ int found = 0; -+ int err, i; -+ -+ DEB_EE("VIDIOC_S_STD\n"); -+ -+ if ((vv->video_status & STATUS_CAPTURE) == STATUS_CAPTURE) { -+ DEB_D("cannot change video standard while streaming capture is active\n"); -+ return -EBUSY; -+ } -+ -+ if ((vv->video_status & STATUS_OVERLAY) != 0) { -+ vv->ov_suspend = vv->video_fh; -+ err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */ -+ if (0 != err) { -+ DEB_D("suspending video failed. aborting\n"); -+ return err; -+ } -+ } -+ -+ for (i = 0; i < dev->ext_vv_data->num_stds; i++) -+ if (*id & dev->ext_vv_data->stds[i].id) -+ break; -+ if (i != dev->ext_vv_data->num_stds) { -+ vv->standard = &dev->ext_vv_data->stds[i]; -+ if (NULL != dev->ext_vv_data->std_callback) -+ dev->ext_vv_data->std_callback(dev, vv->standard); -+ found = 1; -+ } -+ -+ if (vv->ov_suspend != NULL) { -+ saa7146_start_preview(vv->ov_suspend); -+ vv->ov_suspend = NULL; -+ } -+ -+ if (!found) { -+ DEB_EE("VIDIOC_S_STD: standard not found\n"); -+ return -EINVAL; -+ } -+ -+ DEB_EE("VIDIOC_S_STD: set to standard to '%s'\n", vv->standard->name); -+ return 0; -+} -+ -+static int vidioc_overlay(struct file *file, void *fh, unsigned int on) -+{ -+ int err; -+ -+ DEB_D("VIDIOC_OVERLAY on:%d\n", on); -+ if (on) -+ err = saa7146_start_preview(fh); -+ else -+ err = saa7146_stop_preview(fh); -+ return err; -+} -+ -+static int vidioc_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *b) -+{ -+ struct saa7146_fh *fh = __fh; -+ -+ if (b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return videobuf_reqbufs(&fh->video_q, b); -+ if (b->type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ return videobuf_reqbufs(&fh->vbi_q, b); -+ return -EINVAL; -+} -+ -+static int vidioc_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf) -+{ -+ struct saa7146_fh *fh = __fh; -+ -+ if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return videobuf_querybuf(&fh->video_q, buf); -+ if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ return videobuf_querybuf(&fh->vbi_q, buf); -+ return -EINVAL; -+} -+ -+static int vidioc_qbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) -+{ -+ struct saa7146_fh *fh = __fh; -+ -+ if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return videobuf_qbuf(&fh->video_q, buf); -+ if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ return videobuf_qbuf(&fh->vbi_q, buf); -+ return -EINVAL; -+} -+ -+static int vidioc_dqbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) -+{ -+ struct saa7146_fh *fh = __fh; -+ -+ if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK); -+ if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK); -+ return -EINVAL; -+} -+ -+static int vidioc_streamon(struct file *file, void *__fh, enum v4l2_buf_type type) -+{ -+ struct saa7146_fh *fh = __fh; -+ int err; -+ -+ DEB_D("VIDIOC_STREAMON, type:%d\n", type); -+ -+ err = video_begin(fh); -+ if (err) -+ return err; -+ if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ return videobuf_streamon(&fh->video_q); -+ if (type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ return videobuf_streamon(&fh->vbi_q); -+ return -EINVAL; -+} -+ -+static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type) -+{ -+ struct saa7146_fh *fh = __fh; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ int err; -+ -+ DEB_D("VIDIOC_STREAMOFF, type:%d\n", type); -+ -+ /* ugly: we need to copy some checks from video_end(), -+ because videobuf_streamoff() relies on the capture running. -+ check and fix this */ -+ if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) { -+ DEB_S("not capturing\n"); -+ return 0; -+ } -+ -+ if (vv->video_fh != fh) { -+ DEB_S("capturing, but in another open\n"); -+ return -EBUSY; -+ } -+ -+ err = -EINVAL; -+ if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -+ err = videobuf_streamoff(&fh->video_q); -+ else if (type == V4L2_BUF_TYPE_VBI_CAPTURE) -+ err = videobuf_streamoff(&fh->vbi_q); -+ if (0 != err) { -+ DEB_D("warning: videobuf_streamoff() failed\n"); -+ video_end(fh, file); -+ } else { -+ err = video_end(fh, file); -+ } -+ return err; -+} -+ -+static int vidioc_g_chip_ident(struct file *file, void *__fh, -+ struct v4l2_dbg_chip_ident *chip) -+{ -+ struct saa7146_fh *fh = __fh; -+ struct saa7146_dev *dev = fh->dev; -+ -+ chip->ident = V4L2_IDENT_NONE; -+ chip->revision = 0; -+ if (chip->match.type == V4L2_CHIP_MATCH_HOST) { -+ if (v4l2_chip_match_host(&chip->match)) -+ chip->ident = V4L2_IDENT_SAA7146; -+ return 0; -+ } -+ if (chip->match.type != V4L2_CHIP_MATCH_I2C_DRIVER && -+ chip->match.type != V4L2_CHIP_MATCH_I2C_ADDR) -+ return -EINVAL; -+ return v4l2_device_call_until_err(&dev->v4l2_dev, 0, -+ core, g_chip_ident, chip); -+} -+ -+const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = { -+ .vidioc_querycap = vidioc_querycap, -+ .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, -+ .vidioc_enum_fmt_vid_overlay = vidioc_enum_fmt_vid_cap, -+ .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, -+ .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, -+ .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, -+ .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay, -+ .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, -+ .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, -+ .vidioc_g_chip_ident = vidioc_g_chip_ident, -+ -+ .vidioc_overlay = vidioc_overlay, -+ .vidioc_g_fbuf = vidioc_g_fbuf, -+ .vidioc_s_fbuf = vidioc_s_fbuf, -+ .vidioc_reqbufs = vidioc_reqbufs, -+ .vidioc_querybuf = vidioc_querybuf, -+ .vidioc_qbuf = vidioc_qbuf, -+ .vidioc_dqbuf = vidioc_dqbuf, -+ .vidioc_g_std = vidioc_g_std, -+ .vidioc_s_std = vidioc_s_std, -+ .vidioc_streamon = vidioc_streamon, -+ .vidioc_streamoff = vidioc_streamoff, -+ .vidioc_g_parm = vidioc_g_parm, -+ .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, -+ .vidioc_unsubscribe_event = v4l2_event_unsubscribe, -+}; -+ -+const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops = { -+ .vidioc_querycap = vidioc_querycap, -+ .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, -+ .vidioc_g_chip_ident = vidioc_g_chip_ident, -+ -+ .vidioc_reqbufs = vidioc_reqbufs, -+ .vidioc_querybuf = vidioc_querybuf, -+ .vidioc_qbuf = vidioc_qbuf, -+ .vidioc_dqbuf = vidioc_dqbuf, -+ .vidioc_g_std = vidioc_g_std, -+ .vidioc_s_std = vidioc_s_std, -+ .vidioc_streamon = vidioc_streamon, -+ .vidioc_streamoff = vidioc_streamoff, -+ .vidioc_g_parm = vidioc_g_parm, -+ .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, -+ .vidioc_unsubscribe_event = v4l2_event_unsubscribe, -+}; -+ -+/*********************************************************************************/ -+/* buffer handling functions */ -+ -+static int buffer_activate (struct saa7146_dev *dev, -+ struct saa7146_buf *buf, -+ struct saa7146_buf *next) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ -+ buf->vb.state = VIDEOBUF_ACTIVE; -+ saa7146_set_capture(dev,buf,next); -+ -+ mod_timer(&vv->video_dmaq.timeout, jiffies+BUFFER_TIMEOUT); -+ return 0; -+} -+ -+static void release_all_pagetables(struct saa7146_dev *dev, struct saa7146_buf *buf) -+{ -+ saa7146_pgtable_free(dev->pci, &buf->pt[0]); -+ saa7146_pgtable_free(dev->pci, &buf->pt[1]); -+ saa7146_pgtable_free(dev->pci, &buf->pt[2]); -+} -+ -+static int buffer_prepare(struct videobuf_queue *q, -+ struct videobuf_buffer *vb, enum v4l2_field field) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ int size,err = 0; -+ -+ DEB_CAP("vbuf:%p\n", vb); -+ -+ /* sanity checks */ -+ if (vv->video_fmt.width < 48 || -+ vv->video_fmt.height < 32 || -+ vv->video_fmt.width > vv->standard->h_max_out || -+ vv->video_fmt.height > vv->standard->v_max_out) { -+ DEB_D("w (%d) / h (%d) out of bounds\n", -+ vv->video_fmt.width, vv->video_fmt.height); -+ return -EINVAL; -+ } -+ -+ size = vv->video_fmt.sizeimage; -+ if (0 != buf->vb.baddr && buf->vb.bsize < size) { -+ DEB_D("size mismatch\n"); -+ return -EINVAL; -+ } -+ -+ DEB_CAP("buffer_prepare [size=%dx%d,bytes=%d,fields=%s]\n", -+ vv->video_fmt.width, vv->video_fmt.height, -+ size, v4l2_field_names[vv->video_fmt.field]); -+ if (buf->vb.width != vv->video_fmt.width || -+ buf->vb.bytesperline != vv->video_fmt.bytesperline || -+ buf->vb.height != vv->video_fmt.height || -+ buf->vb.size != size || -+ buf->vb.field != field || -+ buf->vb.field != vv->video_fmt.field || -+ buf->fmt != &vv->video_fmt) { -+ saa7146_dma_free(dev,q,buf); -+ } -+ -+ if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { -+ struct saa7146_format *sfmt; -+ -+ buf->vb.bytesperline = vv->video_fmt.bytesperline; -+ buf->vb.width = vv->video_fmt.width; -+ buf->vb.height = vv->video_fmt.height; -+ buf->vb.size = size; -+ buf->vb.field = field; -+ buf->fmt = &vv->video_fmt; -+ buf->vb.field = vv->video_fmt.field; -+ -+ sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -+ -+ release_all_pagetables(dev, buf); -+ if( 0 != IS_PLANAR(sfmt->trans)) { -+ saa7146_pgtable_alloc(dev->pci, &buf->pt[0]); -+ saa7146_pgtable_alloc(dev->pci, &buf->pt[1]); -+ saa7146_pgtable_alloc(dev->pci, &buf->pt[2]); -+ } else { -+ saa7146_pgtable_alloc(dev->pci, &buf->pt[0]); -+ } -+ -+ err = videobuf_iolock(q,&buf->vb, &vv->ov_fb); -+ if (err) -+ goto oops; -+ err = saa7146_pgtable_build(dev,buf); -+ if (err) -+ goto oops; -+ } -+ buf->vb.state = VIDEOBUF_PREPARED; -+ buf->activate = buffer_activate; -+ -+ return 0; -+ -+ oops: -+ DEB_D("error out\n"); -+ saa7146_dma_free(dev,q,buf); -+ -+ return err; -+} -+ -+static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_vv *vv = fh->dev->vv_data; -+ -+ if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) -+ *count = MAX_SAA7146_CAPTURE_BUFFERS; -+ -+ *size = vv->video_fmt.sizeimage; -+ -+ /* check if we exceed the "max_memory" parameter */ -+ if( (*count * *size) > (max_memory*1048576) ) { -+ *count = (max_memory*1048576) / *size; -+ } -+ -+ DEB_CAP("%d buffers, %d bytes each\n", *count, *size); -+ -+ return 0; -+} -+ -+static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ -+ DEB_CAP("vbuf:%p\n", vb); -+ saa7146_buffer_queue(fh->dev, &vv->video_dmaq, buf); -+} -+ -+static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) -+{ -+ struct file *file = q->priv_data; -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_buf *buf = (struct saa7146_buf *)vb; -+ -+ DEB_CAP("vbuf:%p\n", vb); -+ -+ saa7146_dma_free(dev,q,buf); -+ -+ release_all_pagetables(dev, buf); -+} -+ -+static struct videobuf_queue_ops video_qops = { -+ .buf_setup = buffer_setup, -+ .buf_prepare = buffer_prepare, -+ .buf_queue = buffer_queue, -+ .buf_release = buffer_release, -+}; -+ -+/********************************************************************************/ -+/* file operations */ -+ -+static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv) -+{ -+ INIT_LIST_HEAD(&vv->video_dmaq.queue); -+ -+ init_timer(&vv->video_dmaq.timeout); -+ vv->video_dmaq.timeout.function = saa7146_buffer_timeout; -+ vv->video_dmaq.timeout.data = (unsigned long)(&vv->video_dmaq); -+ vv->video_dmaq.dev = dev; -+ -+ /* set some default values */ -+ vv->standard = &dev->ext_vv_data->stds[0]; -+ -+ /* FIXME: what's this? */ -+ vv->current_hps_source = SAA7146_HPS_SOURCE_PORT_A; -+ vv->current_hps_sync = SAA7146_HPS_SYNC_PORT_A; -+} -+ -+ -+static int video_open(struct saa7146_dev *dev, struct file *file) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ -+ videobuf_queue_sg_init(&fh->video_q, &video_qops, -+ &dev->pci->dev, &dev->slock, -+ V4L2_BUF_TYPE_VIDEO_CAPTURE, -+ V4L2_FIELD_INTERLACED, -+ sizeof(struct saa7146_buf), -+ file, &dev->v4l2_lock); -+ -+ return 0; -+} -+ -+ -+static void video_close(struct saa7146_dev *dev, struct file *file) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_vv *vv = dev->vv_data; -+ struct videobuf_queue *q = &fh->video_q; -+ -+ if (IS_CAPTURE_ACTIVE(fh) != 0) -+ video_end(fh, file); -+ else if (IS_OVERLAY_ACTIVE(fh) != 0) -+ saa7146_stop_preview(fh); -+ -+ videobuf_stop(q); -+ /* hmm, why is this function declared void? */ -+} -+ -+ -+static void video_irq_done(struct saa7146_dev *dev, unsigned long st) -+{ -+ struct saa7146_vv *vv = dev->vv_data; -+ struct saa7146_dmaqueue *q = &vv->video_dmaq; -+ -+ spin_lock(&dev->slock); -+ DEB_CAP("called\n"); -+ -+ /* only finish the buffer if we have one... */ -+ if( NULL != q->curr ) { -+ saa7146_buffer_finish(dev,q,VIDEOBUF_DONE); -+ } -+ saa7146_buffer_next(dev,q,0); -+ -+ spin_unlock(&dev->slock); -+} -+ -+static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) -+{ -+ struct saa7146_fh *fh = file->private_data; -+ struct saa7146_dev *dev = fh->dev; -+ struct saa7146_vv *vv = dev->vv_data; -+ ssize_t ret = 0; -+ -+ DEB_EE("called\n"); -+ -+ if ((vv->video_status & STATUS_CAPTURE) != 0) { -+ /* fixme: should we allow read() captures while streaming capture? */ -+ if (vv->video_fh == fh) { -+ DEB_S("already capturing\n"); -+ return -EBUSY; -+ } -+ DEB_S("already capturing in another open\n"); -+ return -EBUSY; -+ } -+ -+ ret = video_begin(fh); -+ if( 0 != ret) { -+ goto out; -+ } -+ -+ ret = videobuf_read_one(&fh->video_q , data, count, ppos, -+ file->f_flags & O_NONBLOCK); -+ if (ret != 0) { -+ video_end(fh, file); -+ } else { -+ ret = video_end(fh, file); -+ } -+out: -+ /* restart overlay if it was active before */ -+ if (vv->ov_suspend != NULL) { -+ saa7146_start_preview(vv->ov_suspend); -+ vv->ov_suspend = NULL; -+ } -+ -+ return ret; -+} -+ -+struct saa7146_use_ops saa7146_video_uops = { -+ .init = video_init, -+ .open = video_open, -+ .release = video_close, -+ .irq_done = video_irq_done, -+ .read = video_read, -+}; -diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c -deleted file mode 100644 -index d6b1cf6..0000000 ---- a/drivers/media/common/saa7146_core.c -+++ /dev/null -@@ -1,600 +0,0 @@ --/* -- saa7146.o - driver for generic saa7146-based hardware -- -- Copyright (C) 1998-2003 Michael Hunold -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --*/ -- --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include --#include -- --LIST_HEAD(saa7146_devices); --DEFINE_MUTEX(saa7146_devices_lock); -- --static int saa7146_num; -- --unsigned int saa7146_debug; -- --module_param(saa7146_debug, uint, 0644); --MODULE_PARM_DESC(saa7146_debug, "debug level (default: 0)"); -- --#if 0 --static void dump_registers(struct saa7146_dev* dev) --{ -- int i = 0; -- -- pr_info(" @ %li jiffies:\n", jiffies); -- for (i = 0; i <= 0x148; i += 4) -- pr_info("0x%03x: 0x%08x\n", i, saa7146_read(dev, i)); --} --#endif -- --/**************************************************************************** -- * gpio and debi helper functions -- ****************************************************************************/ -- --void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data) --{ -- u32 value = 0; -- -- BUG_ON(port > 3); -- -- value = saa7146_read(dev, GPIO_CTRL); -- value &= ~(0xff << (8*port)); -- value |= (data << (8*port)); -- saa7146_write(dev, GPIO_CTRL, value); --} -- --/* This DEBI code is based on the saa7146 Stradis driver by Nathan Laredo */ --static inline int saa7146_wait_for_debi_done_sleep(struct saa7146_dev *dev, -- unsigned long us1, unsigned long us2) --{ -- unsigned long timeout; -- int err; -- -- /* wait for registers to be programmed */ -- timeout = jiffies + usecs_to_jiffies(us1); -- while (1) { -- err = time_after(jiffies, timeout); -- if (saa7146_read(dev, MC2) & 2) -- break; -- if (err) { -- pr_err("%s: %s timed out while waiting for registers getting programmed\n", -- dev->name, __func__); -- return -ETIMEDOUT; -- } -- msleep(1); -- } -- -- /* wait for transfer to complete */ -- timeout = jiffies + usecs_to_jiffies(us2); -- while (1) { -- err = time_after(jiffies, timeout); -- if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) -- break; -- saa7146_read(dev, MC2); -- if (err) { -- DEB_S("%s: %s timed out while waiting for transfer completion\n", -- dev->name, __func__); -- return -ETIMEDOUT; -- } -- msleep(1); -- } -- -- return 0; --} -- --static inline int saa7146_wait_for_debi_done_busyloop(struct saa7146_dev *dev, -- unsigned long us1, unsigned long us2) --{ -- unsigned long loops; -- -- /* wait for registers to be programmed */ -- loops = us1; -- while (1) { -- if (saa7146_read(dev, MC2) & 2) -- break; -- if (!loops--) { -- pr_err("%s: %s timed out while waiting for registers getting programmed\n", -- dev->name, __func__); -- return -ETIMEDOUT; -- } -- udelay(1); -- } -- -- /* wait for transfer to complete */ -- loops = us2 / 5; -- while (1) { -- if (!(saa7146_read(dev, PSR) & SPCI_DEBI_S)) -- break; -- saa7146_read(dev, MC2); -- if (!loops--) { -- DEB_S("%s: %s timed out while waiting for transfer completion\n", -- dev->name, __func__); -- return -ETIMEDOUT; -- } -- udelay(5); -- } -- -- return 0; --} -- --int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop) --{ -- if (nobusyloop) -- return saa7146_wait_for_debi_done_sleep(dev, 50000, 250000); -- else -- return saa7146_wait_for_debi_done_busyloop(dev, 50000, 250000); --} -- --/**************************************************************************** -- * general helper functions -- ****************************************************************************/ -- --/* this is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c -- make sure virt has been allocated with vmalloc_32(), otherwise the BUG() -- may be triggered on highmem machines */ --static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) --{ -- struct scatterlist *sglist; -- struct page *pg; -- int i; -- -- sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL); -- if (NULL == sglist) -- return NULL; -- sg_init_table(sglist, nr_pages); -- for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { -- pg = vmalloc_to_page(virt); -- if (NULL == pg) -- goto err; -- BUG_ON(PageHighMem(pg)); -- sg_set_page(&sglist[i], pg, PAGE_SIZE, 0); -- } -- return sglist; -- -- err: -- kfree(sglist); -- return NULL; --} -- --/********************************************************************************/ --/* common page table functions */ -- --void *saa7146_vmalloc_build_pgtable(struct pci_dev *pci, long length, struct saa7146_pgtable *pt) --{ -- int pages = (length+PAGE_SIZE-1)/PAGE_SIZE; -- void *mem = vmalloc_32(length); -- int slen = 0; -- -- if (NULL == mem) -- goto err_null; -- -- if (!(pt->slist = vmalloc_to_sg(mem, pages))) -- goto err_free_mem; -- -- if (saa7146_pgtable_alloc(pci, pt)) -- goto err_free_slist; -- -- pt->nents = pages; -- slen = pci_map_sg(pci,pt->slist,pt->nents,PCI_DMA_FROMDEVICE); -- if (0 == slen) -- goto err_free_pgtable; -- -- if (0 != saa7146_pgtable_build_single(pci, pt, pt->slist, slen)) -- goto err_unmap_sg; -- -- return mem; -- --err_unmap_sg: -- pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); --err_free_pgtable: -- saa7146_pgtable_free(pci, pt); --err_free_slist: -- kfree(pt->slist); -- pt->slist = NULL; --err_free_mem: -- vfree(mem); --err_null: -- return NULL; --} -- --void saa7146_vfree_destroy_pgtable(struct pci_dev *pci, void *mem, struct saa7146_pgtable *pt) --{ -- pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); -- saa7146_pgtable_free(pci, pt); -- kfree(pt->slist); -- pt->slist = NULL; -- vfree(mem); --} -- --void saa7146_pgtable_free(struct pci_dev *pci, struct saa7146_pgtable *pt) --{ -- if (NULL == pt->cpu) -- return; -- pci_free_consistent(pci, pt->size, pt->cpu, pt->dma); -- pt->cpu = NULL; --} -- --int saa7146_pgtable_alloc(struct pci_dev *pci, struct saa7146_pgtable *pt) --{ -- __le32 *cpu; -- dma_addr_t dma_addr = 0; -- -- cpu = pci_alloc_consistent(pci, PAGE_SIZE, &dma_addr); -- if (NULL == cpu) { -- return -ENOMEM; -- } -- pt->size = PAGE_SIZE; -- pt->cpu = cpu; -- pt->dma = dma_addr; -- -- return 0; --} -- --int saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *pt, -- struct scatterlist *list, int sglen ) --{ -- __le32 *ptr, fill; -- int nr_pages = 0; -- int i,p; -- -- BUG_ON(0 == sglen); -- BUG_ON(list->offset > PAGE_SIZE); -- -- /* if we have a user buffer, the first page may not be -- aligned to a page boundary. */ -- pt->offset = list->offset; -- -- ptr = pt->cpu; -- for (i = 0; i < sglen; i++, list++) { --/* -- pr_debug("i:%d, adr:0x%08x, len:%d, offset:%d\n", -- i, sg_dma_address(list), sg_dma_len(list), -- list->offset); --*/ -- for (p = 0; p * 4096 < list->length; p++, ptr++) { -- *ptr = cpu_to_le32(sg_dma_address(list) + p * 4096); -- nr_pages++; -- } -- } -- -- -- /* safety; fill the page table up with the last valid page */ -- fill = *(ptr-1); -- for(i=nr_pages;i<1024;i++) { -- *ptr++ = fill; -- } -- --/* -- ptr = pt->cpu; -- pr_debug("offset: %d\n", pt->offset); -- for(i=0;i<5;i++) { -- pr_debug("ptr1 %d: 0x%08x\n", i, ptr[i]); -- } --*/ -- return 0; --} -- --/********************************************************************************/ --/* interrupt handler */ --static irqreturn_t interrupt_hw(int irq, void *dev_id) --{ -- struct saa7146_dev *dev = dev_id; -- u32 isr; -- u32 ack_isr; -- -- /* read out the interrupt status register */ -- ack_isr = isr = saa7146_read(dev, ISR); -- -- /* is this our interrupt? */ -- if ( 0 == isr ) { -- /* nope, some other device */ -- return IRQ_NONE; -- } -- -- if (dev->ext) { -- if (dev->ext->irq_mask & isr) { -- if (dev->ext->irq_func) -- dev->ext->irq_func(dev, &isr); -- isr &= ~dev->ext->irq_mask; -- } -- } -- if (0 != (isr & (MASK_27))) { -- DEB_INT("irq: RPS0 (0x%08x)\n", isr); -- if (dev->vv_data && dev->vv_callback) -- dev->vv_callback(dev,isr); -- isr &= ~MASK_27; -- } -- if (0 != (isr & (MASK_28))) { -- if (dev->vv_data && dev->vv_callback) -- dev->vv_callback(dev,isr); -- isr &= ~MASK_28; -- } -- if (0 != (isr & (MASK_16|MASK_17))) { -- SAA7146_IER_DISABLE(dev, MASK_16|MASK_17); -- /* only wake up if we expect something */ -- if (0 != dev->i2c_op) { -- dev->i2c_op = 0; -- wake_up(&dev->i2c_wq); -- } else { -- u32 psr = saa7146_read(dev, PSR); -- u32 ssr = saa7146_read(dev, SSR); -- pr_warn("%s: unexpected i2c irq: isr %08x psr %08x ssr %08x\n", -- dev->name, isr, psr, ssr); -- } -- isr &= ~(MASK_16|MASK_17); -- } -- if( 0 != isr ) { -- ERR("warning: interrupt enabled, but not handled properly.(0x%08x)\n", -- isr); -- ERR("disabling interrupt source(s)!\n"); -- SAA7146_IER_DISABLE(dev,isr); -- } -- saa7146_write(dev, ISR, ack_isr); -- return IRQ_HANDLED; --} -- --/*********************************************************************************/ --/* configuration-functions */ -- --static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent) --{ -- struct saa7146_pci_extension_data *pci_ext = (struct saa7146_pci_extension_data *)ent->driver_data; -- struct saa7146_extension *ext = pci_ext->ext; -- struct saa7146_dev *dev; -- int err = -ENOMEM; -- -- /* clear out mem for sure */ -- dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL); -- if (!dev) { -- ERR("out of memory\n"); -- goto out; -- } -- -- DEB_EE("pci:%p\n", pci); -- -- err = pci_enable_device(pci); -- if (err < 0) { -- ERR("pci_enable_device() failed\n"); -- goto err_free; -- } -- -- /* enable bus-mastering */ -- pci_set_master(pci); -- -- dev->pci = pci; -- -- /* get chip-revision; this is needed to enable bug-fixes */ -- dev->revision = pci->revision; -- -- /* remap the memory from virtual to physical address */ -- -- err = pci_request_region(pci, 0, "saa7146"); -- if (err < 0) -- goto err_disable; -- -- dev->mem = ioremap(pci_resource_start(pci, 0), -- pci_resource_len(pci, 0)); -- if (!dev->mem) { -- ERR("ioremap() failed\n"); -- err = -ENODEV; -- goto err_release; -- } -- -- /* we don't do a master reset here anymore, it screws up -- some boards that don't have an i2c-eeprom for configuration -- values */ --/* -- saa7146_write(dev, MC1, MASK_31); --*/ -- -- /* disable all irqs */ -- saa7146_write(dev, IER, 0); -- -- /* shut down all dma transfers and rps tasks */ -- saa7146_write(dev, MC1, 0x30ff0000); -- -- /* clear out any rps-signals pending */ -- saa7146_write(dev, MC2, 0xf8000000); -- -- /* request an interrupt for the saa7146 */ -- err = request_irq(pci->irq, interrupt_hw, IRQF_SHARED | IRQF_DISABLED, -- dev->name, dev); -- if (err < 0) { -- ERR("request_irq() failed\n"); -- goto err_unmap; -- } -- -- err = -ENOMEM; -- -- /* get memory for various stuff */ -- dev->d_rps0.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -- &dev->d_rps0.dma_handle); -- if (!dev->d_rps0.cpu_addr) -- goto err_free_irq; -- memset(dev->d_rps0.cpu_addr, 0x0, SAA7146_RPS_MEM); -- -- dev->d_rps1.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -- &dev->d_rps1.dma_handle); -- if (!dev->d_rps1.cpu_addr) -- goto err_free_rps0; -- memset(dev->d_rps1.cpu_addr, 0x0, SAA7146_RPS_MEM); -- -- dev->d_i2c.cpu_addr = pci_alloc_consistent(pci, SAA7146_RPS_MEM, -- &dev->d_i2c.dma_handle); -- if (!dev->d_i2c.cpu_addr) -- goto err_free_rps1; -- memset(dev->d_i2c.cpu_addr, 0x0, SAA7146_RPS_MEM); -- -- /* the rest + print status message */ -- -- /* create a nice device name */ -- sprintf(dev->name, "saa7146 (%d)", saa7146_num); -- -- pr_info("found saa7146 @ mem %p (revision %d, irq %d) (0x%04x,0x%04x)\n", -- dev->mem, dev->revision, pci->irq, -- pci->subsystem_vendor, pci->subsystem_device); -- dev->ext = ext; -- -- mutex_init(&dev->v4l2_lock); -- spin_lock_init(&dev->int_slock); -- spin_lock_init(&dev->slock); -- -- mutex_init(&dev->i2c_lock); -- -- dev->module = THIS_MODULE; -- init_waitqueue_head(&dev->i2c_wq); -- -- /* set some sane pci arbitrition values */ -- saa7146_write(dev, PCI_BT_V1, 0x1c00101f); -- -- /* TODO: use the status code of the callback */ -- -- err = -ENODEV; -- -- if (ext->probe && ext->probe(dev)) { -- DEB_D("ext->probe() failed for %p. skipping device.\n", dev); -- goto err_free_i2c; -- } -- -- if (ext->attach(dev, pci_ext)) { -- DEB_D("ext->attach() failed for %p. skipping device.\n", dev); -- goto err_free_i2c; -- } -- /* V4L extensions will set the pci drvdata to the v4l2_device in the -- attach() above. So for those cards that do not use V4L we have to -- set it explicitly. */ -- pci_set_drvdata(pci, &dev->v4l2_dev); -- -- INIT_LIST_HEAD(&dev->item); -- list_add_tail(&dev->item,&saa7146_devices); -- saa7146_num++; -- -- err = 0; --out: -- return err; -- --err_free_i2c: -- pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_i2c.cpu_addr, -- dev->d_i2c.dma_handle); --err_free_rps1: -- pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_rps1.cpu_addr, -- dev->d_rps1.dma_handle); --err_free_rps0: -- pci_free_consistent(pci, SAA7146_RPS_MEM, dev->d_rps0.cpu_addr, -- dev->d_rps0.dma_handle); --err_free_irq: -- free_irq(pci->irq, (void *)dev); --err_unmap: -- iounmap(dev->mem); --err_release: -- pci_release_region(pci, 0); --err_disable: -- pci_disable_device(pci); --err_free: -- kfree(dev); -- goto out; --} -- --static void saa7146_remove_one(struct pci_dev *pdev) --{ -- struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev); -- struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev); -- struct { -- void *addr; -- dma_addr_t dma; -- } dev_map[] = { -- { dev->d_i2c.cpu_addr, dev->d_i2c.dma_handle }, -- { dev->d_rps1.cpu_addr, dev->d_rps1.dma_handle }, -- { dev->d_rps0.cpu_addr, dev->d_rps0.dma_handle }, -- { NULL, 0 } -- }, *p; -- -- DEB_EE("dev:%p\n", dev); -- -- dev->ext->detach(dev); -- /* Zero the PCI drvdata after use. */ -- pci_set_drvdata(pdev, NULL); -- -- /* shut down all video dma transfers */ -- saa7146_write(dev, MC1, 0x00ff0000); -- -- /* disable all irqs, release irq-routine */ -- saa7146_write(dev, IER, 0); -- -- free_irq(pdev->irq, dev); -- -- for (p = dev_map; p->addr; p++) -- pci_free_consistent(pdev, SAA7146_RPS_MEM, p->addr, p->dma); -- -- iounmap(dev->mem); -- pci_release_region(pdev, 0); -- list_del(&dev->item); -- pci_disable_device(pdev); -- kfree(dev); -- -- saa7146_num--; --} -- --/*********************************************************************************/ --/* extension handling functions */ -- --int saa7146_register_extension(struct saa7146_extension* ext) --{ -- DEB_EE("ext:%p\n", ext); -- -- ext->driver.name = ext->name; -- ext->driver.id_table = ext->pci_tbl; -- ext->driver.probe = saa7146_init_one; -- ext->driver.remove = saa7146_remove_one; -- -- pr_info("register extension '%s'\n", ext->name); -- return pci_register_driver(&ext->driver); --} -- --int saa7146_unregister_extension(struct saa7146_extension* ext) --{ -- DEB_EE("ext:%p\n", ext); -- pr_info("unregister extension '%s'\n", ext->name); -- pci_unregister_driver(&ext->driver); -- return 0; --} -- --EXPORT_SYMBOL_GPL(saa7146_register_extension); --EXPORT_SYMBOL_GPL(saa7146_unregister_extension); -- --/* misc functions used by extension modules */ --EXPORT_SYMBOL_GPL(saa7146_pgtable_alloc); --EXPORT_SYMBOL_GPL(saa7146_pgtable_free); --EXPORT_SYMBOL_GPL(saa7146_pgtable_build_single); --EXPORT_SYMBOL_GPL(saa7146_vmalloc_build_pgtable); --EXPORT_SYMBOL_GPL(saa7146_vfree_destroy_pgtable); --EXPORT_SYMBOL_GPL(saa7146_wait_for_debi_done); -- --EXPORT_SYMBOL_GPL(saa7146_setgpio); -- --EXPORT_SYMBOL_GPL(saa7146_i2c_adapter_prepare); -- --EXPORT_SYMBOL_GPL(saa7146_debug); --EXPORT_SYMBOL_GPL(saa7146_devices); --EXPORT_SYMBOL_GPL(saa7146_devices_lock); -- --MODULE_AUTHOR("Michael Hunold "); --MODULE_DESCRIPTION("driver for generic saa7146-based hardware"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c -deleted file mode 100644 -index 71f8e01..0000000 ---- a/drivers/media/common/saa7146_fops.c -+++ /dev/null -@@ -1,562 +0,0 @@ --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include --#include -- --/****************************************************************************/ --/* resource management functions, shamelessly stolen from saa7134 driver */ -- --int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- if (fh->resources & bit) { -- DEB_D("already allocated! want: 0x%02x, cur:0x%02x\n", -- bit, vv->resources); -- /* have it already allocated */ -- return 1; -- } -- -- /* is it free? */ -- if (vv->resources & bit) { -- DEB_D("locked! vv->resources:0x%02x, we want:0x%02x\n", -- vv->resources, bit); -- /* no, someone else uses it */ -- return 0; -- } -- /* it's free, grab it */ -- fh->resources |= bit; -- vv->resources |= bit; -- DEB_D("res: get 0x%02x, cur:0x%02x\n", bit, vv->resources); -- return 1; --} -- --void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- BUG_ON((fh->resources & bits) != bits); -- -- fh->resources &= ~bits; -- vv->resources &= ~bits; -- DEB_D("res: put 0x%02x, cur:0x%02x\n", bits, vv->resources); --} -- -- --/********************************************************************************/ --/* common dma functions */ -- --void saa7146_dma_free(struct saa7146_dev *dev,struct videobuf_queue *q, -- struct saa7146_buf *buf) --{ -- struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -- DEB_EE("dev:%p, buf:%p\n", dev, buf); -- -- BUG_ON(in_interrupt()); -- -- videobuf_waiton(q, &buf->vb, 0, 0); -- videobuf_dma_unmap(q->dev, dma); -- videobuf_dma_free(dma); -- buf->vb.state = VIDEOBUF_NEEDS_INIT; --} -- -- --/********************************************************************************/ --/* common buffer functions */ -- --int saa7146_buffer_queue(struct saa7146_dev *dev, -- struct saa7146_dmaqueue *q, -- struct saa7146_buf *buf) --{ -- assert_spin_locked(&dev->slock); -- DEB_EE("dev:%p, dmaq:%p, buf:%p\n", dev, q, buf); -- -- BUG_ON(!q); -- -- if (NULL == q->curr) { -- q->curr = buf; -- DEB_D("immediately activating buffer %p\n", buf); -- buf->activate(dev,buf,NULL); -- } else { -- list_add_tail(&buf->vb.queue,&q->queue); -- buf->vb.state = VIDEOBUF_QUEUED; -- DEB_D("adding buffer %p to queue. (active buffer present)\n", -- buf); -- } -- return 0; --} -- --void saa7146_buffer_finish(struct saa7146_dev *dev, -- struct saa7146_dmaqueue *q, -- int state) --{ -- assert_spin_locked(&dev->slock); -- DEB_EE("dev:%p, dmaq:%p, state:%d\n", dev, q, state); -- DEB_EE("q->curr:%p\n", q->curr); -- -- BUG_ON(!q->curr); -- -- /* finish current buffer */ -- if (NULL == q->curr) { -- DEB_D("aiii. no current buffer\n"); -- return; -- } -- -- q->curr->vb.state = state; -- do_gettimeofday(&q->curr->vb.ts); -- wake_up(&q->curr->vb.done); -- -- q->curr = NULL; --} -- --void saa7146_buffer_next(struct saa7146_dev *dev, -- struct saa7146_dmaqueue *q, int vbi) --{ -- struct saa7146_buf *buf,*next = NULL; -- -- BUG_ON(!q); -- -- DEB_INT("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi); -- -- assert_spin_locked(&dev->slock); -- if (!list_empty(&q->queue)) { -- /* activate next one from queue */ -- buf = list_entry(q->queue.next,struct saa7146_buf,vb.queue); -- list_del(&buf->vb.queue); -- if (!list_empty(&q->queue)) -- next = list_entry(q->queue.next,struct saa7146_buf, vb.queue); -- q->curr = buf; -- DEB_INT("next buffer: buf:%p, prev:%p, next:%p\n", -- buf, q->queue.prev, q->queue.next); -- buf->activate(dev,buf,next); -- } else { -- DEB_INT("no next buffer. stopping.\n"); -- if( 0 != vbi ) { -- /* turn off video-dma3 */ -- saa7146_write(dev,MC1, MASK_20); -- } else { -- /* nothing to do -- just prevent next video-dma1 transfer -- by lowering the protection address */ -- -- // fixme: fix this for vflip != 0 -- -- saa7146_write(dev, PROT_ADDR1, 0); -- saa7146_write(dev, MC2, (MASK_02|MASK_18)); -- -- /* write the address of the rps-program */ -- saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); -- /* turn on rps */ -- saa7146_write(dev, MC1, (MASK_12 | MASK_28)); -- --/* -- printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); -- printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); -- printk("vdma%d.prot_addr: 0x%08x\n", 1,saa7146_read(dev,PROT_ADDR1)); -- printk("vdma%d.base_page: 0x%08x\n", 1,saa7146_read(dev,BASE_PAGE1)); -- printk("vdma%d.pitch: 0x%08x\n", 1,saa7146_read(dev,PITCH1)); -- printk("vdma%d.num_line_byte: 0x%08x\n", 1,saa7146_read(dev,NUM_LINE_BYTE1)); --*/ -- } -- del_timer(&q->timeout); -- } --} -- --void saa7146_buffer_timeout(unsigned long data) --{ -- struct saa7146_dmaqueue *q = (struct saa7146_dmaqueue*)data; -- struct saa7146_dev *dev = q->dev; -- unsigned long flags; -- -- DEB_EE("dev:%p, dmaq:%p\n", dev, q); -- -- spin_lock_irqsave(&dev->slock,flags); -- if (q->curr) { -- DEB_D("timeout on %p\n", q->curr); -- saa7146_buffer_finish(dev,q,VIDEOBUF_ERROR); -- } -- -- /* we don't restart the transfer here like other drivers do. when -- a streaming capture is disabled, the timeout function will be -- called for the current buffer. if we activate the next buffer now, -- we mess up our capture logic. if a timeout occurs on another buffer, -- then something is seriously broken before, so no need to buffer the -- next capture IMHO... */ --/* -- saa7146_buffer_next(dev,q); --*/ -- spin_unlock_irqrestore(&dev->slock,flags); --} -- --/********************************************************************************/ --/* file operations */ -- --static int fops_open(struct file *file) --{ -- struct video_device *vdev = video_devdata(file); -- struct saa7146_dev *dev = video_drvdata(file); -- struct saa7146_fh *fh = NULL; -- int result = 0; -- -- enum v4l2_buf_type type; -- -- DEB_EE("file:%p, dev:%s\n", file, video_device_node_name(vdev)); -- -- if (mutex_lock_interruptible(&saa7146_devices_lock)) -- return -ERESTARTSYS; -- -- DEB_D("using: %p\n", dev); -- -- type = vdev->vfl_type == VFL_TYPE_GRABBER -- ? V4L2_BUF_TYPE_VIDEO_CAPTURE -- : V4L2_BUF_TYPE_VBI_CAPTURE; -- -- /* check if an extension is registered */ -- if( NULL == dev->ext ) { -- DEB_S("no extension registered for this device\n"); -- result = -ENODEV; -- goto out; -- } -- -- /* allocate per open data */ -- fh = kzalloc(sizeof(*fh),GFP_KERNEL); -- if (NULL == fh) { -- DEB_S("cannot allocate memory for per open data\n"); -- result = -ENOMEM; -- goto out; -- } -- -- file->private_data = fh; -- fh->dev = dev; -- fh->type = type; -- -- if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { -- DEB_S("initializing vbi...\n"); -- if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -- result = saa7146_vbi_uops.open(dev,file); -- if (dev->ext_vv_data->vbi_fops.open) -- dev->ext_vv_data->vbi_fops.open(file); -- } else { -- DEB_S("initializing video...\n"); -- result = saa7146_video_uops.open(dev,file); -- } -- -- if (0 != result) { -- goto out; -- } -- -- if( 0 == try_module_get(dev->ext->module)) { -- result = -EINVAL; -- goto out; -- } -- -- result = 0; --out: -- if (fh && result != 0) { -- kfree(fh); -- file->private_data = NULL; -- } -- mutex_unlock(&saa7146_devices_lock); -- return result; --} -- --static int fops_release(struct file *file) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- -- DEB_EE("file:%p\n", file); -- -- if (mutex_lock_interruptible(&saa7146_devices_lock)) -- return -ERESTARTSYS; -- -- if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { -- if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -- saa7146_vbi_uops.release(dev,file); -- if (dev->ext_vv_data->vbi_fops.release) -- dev->ext_vv_data->vbi_fops.release(file); -- } else { -- saa7146_video_uops.release(dev,file); -- } -- -- module_put(dev->ext->module); -- file->private_data = NULL; -- kfree(fh); -- -- mutex_unlock(&saa7146_devices_lock); -- -- return 0; --} -- --static int fops_mmap(struct file *file, struct vm_area_struct * vma) --{ -- struct saa7146_fh *fh = file->private_data; -- struct videobuf_queue *q; -- -- switch (fh->type) { -- case V4L2_BUF_TYPE_VIDEO_CAPTURE: { -- DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, vma:%p\n", -- file, vma); -- q = &fh->video_q; -- break; -- } -- case V4L2_BUF_TYPE_VBI_CAPTURE: { -- DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, vma:%p\n", -- file, vma); -- q = &fh->vbi_q; -- break; -- } -- default: -- BUG(); -- return 0; -- } -- -- return videobuf_mmap_mapper(q,vma); --} -- --static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) --{ -- struct saa7146_fh *fh = file->private_data; -- struct videobuf_buffer *buf = NULL; -- struct videobuf_queue *q; -- -- DEB_EE("file:%p, poll:%p\n", file, wait); -- -- if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { -- if( 0 == fh->vbi_q.streaming ) -- return videobuf_poll_stream(file, &fh->vbi_q, wait); -- q = &fh->vbi_q; -- } else { -- DEB_D("using video queue\n"); -- q = &fh->video_q; -- } -- -- if (!list_empty(&q->stream)) -- buf = list_entry(q->stream.next, struct videobuf_buffer, stream); -- -- if (!buf) { -- DEB_D("buf == NULL!\n"); -- return POLLERR; -- } -- -- poll_wait(file, &buf->done, wait); -- if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) { -- DEB_D("poll succeeded!\n"); -- return POLLIN|POLLRDNORM; -- } -- -- DEB_D("nothing to poll for, buf->state:%d\n", buf->state); -- return 0; --} -- --static ssize_t fops_read(struct file *file, char __user *data, size_t count, loff_t *ppos) --{ -- struct saa7146_fh *fh = file->private_data; -- -- switch (fh->type) { -- case V4L2_BUF_TYPE_VIDEO_CAPTURE: --/* -- DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: file:%p, data:%p, count:%lun", -- file, data, (unsigned long)count); --*/ -- return saa7146_video_uops.read(file,data,count,ppos); -- case V4L2_BUF_TYPE_VBI_CAPTURE: --/* -- DEB_EE("V4L2_BUF_TYPE_VBI_CAPTURE: file:%p, data:%p, count:%lu\n", -- file, data, (unsigned long)count); --*/ -- if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -- return saa7146_vbi_uops.read(file,data,count,ppos); -- return -EINVAL; -- default: -- BUG(); -- return 0; -- } --} -- --static ssize_t fops_write(struct file *file, const char __user *data, size_t count, loff_t *ppos) --{ -- struct saa7146_fh *fh = file->private_data; -- -- switch (fh->type) { -- case V4L2_BUF_TYPE_VIDEO_CAPTURE: -- return -EINVAL; -- case V4L2_BUF_TYPE_VBI_CAPTURE: -- if (fh->dev->ext_vv_data->vbi_fops.write) -- return fh->dev->ext_vv_data->vbi_fops.write(file, data, count, ppos); -- else -- return -EINVAL; -- default: -- BUG(); -- return -EINVAL; -- } --} -- --static const struct v4l2_file_operations video_fops = --{ -- .owner = THIS_MODULE, -- .open = fops_open, -- .release = fops_release, -- .read = fops_read, -- .write = fops_write, -- .poll = fops_poll, -- .mmap = fops_mmap, -- .unlocked_ioctl = video_ioctl2, --}; -- --static void vv_callback(struct saa7146_dev *dev, unsigned long status) --{ -- u32 isr = status; -- -- DEB_INT("dev:%p, isr:0x%08x\n", dev, (u32)status); -- -- if (0 != (isr & (MASK_27))) { -- DEB_INT("irq: RPS0 (0x%08x)\n", isr); -- saa7146_video_uops.irq_done(dev,isr); -- } -- -- if (0 != (isr & (MASK_28))) { -- u32 mc2 = saa7146_read(dev, MC2); -- if( 0 != (mc2 & MASK_15)) { -- DEB_INT("irq: RPS1 vbi workaround (0x%08x)\n", isr); -- wake_up(&dev->vv_data->vbi_wq); -- saa7146_write(dev,MC2, MASK_31); -- return; -- } -- DEB_INT("irq: RPS1 (0x%08x)\n", isr); -- saa7146_vbi_uops.irq_done(dev,isr); -- } --} -- --int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) --{ -- struct saa7146_vv *vv; -- int err; -- -- err = v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev); -- if (err) -- return err; -- -- vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); -- if (vv == NULL) { -- ERR("out of memory. aborting.\n"); -- return -ENOMEM; -- } -- ext_vv->ops = saa7146_video_ioctl_ops; -- ext_vv->core_ops = &saa7146_video_ioctl_ops; -- -- DEB_EE("dev:%p\n", dev); -- -- /* set default values for video parts of the saa7146 */ -- saa7146_write(dev, BCS_CTRL, 0x80400040); -- -- /* enable video-port pins */ -- saa7146_write(dev, MC1, (MASK_10 | MASK_26)); -- -- /* save per-device extension data (one extension can -- handle different devices that might need different -- configuration data) */ -- dev->ext_vv_data = ext_vv; -- -- vv->d_clipping.cpu_addr = pci_alloc_consistent(dev->pci, SAA7146_CLIPPING_MEM, &vv->d_clipping.dma_handle); -- if( NULL == vv->d_clipping.cpu_addr ) { -- ERR("out of memory. aborting.\n"); -- kfree(vv); -- return -1; -- } -- memset(vv->d_clipping.cpu_addr, 0x0, SAA7146_CLIPPING_MEM); -- -- saa7146_video_uops.init(dev,vv); -- if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE) -- saa7146_vbi_uops.init(dev,vv); -- -- dev->vv_data = vv; -- dev->vv_callback = &vv_callback; -- -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_vv_init); -- --int saa7146_vv_release(struct saa7146_dev* dev) --{ -- struct saa7146_vv *vv = dev->vv_data; -- -- DEB_EE("dev:%p\n", dev); -- -- v4l2_device_unregister(&dev->v4l2_dev); -- pci_free_consistent(dev->pci, SAA7146_CLIPPING_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle); -- kfree(vv); -- dev->vv_data = NULL; -- dev->vv_callback = NULL; -- -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_vv_release); -- --int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev, -- char *name, int type) --{ -- struct video_device *vfd; -- int err; -- int i; -- -- DEB_EE("dev:%p, name:'%s', type:%d\n", dev, name, type); -- -- // released by vfd->release -- vfd = video_device_alloc(); -- if (vfd == NULL) -- return -ENOMEM; -- -- vfd->fops = &video_fops; -- vfd->ioctl_ops = &dev->ext_vv_data->ops; -- vfd->release = video_device_release; -- vfd->lock = &dev->v4l2_lock; -- vfd->tvnorms = 0; -- for (i = 0; i < dev->ext_vv_data->num_stds; i++) -- vfd->tvnorms |= dev->ext_vv_data->stds[i].id; -- strlcpy(vfd->name, name, sizeof(vfd->name)); -- video_set_drvdata(vfd, dev); -- -- err = video_register_device(vfd, type, -1); -- if (err < 0) { -- ERR("cannot register v4l2 device. skipping.\n"); -- video_device_release(vfd); -- return err; -- } -- -- pr_info("%s: registered device %s [v4l2]\n", -- dev->name, video_device_node_name(vfd)); -- -- *vid = vfd; -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_register_device); -- --int saa7146_unregister_device(struct video_device **vid, struct saa7146_dev* dev) --{ -- DEB_EE("dev:%p\n", dev); -- -- video_unregister_device(*vid); -- *vid = NULL; -- -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_unregister_device); -- --static int __init saa7146_vv_init_module(void) --{ -- return 0; --} -- -- --static void __exit saa7146_vv_cleanup_module(void) --{ --} -- --module_init(saa7146_vv_init_module); --module_exit(saa7146_vv_cleanup_module); -- --MODULE_AUTHOR("Michael Hunold "); --MODULE_DESCRIPTION("video4linux driver for saa7146-based hardware"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/saa7146_hlp.c b/drivers/media/common/saa7146_hlp.c -deleted file mode 100644 -index bc1f545..0000000 ---- a/drivers/media/common/saa7146_hlp.c -+++ /dev/null -@@ -1,1047 +0,0 @@ --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include --#include --#include -- --static void calculate_output_format_register(struct saa7146_dev* saa, u32 palette, u32* clip_format) --{ -- /* clear out the necessary bits */ -- *clip_format &= 0x0000ffff; -- /* set these bits new */ -- *clip_format |= (( ((palette&0xf00)>>8) << 30) | ((palette&0x00f) << 24) | (((palette&0x0f0)>>4) << 16)); --} -- --static void calculate_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync, u32* hps_ctrl) --{ -- *hps_ctrl &= ~(MASK_30 | MASK_31 | MASK_28); -- *hps_ctrl |= (source << 30) | (sync << 28); --} -- --static void calculate_hxo_and_hyo(struct saa7146_vv *vv, u32* hps_h_scale, u32* hps_ctrl) --{ -- int hyo = 0, hxo = 0; -- -- hyo = vv->standard->v_offset; -- hxo = vv->standard->h_offset; -- -- *hps_h_scale &= ~(MASK_B0 | 0xf00); -- *hps_h_scale |= (hxo << 0); -- -- *hps_ctrl &= ~(MASK_W0 | MASK_B2); -- *hps_ctrl |= (hyo << 12); --} -- --/* helper functions for the calculation of the horizontal- and vertical -- scaling registers, clip-format-register etc ... -- these functions take pointers to the (most-likely read-out -- original-values) and manipulate them according to the requested -- changes. --*/ -- --/* hps_coeff used for CXY and CXUV; scale 1/1 -> scale 1/64 */ --static struct { -- u16 hps_coeff; -- u16 weight_sum; --} hps_h_coeff_tab [] = { -- {0x00, 2}, {0x02, 4}, {0x00, 4}, {0x06, 8}, {0x02, 8}, -- {0x08, 8}, {0x00, 8}, {0x1E, 16}, {0x0E, 8}, {0x26, 8}, -- {0x06, 8}, {0x42, 8}, {0x02, 8}, {0x80, 8}, {0x00, 8}, -- {0xFE, 16}, {0xFE, 8}, {0x7E, 8}, {0x7E, 8}, {0x3E, 8}, -- {0x3E, 8}, {0x1E, 8}, {0x1E, 8}, {0x0E, 8}, {0x0E, 8}, -- {0x06, 8}, {0x06, 8}, {0x02, 8}, {0x02, 8}, {0x00, 8}, -- {0x00, 8}, {0xFE, 16}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -- {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -- {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, -- {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0xFE, 8}, {0x7E, 8}, -- {0x7E, 8}, {0x3E, 8}, {0x3E, 8}, {0x1E, 8}, {0x1E, 8}, -- {0x0E, 8}, {0x0E, 8}, {0x06, 8}, {0x06, 8}, {0x02, 8}, -- {0x02, 8}, {0x00, 8}, {0x00, 8}, {0xFE, 16} --}; -- --/* table of attenuation values for horizontal scaling */ --static u8 h_attenuation[] = { 1, 2, 4, 8, 2, 4, 8, 16, 0}; -- --/* calculate horizontal scale registers */ --static int calculate_h_scale_registers(struct saa7146_dev *dev, -- int in_x, int out_x, int flip_lr, -- u32* hps_ctrl, u32* hps_v_gain, u32* hps_h_prescale, u32* hps_h_scale) --{ -- /* horizontal prescaler */ -- u32 dcgx = 0, xpsc = 0, xacm = 0, cxy = 0, cxuv = 0; -- /* horizontal scaler */ -- u32 xim = 0, xp = 0, xsci =0; -- /* vertical scale & gain */ -- u32 pfuv = 0; -- -- /* helper variables */ -- u32 h_atten = 0, i = 0; -- -- if ( 0 == out_x ) { -- return -EINVAL; -- } -- -- /* mask out vanity-bit */ -- *hps_ctrl &= ~MASK_29; -- -- /* calculate prescale-(xspc)-value: [n .. 1/2) : 1 -- [1/2 .. 1/3) : 2 -- [1/3 .. 1/4) : 3 -- ... */ -- if (in_x > out_x) { -- xpsc = in_x / out_x; -- } -- else { -- /* zooming */ -- xpsc = 1; -- } -- -- /* if flip_lr-bit is set, number of pixels after -- horizontal prescaling must be < 384 */ -- if ( 0 != flip_lr ) { -- -- /* set vanity bit */ -- *hps_ctrl |= MASK_29; -- -- while (in_x / xpsc >= 384 ) -- xpsc++; -- } -- /* if zooming is wanted, number of pixels after -- horizontal prescaling must be < 768 */ -- else { -- while ( in_x / xpsc >= 768 ) -- xpsc++; -- } -- -- /* maximum prescale is 64 (p.69) */ -- if ( xpsc > 64 ) -- xpsc = 64; -- -- /* keep xacm clear*/ -- xacm = 0; -- -- /* set horizontal filter parameters (CXY = CXUV) */ -- cxy = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].hps_coeff; -- cxuv = cxy; -- -- /* calculate and set horizontal fine scale (xsci) */ -- -- /* bypass the horizontal scaler ? */ -- if ( (in_x == out_x) && ( 1 == xpsc ) ) -- xsci = 0x400; -- else -- xsci = ( (1024 * in_x) / (out_x * xpsc) ) + xpsc; -- -- /* set start phase for horizontal fine scale (xp) to 0 */ -- xp = 0; -- -- /* set xim, if we bypass the horizontal scaler */ -- if ( 0x400 == xsci ) -- xim = 1; -- else -- xim = 0; -- -- /* if the prescaler is bypassed, enable horizontal -- accumulation mode (xacm) and clear dcgx */ -- if( 1 == xpsc ) { -- xacm = 1; -- dcgx = 0; -- } else { -- xacm = 0; -- /* get best match in the table of attenuations -- for horizontal scaling */ -- h_atten = hps_h_coeff_tab[( (xpsc - 1) < 63 ? (xpsc - 1) : 63 )].weight_sum; -- -- for (i = 0; h_attenuation[i] != 0; i++) { -- if (h_attenuation[i] >= h_atten) -- break; -- } -- -- dcgx = i; -- } -- -- /* the horizontal scaling increment controls the UV filter -- to reduce the bandwidth to improve the display quality, -- so set it ... */ -- if ( xsci == 0x400) -- pfuv = 0x00; -- else if ( xsci < 0x600) -- pfuv = 0x01; -- else if ( xsci < 0x680) -- pfuv = 0x11; -- else if ( xsci < 0x700) -- pfuv = 0x22; -- else -- pfuv = 0x33; -- -- -- *hps_v_gain &= MASK_W0|MASK_B2; -- *hps_v_gain |= (pfuv << 24); -- -- *hps_h_scale &= ~(MASK_W1 | 0xf000); -- *hps_h_scale |= (xim << 31) | (xp << 24) | (xsci << 12); -- -- *hps_h_prescale |= (dcgx << 27) | ((xpsc-1) << 18) | (xacm << 17) | (cxy << 8) | (cxuv << 0); -- -- return 0; --} -- --static struct { -- u16 hps_coeff; -- u16 weight_sum; --} hps_v_coeff_tab [] = { -- {0x0100, 2}, {0x0102, 4}, {0x0300, 4}, {0x0106, 8}, {0x0502, 8}, -- {0x0708, 8}, {0x0F00, 8}, {0x011E, 16}, {0x110E, 16}, {0x1926, 16}, -- {0x3906, 16}, {0x3D42, 16}, {0x7D02, 16}, {0x7F80, 16}, {0xFF00, 16}, -- {0x01FE, 32}, {0x01FE, 32}, {0x817E, 32}, {0x817E, 32}, {0xC13E, 32}, -- {0xC13E, 32}, {0xE11E, 32}, {0xE11E, 32}, {0xF10E, 32}, {0xF10E, 32}, -- {0xF906, 32}, {0xF906, 32}, {0xFD02, 32}, {0xFD02, 32}, {0xFF00, 32}, -- {0xFF00, 32}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -- {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -- {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, -- {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x01FE, 64}, {0x817E, 64}, -- {0x817E, 64}, {0xC13E, 64}, {0xC13E, 64}, {0xE11E, 64}, {0xE11E, 64}, -- {0xF10E, 64}, {0xF10E, 64}, {0xF906, 64}, {0xF906, 64}, {0xFD02, 64}, -- {0xFD02, 64}, {0xFF00, 64}, {0xFF00, 64}, {0x01FE, 128} --}; -- --/* table of attenuation values for vertical scaling */ --static u16 v_attenuation[] = { 2, 4, 8, 16, 32, 64, 128, 256, 0}; -- --/* calculate vertical scale registers */ --static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field field, -- int in_y, int out_y, u32* hps_v_scale, u32* hps_v_gain) --{ -- int lpi = 0; -- -- /* vertical scaling */ -- u32 yacm = 0, ysci = 0, yacl = 0, ypo = 0, ype = 0; -- /* vertical scale & gain */ -- u32 dcgy = 0, cya_cyb = 0; -- -- /* helper variables */ -- u32 v_atten = 0, i = 0; -- -- /* error, if vertical zooming */ -- if ( in_y < out_y ) { -- return -EINVAL; -- } -- -- /* linear phase interpolation may be used -- if scaling is between 1 and 1/2 (both fields used) -- or scaling is between 1/2 and 1/4 (if only one field is used) */ -- -- if (V4L2_FIELD_HAS_BOTH(field)) { -- if( 2*out_y >= in_y) { -- lpi = 1; -- } -- } else if (field == V4L2_FIELD_TOP -- || field == V4L2_FIELD_ALTERNATE -- || field == V4L2_FIELD_BOTTOM) { -- if( 4*out_y >= in_y ) { -- lpi = 1; -- } -- out_y *= 2; -- } -- if( 0 != lpi ) { -- -- yacm = 0; -- yacl = 0; -- cya_cyb = 0x00ff; -- -- /* calculate scaling increment */ -- if ( in_y > out_y ) -- ysci = ((1024 * in_y) / (out_y + 1)) - 1024; -- else -- ysci = 0; -- -- dcgy = 0; -- -- /* calculate ype and ypo */ -- ype = ysci / 16; -- ypo = ype + (ysci / 64); -- -- } else { -- yacm = 1; -- -- /* calculate scaling increment */ -- ysci = (((10 * 1024 * (in_y - out_y - 1)) / in_y) + 9) / 10; -- -- /* calculate ype and ypo */ -- ypo = ype = ((ysci + 15) / 16); -- -- /* the sequence length interval (yacl) has to be set according -- to the prescale value, e.g. [n .. 1/2) : 0 -- [1/2 .. 1/3) : 1 -- [1/3 .. 1/4) : 2 -- ... */ -- if ( ysci < 512) { -- yacl = 0; -- } else { -- yacl = ( ysci / (1024 - ysci) ); -- } -- -- /* get filter coefficients for cya, cyb from table hps_v_coeff_tab */ -- cya_cyb = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].hps_coeff; -- -- /* get best match in the table of attenuations for vertical scaling */ -- v_atten = hps_v_coeff_tab[ (yacl < 63 ? yacl : 63 ) ].weight_sum; -- -- for (i = 0; v_attenuation[i] != 0; i++) { -- if (v_attenuation[i] >= v_atten) -- break; -- } -- -- dcgy = i; -- } -- -- /* ypo and ype swapped in spec ? */ -- *hps_v_scale |= (yacm << 31) | (ysci << 21) | (yacl << 15) | (ypo << 8 ) | (ype << 1); -- -- *hps_v_gain &= ~(MASK_W0|MASK_B2); -- *hps_v_gain |= (dcgy << 16) | (cya_cyb << 0); -- -- return 0; --} -- --/* simple bubble-sort algorithm with duplicate elimination */ --static int sort_and_eliminate(u32* values, int* count) --{ -- int low = 0, high = 0, top = 0, temp = 0; -- int cur = 0, next = 0; -- -- /* sanity checks */ -- if( (0 > *count) || (NULL == values) ) { -- return -EINVAL; -- } -- -- /* bubble sort the first @count items of the array @values */ -- for( top = *count; top > 0; top--) { -- for( low = 0, high = 1; high < top; low++, high++) { -- if( values[low] > values[high] ) { -- temp = values[low]; -- values[low] = values[high]; -- values[high] = temp; -- } -- } -- } -- -- /* remove duplicate items */ -- for( cur = 0, next = 1; next < *count; next++) { -- if( values[cur] != values[next]) -- values[++cur] = values[next]; -- } -- -- *count = cur + 1; -- -- return 0; --} -- --static void calculate_clipping_registers_rect(struct saa7146_dev *dev, struct saa7146_fh *fh, -- struct saa7146_video_dma *vdma2, u32* clip_format, u32* arbtr_ctrl, enum v4l2_field field) --{ -- struct saa7146_vv *vv = dev->vv_data; -- __le32 *clipping = vv->d_clipping.cpu_addr; -- -- int width = fh->ov.win.w.width; -- int height = fh->ov.win.w.height; -- int clipcount = fh->ov.nclips; -- -- u32 line_list[32]; -- u32 pixel_list[32]; -- int numdwords = 0; -- -- int i = 0, j = 0; -- int cnt_line = 0, cnt_pixel = 0; -- -- int x[32], y[32], w[32], h[32]; -- -- /* clear out memory */ -- memset(&line_list[0], 0x00, sizeof(u32)*32); -- memset(&pixel_list[0], 0x00, sizeof(u32)*32); -- memset(clipping, 0x00, SAA7146_CLIPPING_MEM); -- -- /* fill the line and pixel-lists */ -- for(i = 0; i < clipcount; i++) { -- int l = 0, r = 0, t = 0, b = 0; -- -- x[i] = fh->ov.clips[i].c.left; -- y[i] = fh->ov.clips[i].c.top; -- w[i] = fh->ov.clips[i].c.width; -- h[i] = fh->ov.clips[i].c.height; -- -- if( w[i] < 0) { -- x[i] += w[i]; w[i] = -w[i]; -- } -- if( h[i] < 0) { -- y[i] += h[i]; h[i] = -h[i]; -- } -- if( x[i] < 0) { -- w[i] += x[i]; x[i] = 0; -- } -- if( y[i] < 0) { -- h[i] += y[i]; y[i] = 0; -- } -- if( 0 != vv->vflip ) { -- y[i] = height - y[i] - h[i]; -- } -- -- l = x[i]; -- r = x[i]+w[i]; -- t = y[i]; -- b = y[i]+h[i]; -- -- /* insert left/right coordinates */ -- pixel_list[ 2*i ] = min_t(int, l, width); -- pixel_list[(2*i)+1] = min_t(int, r, width); -- /* insert top/bottom coordinates */ -- line_list[ 2*i ] = min_t(int, t, height); -- line_list[(2*i)+1] = min_t(int, b, height); -- } -- -- /* sort and eliminate lists */ -- cnt_line = cnt_pixel = 2*clipcount; -- sort_and_eliminate( &pixel_list[0], &cnt_pixel ); -- sort_and_eliminate( &line_list[0], &cnt_line ); -- -- /* calculate the number of used u32s */ -- numdwords = max_t(int, (cnt_line+1), (cnt_pixel+1))*2; -- numdwords = max_t(int, 4, numdwords); -- numdwords = min_t(int, 64, numdwords); -- -- /* fill up cliptable */ -- for(i = 0; i < cnt_pixel; i++) { -- clipping[2*i] |= cpu_to_le32(pixel_list[i] << 16); -- } -- for(i = 0; i < cnt_line; i++) { -- clipping[(2*i)+1] |= cpu_to_le32(line_list[i] << 16); -- } -- -- /* fill up cliptable with the display infos */ -- for(j = 0; j < clipcount; j++) { -- -- for(i = 0; i < cnt_pixel; i++) { -- -- if( x[j] < 0) -- x[j] = 0; -- -- if( pixel_list[i] < (x[j] + w[j])) { -- -- if ( pixel_list[i] >= x[j] ) { -- clipping[2*i] |= cpu_to_le32(1 << j); -- } -- } -- } -- for(i = 0; i < cnt_line; i++) { -- -- if( y[j] < 0) -- y[j] = 0; -- -- if( line_list[i] < (y[j] + h[j]) ) { -- -- if( line_list[i] >= y[j] ) { -- clipping[(2*i)+1] |= cpu_to_le32(1 << j); -- } -- } -- } -- } -- -- /* adjust arbitration control register */ -- *arbtr_ctrl &= 0xffff00ff; -- *arbtr_ctrl |= 0x00001c00; -- -- vdma2->base_even = vv->d_clipping.dma_handle; -- vdma2->base_odd = vv->d_clipping.dma_handle; -- vdma2->prot_addr = vv->d_clipping.dma_handle+((sizeof(u32))*(numdwords)); -- vdma2->base_page = 0x04; -- vdma2->pitch = 0x00; -- vdma2->num_line_byte = (0 << 16 | (sizeof(u32))*(numdwords-1) ); -- -- /* set clipping-mode. this depends on the field(s) used */ -- *clip_format &= 0xfffffff7; -- if (V4L2_FIELD_HAS_BOTH(field)) { -- *clip_format |= 0x00000008; -- } else { -- *clip_format |= 0x00000000; -- } --} -- --/* disable clipping */ --static void saa7146_disable_clipping(struct saa7146_dev *dev) --{ -- u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -- -- /* mask out relevant bits (=lower word)*/ -- clip_format &= MASK_W1; -- -- /* upload clipping-registers*/ -- saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); -- saa7146_write(dev, MC2, (MASK_05 | MASK_21)); -- -- /* disable video dma2 */ -- saa7146_write(dev, MC1, MASK_21); --} -- --static void saa7146_set_clipping_rect(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- enum v4l2_field field = fh->ov.win.field; -- struct saa7146_video_dma vdma2; -- u32 clip_format; -- u32 arbtr_ctrl; -- -- /* check clipcount, disable clipping if clipcount == 0*/ -- if( fh->ov.nclips == 0 ) { -- saa7146_disable_clipping(dev); -- return; -- } -- -- clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -- arbtr_ctrl = saa7146_read(dev, PCI_BT_V1); -- -- calculate_clipping_registers_rect(dev, fh, &vdma2, &clip_format, &arbtr_ctrl, field); -- -- /* set clipping format */ -- clip_format &= 0xffff0008; -- clip_format |= (SAA7146_CLIPPING_RECT << 4); -- -- /* prepare video dma2 */ -- saa7146_write(dev, BASE_EVEN2, vdma2.base_even); -- saa7146_write(dev, BASE_ODD2, vdma2.base_odd); -- saa7146_write(dev, PROT_ADDR2, vdma2.prot_addr); -- saa7146_write(dev, BASE_PAGE2, vdma2.base_page); -- saa7146_write(dev, PITCH2, vdma2.pitch); -- saa7146_write(dev, NUM_LINE_BYTE2, vdma2.num_line_byte); -- -- /* prepare the rest */ -- saa7146_write(dev, CLIP_FORMAT_CTRL,clip_format); -- saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); -- -- /* upload clip_control-register, clipping-registers, enable video dma2 */ -- saa7146_write(dev, MC2, (MASK_05 | MASK_21 | MASK_03 | MASK_19)); -- saa7146_write(dev, MC1, (MASK_05 | MASK_21)); --} -- --static void saa7146_set_window(struct saa7146_dev *dev, int width, int height, enum v4l2_field field) --{ -- struct saa7146_vv *vv = dev->vv_data; -- -- int source = vv->current_hps_source; -- int sync = vv->current_hps_sync; -- -- u32 hps_v_scale = 0, hps_v_gain = 0, hps_ctrl = 0, hps_h_prescale = 0, hps_h_scale = 0; -- -- /* set vertical scale */ -- hps_v_scale = 0; /* all bits get set by the function-call */ -- hps_v_gain = 0; /* fixme: saa7146_read(dev, HPS_V_GAIN);*/ -- calculate_v_scale_registers(dev, field, vv->standard->v_field*2, height, &hps_v_scale, &hps_v_gain); -- -- /* set horizontal scale */ -- hps_ctrl = 0; -- hps_h_prescale = 0; /* all bits get set in the function */ -- hps_h_scale = 0; -- calculate_h_scale_registers(dev, vv->standard->h_pixels, width, vv->hflip, &hps_ctrl, &hps_v_gain, &hps_h_prescale, &hps_h_scale); -- -- /* set hyo and hxo */ -- calculate_hxo_and_hyo(vv, &hps_h_scale, &hps_ctrl); -- calculate_hps_source_and_sync(dev, source, sync, &hps_ctrl); -- -- /* write out new register contents */ -- saa7146_write(dev, HPS_V_SCALE, hps_v_scale); -- saa7146_write(dev, HPS_V_GAIN, hps_v_gain); -- saa7146_write(dev, HPS_CTRL, hps_ctrl); -- saa7146_write(dev, HPS_H_PRESCALE,hps_h_prescale); -- saa7146_write(dev, HPS_H_SCALE, hps_h_scale); -- -- /* upload shadow-ram registers */ -- saa7146_write(dev, MC2, (MASK_05 | MASK_06 | MASK_21 | MASK_22) ); --} -- --/* calculate the new memory offsets for a desired position */ --static void saa7146_set_position(struct saa7146_dev *dev, int w_x, int w_y, int w_height, enum v4l2_field field, u32 pixelformat) --{ -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev, pixelformat); -- -- int b_depth = vv->ov_fmt->depth; -- int b_bpl = vv->ov_fb.fmt.bytesperline; -- /* The unsigned long cast is to remove a 64-bit compile warning since -- it looks like a 64-bit address is cast to a 32-bit value, even -- though the base pointer is really a 32-bit physical address that -- goes into a 32-bit DMA register. -- FIXME: might not work on some 64-bit platforms, but see the FIXME -- in struct v4l2_framebuffer (videodev2.h) for that. -- */ -- u32 base = (u32)(unsigned long)vv->ov_fb.base; -- -- struct saa7146_video_dma vdma1; -- -- /* calculate memory offsets for picture, look if we shall top-down-flip */ -- vdma1.pitch = 2*b_bpl; -- if ( 0 == vv->vflip ) { -- vdma1.base_even = base + (w_y * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); -- vdma1.base_odd = vdma1.base_even + (vdma1.pitch / 2); -- vdma1.prot_addr = vdma1.base_even + (w_height * (vdma1.pitch / 2)); -- } -- else { -- vdma1.base_even = base + ((w_y+w_height) * (vdma1.pitch/2)) + (w_x * (b_depth / 8)); -- vdma1.base_odd = vdma1.base_even - (vdma1.pitch / 2); -- vdma1.prot_addr = vdma1.base_odd - (w_height * (vdma1.pitch / 2)); -- } -- -- if (V4L2_FIELD_HAS_BOTH(field)) { -- } else if (field == V4L2_FIELD_ALTERNATE) { -- /* fixme */ -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } else if (field == V4L2_FIELD_TOP) { -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } else if (field == V4L2_FIELD_BOTTOM) { -- vdma1.base_odd = vdma1.base_even; -- vdma1.base_even = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } -- -- if ( 0 != vv->vflip ) { -- vdma1.pitch *= -1; -- } -- -- vdma1.base_page = sfmt->swap; -- vdma1.num_line_byte = (vv->standard->v_field<<16)+vv->standard->h_pixels; -- -- saa7146_write_out_dma(dev, 1, &vdma1); --} -- --static void saa7146_set_output_format(struct saa7146_dev *dev, unsigned long palette) --{ -- u32 clip_format = saa7146_read(dev, CLIP_FORMAT_CTRL); -- -- /* call helper function */ -- calculate_output_format_register(dev,palette,&clip_format); -- -- /* update the hps registers */ -- saa7146_write(dev, CLIP_FORMAT_CTRL, clip_format); -- saa7146_write(dev, MC2, (MASK_05 | MASK_21)); --} -- --/* select input-source */ --void saa7146_set_hps_source_and_sync(struct saa7146_dev *dev, int source, int sync) --{ -- struct saa7146_vv *vv = dev->vv_data; -- u32 hps_ctrl = 0; -- -- /* read old state */ -- hps_ctrl = saa7146_read(dev, HPS_CTRL); -- -- hps_ctrl &= ~( MASK_31 | MASK_30 | MASK_28 ); -- hps_ctrl |= (source << 30) | (sync << 28); -- -- /* write back & upload register */ -- saa7146_write(dev, HPS_CTRL, hps_ctrl); -- saa7146_write(dev, MC2, (MASK_05 | MASK_21)); -- -- vv->current_hps_source = source; -- vv->current_hps_sync = sync; --} --EXPORT_SYMBOL_GPL(saa7146_set_hps_source_and_sync); -- --int saa7146_enable_overlay(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- saa7146_set_window(dev, fh->ov.win.w.width, fh->ov.win.w.height, fh->ov.win.field); -- saa7146_set_position(dev, fh->ov.win.w.left, fh->ov.win.w.top, fh->ov.win.w.height, fh->ov.win.field, vv->ov_fmt->pixelformat); -- saa7146_set_output_format(dev, vv->ov_fmt->trans); -- saa7146_set_clipping_rect(fh); -- -- /* enable video dma1 */ -- saa7146_write(dev, MC1, (MASK_06 | MASK_22)); -- return 0; --} -- --void saa7146_disable_overlay(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- -- /* disable clipping + video dma1 */ -- saa7146_disable_clipping(dev); -- saa7146_write(dev, MC1, MASK_22); --} -- --void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) --{ -- int where = 0; -- -- if( which < 1 || which > 3) { -- return; -- } -- -- /* calculate starting address */ -- where = (which-1)*0x18; -- -- saa7146_write(dev, where, vdma->base_odd); -- saa7146_write(dev, where+0x04, vdma->base_even); -- saa7146_write(dev, where+0x08, vdma->prot_addr); -- saa7146_write(dev, where+0x0c, vdma->pitch); -- saa7146_write(dev, where+0x10, vdma->base_page); -- saa7146_write(dev, where+0x14, vdma->num_line_byte); -- -- /* upload */ -- saa7146_write(dev, MC2, (MASK_02<<(which-1))|(MASK_18<<(which-1))); --/* -- printk("vdma%d.base_even: 0x%08x\n", which,vdma->base_even); -- printk("vdma%d.base_odd: 0x%08x\n", which,vdma->base_odd); -- printk("vdma%d.prot_addr: 0x%08x\n", which,vdma->prot_addr); -- printk("vdma%d.base_page: 0x%08x\n", which,vdma->base_page); -- printk("vdma%d.pitch: 0x%08x\n", which,vdma->pitch); -- printk("vdma%d.num_line_byte: 0x%08x\n", which,vdma->num_line_byte); --*/ --} -- --static int calculate_video_dma_grab_packed(struct saa7146_dev* dev, struct saa7146_buf *buf) --{ -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_video_dma vdma1; -- -- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -- -- int width = buf->fmt->width; -- int height = buf->fmt->height; -- int bytesperline = buf->fmt->bytesperline; -- enum v4l2_field field = buf->fmt->field; -- -- int depth = sfmt->depth; -- -- DEB_CAP("[size=%dx%d,fields=%s]\n", -- width, height, v4l2_field_names[field]); -- -- if( bytesperline != 0) { -- vdma1.pitch = bytesperline*2; -- } else { -- vdma1.pitch = (width*depth*2)/8; -- } -- vdma1.num_line_byte = ((vv->standard->v_field<<16) + vv->standard->h_pixels); -- vdma1.base_page = buf->pt[0].dma | ME1 | sfmt->swap; -- -- if( 0 != vv->vflip ) { -- vdma1.prot_addr = buf->pt[0].offset; -- vdma1.base_even = buf->pt[0].offset+(vdma1.pitch/2)*height; -- vdma1.base_odd = vdma1.base_even - (vdma1.pitch/2); -- } else { -- vdma1.base_even = buf->pt[0].offset; -- vdma1.base_odd = vdma1.base_even + (vdma1.pitch/2); -- vdma1.prot_addr = buf->pt[0].offset+(vdma1.pitch/2)*height; -- } -- -- if (V4L2_FIELD_HAS_BOTH(field)) { -- } else if (field == V4L2_FIELD_ALTERNATE) { -- /* fixme */ -- if ( vv->last_field == V4L2_FIELD_TOP ) { -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -- vdma1.base_odd = vdma1.base_even; -- vdma1.base_even = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } -- } else if (field == V4L2_FIELD_TOP) { -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } else if (field == V4L2_FIELD_BOTTOM) { -- vdma1.base_odd = vdma1.base_even; -- vdma1.base_even = vdma1.prot_addr; -- vdma1.pitch /= 2; -- } -- -- if( 0 != vv->vflip ) { -- vdma1.pitch *= -1; -- } -- -- saa7146_write_out_dma(dev, 1, &vdma1); -- return 0; --} -- --static int calc_planar_422(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3) --{ -- int height = buf->fmt->height; -- int width = buf->fmt->width; -- -- vdma2->pitch = width; -- vdma3->pitch = width; -- -- /* fixme: look at bytesperline! */ -- -- if( 0 != vv->vflip ) { -- vdma2->prot_addr = buf->pt[1].offset; -- vdma2->base_even = ((vdma2->pitch/2)*height)+buf->pt[1].offset; -- vdma2->base_odd = vdma2->base_even - (vdma2->pitch/2); -- -- vdma3->prot_addr = buf->pt[2].offset; -- vdma3->base_even = ((vdma3->pitch/2)*height)+buf->pt[2].offset; -- vdma3->base_odd = vdma3->base_even - (vdma3->pitch/2); -- } else { -- vdma3->base_even = buf->pt[2].offset; -- vdma3->base_odd = vdma3->base_even + (vdma3->pitch/2); -- vdma3->prot_addr = (vdma3->pitch/2)*height+buf->pt[2].offset; -- -- vdma2->base_even = buf->pt[1].offset; -- vdma2->base_odd = vdma2->base_even + (vdma2->pitch/2); -- vdma2->prot_addr = (vdma2->pitch/2)*height+buf->pt[1].offset; -- } -- -- return 0; --} -- --static int calc_planar_420(struct saa7146_vv *vv, struct saa7146_buf *buf, struct saa7146_video_dma *vdma2, struct saa7146_video_dma *vdma3) --{ -- int height = buf->fmt->height; -- int width = buf->fmt->width; -- -- vdma2->pitch = width/2; -- vdma3->pitch = width/2; -- -- if( 0 != vv->vflip ) { -- vdma2->prot_addr = buf->pt[2].offset; -- vdma2->base_even = ((vdma2->pitch/2)*height)+buf->pt[2].offset; -- vdma2->base_odd = vdma2->base_even - (vdma2->pitch/2); -- -- vdma3->prot_addr = buf->pt[1].offset; -- vdma3->base_even = ((vdma3->pitch/2)*height)+buf->pt[1].offset; -- vdma3->base_odd = vdma3->base_even - (vdma3->pitch/2); -- -- } else { -- vdma3->base_even = buf->pt[2].offset; -- vdma3->base_odd = vdma3->base_even + (vdma3->pitch); -- vdma3->prot_addr = (vdma3->pitch/2)*height+buf->pt[2].offset; -- -- vdma2->base_even = buf->pt[1].offset; -- vdma2->base_odd = vdma2->base_even + (vdma2->pitch); -- vdma2->prot_addr = (vdma2->pitch/2)*height+buf->pt[1].offset; -- } -- return 0; --} -- --static int calculate_video_dma_grab_planar(struct saa7146_dev* dev, struct saa7146_buf *buf) --{ -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_video_dma vdma1; -- struct saa7146_video_dma vdma2; -- struct saa7146_video_dma vdma3; -- -- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -- -- int width = buf->fmt->width; -- int height = buf->fmt->height; -- enum v4l2_field field = buf->fmt->field; -- -- BUG_ON(0 == buf->pt[0].dma); -- BUG_ON(0 == buf->pt[1].dma); -- BUG_ON(0 == buf->pt[2].dma); -- -- DEB_CAP("[size=%dx%d,fields=%s]\n", -- width, height, v4l2_field_names[field]); -- -- /* fixme: look at bytesperline! */ -- -- /* fixme: what happens for user space buffers here?. The offsets are -- most likely wrong, this version here only works for page-aligned -- buffers, modifications to the pagetable-functions are necessary...*/ -- -- vdma1.pitch = width*2; -- vdma1.num_line_byte = ((vv->standard->v_field<<16) + vv->standard->h_pixels); -- vdma1.base_page = buf->pt[0].dma | ME1; -- -- if( 0 != vv->vflip ) { -- vdma1.prot_addr = buf->pt[0].offset; -- vdma1.base_even = ((vdma1.pitch/2)*height)+buf->pt[0].offset; -- vdma1.base_odd = vdma1.base_even - (vdma1.pitch/2); -- } else { -- vdma1.base_even = buf->pt[0].offset; -- vdma1.base_odd = vdma1.base_even + (vdma1.pitch/2); -- vdma1.prot_addr = (vdma1.pitch/2)*height+buf->pt[0].offset; -- } -- -- vdma2.num_line_byte = 0; /* unused */ -- vdma2.base_page = buf->pt[1].dma | ME1; -- -- vdma3.num_line_byte = 0; /* unused */ -- vdma3.base_page = buf->pt[2].dma | ME1; -- -- switch( sfmt->depth ) { -- case 12: { -- calc_planar_420(vv,buf,&vdma2,&vdma3); -- break; -- } -- case 16: { -- calc_planar_422(vv,buf,&vdma2,&vdma3); -- break; -- } -- default: { -- return -1; -- } -- } -- -- if (V4L2_FIELD_HAS_BOTH(field)) { -- } else if (field == V4L2_FIELD_ALTERNATE) { -- /* fixme */ -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- vdma2.base_odd = vdma2.prot_addr; -- vdma2.pitch /= 2; -- vdma3.base_odd = vdma3.prot_addr; -- vdma3.pitch /= 2; -- } else if (field == V4L2_FIELD_TOP) { -- vdma1.base_odd = vdma1.prot_addr; -- vdma1.pitch /= 2; -- vdma2.base_odd = vdma2.prot_addr; -- vdma2.pitch /= 2; -- vdma3.base_odd = vdma3.prot_addr; -- vdma3.pitch /= 2; -- } else if (field == V4L2_FIELD_BOTTOM) { -- vdma1.base_odd = vdma1.base_even; -- vdma1.base_even = vdma1.prot_addr; -- vdma1.pitch /= 2; -- vdma2.base_odd = vdma2.base_even; -- vdma2.base_even = vdma2.prot_addr; -- vdma2.pitch /= 2; -- vdma3.base_odd = vdma3.base_even; -- vdma3.base_even = vdma3.prot_addr; -- vdma3.pitch /= 2; -- } -- -- if( 0 != vv->vflip ) { -- vdma1.pitch *= -1; -- vdma2.pitch *= -1; -- vdma3.pitch *= -1; -- } -- -- saa7146_write_out_dma(dev, 1, &vdma1); -- if( (sfmt->flags & FORMAT_BYTE_SWAP) != 0 ) { -- saa7146_write_out_dma(dev, 3, &vdma2); -- saa7146_write_out_dma(dev, 2, &vdma3); -- } else { -- saa7146_write_out_dma(dev, 2, &vdma2); -- saa7146_write_out_dma(dev, 3, &vdma3); -- } -- return 0; --} -- --static void program_capture_engine(struct saa7146_dev *dev, int planar) --{ -- struct saa7146_vv *vv = dev->vv_data; -- int count = 0; -- -- unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; -- unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; -- -- /* wait for o_fid_a/b / e_fid_a/b toggle only if rps register 0 is not set*/ -- WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | o_wait); -- WRITE_RPS0(CMD_PAUSE | CMD_OAN | CMD_SIG0 | e_wait); -- -- /* set rps register 0 */ -- WRITE_RPS0(CMD_WR_REG | (1 << 8) | (MC2/4)); -- WRITE_RPS0(MASK_27 | MASK_11); -- -- /* turn on video-dma1 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_06 | MASK_22); /* => mask */ -- WRITE_RPS0(MASK_06 | MASK_22); /* => values */ -- if( 0 != planar ) { -- /* turn on video-dma2 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ -- WRITE_RPS0(MASK_05 | MASK_21); /* => values */ -- -- /* turn on video-dma3 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ -- WRITE_RPS0(MASK_04 | MASK_20); /* => values */ -- } -- -- /* wait for o_fid_a/b / e_fid_a/b toggle */ -- if ( vv->last_field == V4L2_FIELD_INTERLACED ) { -- WRITE_RPS0(CMD_PAUSE | o_wait); -- WRITE_RPS0(CMD_PAUSE | e_wait); -- } else if ( vv->last_field == V4L2_FIELD_TOP ) { -- WRITE_RPS0(CMD_PAUSE | (vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? MASK_10 : MASK_09)); -- WRITE_RPS0(CMD_PAUSE | o_wait); -- } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -- WRITE_RPS0(CMD_PAUSE | (vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? MASK_10 : MASK_09)); -- WRITE_RPS0(CMD_PAUSE | e_wait); -- } -- -- /* turn off video-dma1 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_22 | MASK_06); /* => mask */ -- WRITE_RPS0(MASK_22); /* => values */ -- if( 0 != planar ) { -- /* turn off video-dma2 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_05 | MASK_21); /* => mask */ -- WRITE_RPS0(MASK_21); /* => values */ -- -- /* turn off video-dma3 */ -- WRITE_RPS0(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS0(MASK_04 | MASK_20); /* => mask */ -- WRITE_RPS0(MASK_20); /* => values */ -- } -- -- /* generate interrupt */ -- WRITE_RPS0(CMD_INTERRUPT); -- -- /* stop */ -- WRITE_RPS0(CMD_STOP); --} -- --void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) --{ -- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -- struct saa7146_vv *vv = dev->vv_data; -- u32 vdma1_prot_addr; -- -- DEB_CAP("buf:%p, next:%p\n", buf, next); -- -- vdma1_prot_addr = saa7146_read(dev, PROT_ADDR1); -- if( 0 == vdma1_prot_addr ) { -- /* clear out beginning of streaming bit (rps register 0)*/ -- DEB_CAP("forcing sync to new frame\n"); -- saa7146_write(dev, MC2, MASK_27 ); -- } -- -- saa7146_set_window(dev, buf->fmt->width, buf->fmt->height, buf->fmt->field); -- saa7146_set_output_format(dev, sfmt->trans); -- saa7146_disable_clipping(dev); -- -- if ( vv->last_field == V4L2_FIELD_INTERLACED ) { -- } else if ( vv->last_field == V4L2_FIELD_TOP ) { -- vv->last_field = V4L2_FIELD_BOTTOM; -- } else if ( vv->last_field == V4L2_FIELD_BOTTOM ) { -- vv->last_field = V4L2_FIELD_TOP; -- } -- -- if( 0 != IS_PLANAR(sfmt->trans)) { -- calculate_video_dma_grab_planar(dev, buf); -- program_capture_engine(dev,1); -- } else { -- calculate_video_dma_grab_packed(dev, buf); -- program_capture_engine(dev,0); -- } -- --/* -- printk("vdma%d.base_even: 0x%08x\n", 1,saa7146_read(dev,BASE_EVEN1)); -- printk("vdma%d.base_odd: 0x%08x\n", 1,saa7146_read(dev,BASE_ODD1)); -- printk("vdma%d.prot_addr: 0x%08x\n", 1,saa7146_read(dev,PROT_ADDR1)); -- printk("vdma%d.base_page: 0x%08x\n", 1,saa7146_read(dev,BASE_PAGE1)); -- printk("vdma%d.pitch: 0x%08x\n", 1,saa7146_read(dev,PITCH1)); -- printk("vdma%d.num_line_byte: 0x%08x\n", 1,saa7146_read(dev,NUM_LINE_BYTE1)); -- printk("vdma%d => vptr : 0x%08x\n", 1,saa7146_read(dev,PCI_VDP1)); --*/ -- -- /* write the address of the rps-program */ -- saa7146_write(dev, RPS_ADDR0, dev->d_rps0.dma_handle); -- -- /* turn on rps */ -- saa7146_write(dev, MC1, (MASK_12 | MASK_28)); --} -diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c -deleted file mode 100644 -index 2202719..0000000 ---- a/drivers/media/common/saa7146_i2c.c -+++ /dev/null -@@ -1,423 +0,0 @@ --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include -- --static u32 saa7146_i2c_func(struct i2c_adapter *adapter) --{ -- /* DEB_I2C("'%s'\n", adapter->name); */ -- -- return I2C_FUNC_I2C -- | I2C_FUNC_SMBUS_QUICK -- | I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE -- | I2C_FUNC_SMBUS_READ_BYTE_DATA | I2C_FUNC_SMBUS_WRITE_BYTE_DATA; --} -- --/* this function returns the status-register of our i2c-device */ --static inline u32 saa7146_i2c_status(struct saa7146_dev *dev) --{ -- u32 iicsta = saa7146_read(dev, I2C_STATUS); -- /* DEB_I2C("status: 0x%08x\n", iicsta); */ -- return iicsta; --} -- --/* this function runs through the i2c-messages and prepares the data to be -- sent through the saa7146. have a look at the specifications p. 122 ff -- to understand this. it returns the number of u32s to send, or -1 -- in case of an error. */ --static int saa7146_i2c_msg_prepare(const struct i2c_msg *m, int num, __le32 *op) --{ -- int h1, h2; -- int i, j, addr; -- int mem = 0, op_count = 0; -- -- /* first determine size of needed memory */ -- for(i = 0; i < num; i++) { -- mem += m[i].len + 1; -- } -- -- /* worst case: we need one u32 for three bytes to be send -- plus one extra byte to address the device */ -- mem = 1 + ((mem-1) / 3); -- -- /* we assume that op points to a memory of at least -- * SAA7146_I2C_MEM bytes size. if we exceed this limit... -- */ -- if ((4 * mem) > SAA7146_I2C_MEM) { -- /* DEB_I2C("cannot prepare i2c-message\n"); */ -- return -ENOMEM; -- } -- -- /* be careful: clear out the i2c-mem first */ -- memset(op,0,sizeof(__le32)*mem); -- -- /* loop through all messages */ -- for(i = 0; i < num; i++) { -- -- /* insert the address of the i2c-slave. -- note: we get 7 bit i2c-addresses, -- so we have to perform a translation */ -- addr = (m[i].addr*2) + ( (0 != (m[i].flags & I2C_M_RD)) ? 1 : 0); -- h1 = op_count/3; h2 = op_count%3; -- op[h1] |= cpu_to_le32( (u8)addr << ((3-h2)*8)); -- op[h1] |= cpu_to_le32(SAA7146_I2C_START << ((3-h2)*2)); -- op_count++; -- -- /* loop through all bytes of message i */ -- for(j = 0; j < m[i].len; j++) { -- /* insert the data bytes */ -- h1 = op_count/3; h2 = op_count%3; -- op[h1] |= cpu_to_le32( (u32)((u8)m[i].buf[j]) << ((3-h2)*8)); -- op[h1] |= cpu_to_le32( SAA7146_I2C_CONT << ((3-h2)*2)); -- op_count++; -- } -- -- } -- -- /* have a look at the last byte inserted: -- if it was: ...CONT change it to ...STOP */ -- h1 = (op_count-1)/3; h2 = (op_count-1)%3; -- if ( SAA7146_I2C_CONT == (0x3 & (le32_to_cpu(op[h1]) >> ((3-h2)*2))) ) { -- op[h1] &= ~cpu_to_le32(0x2 << ((3-h2)*2)); -- op[h1] |= cpu_to_le32(SAA7146_I2C_STOP << ((3-h2)*2)); -- } -- -- /* return the number of u32s to send */ -- return mem; --} -- --/* this functions loops through all i2c-messages. normally, it should determine -- which bytes were read through the adapter and write them back to the corresponding -- i2c-message. but instead, we simply write back all bytes. -- fixme: this could be improved. */ --static int saa7146_i2c_msg_cleanup(const struct i2c_msg *m, int num, __le32 *op) --{ -- int i, j; -- int op_count = 0; -- -- /* loop through all messages */ -- for(i = 0; i < num; i++) { -- -- op_count++; -- -- /* loop through all bytes of message i */ -- for(j = 0; j < m[i].len; j++) { -- /* write back all bytes that could have been read */ -- m[i].buf[j] = (le32_to_cpu(op[op_count/3]) >> ((3-(op_count%3))*8)); -- op_count++; -- } -- } -- -- return 0; --} -- --/* this functions resets the i2c-device and returns 0 if everything was fine, otherwise -1 */ --static int saa7146_i2c_reset(struct saa7146_dev *dev) --{ -- /* get current status */ -- u32 status = saa7146_i2c_status(dev); -- -- /* clear registers for sure */ -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, I2C_TRANSFER, 0); -- -- /* check if any operation is still in progress */ -- if ( 0 != ( status & SAA7146_I2C_BUSY) ) { -- -- /* yes, kill ongoing operation */ -- DEB_I2C("busy_state detected\n"); -- -- /* set "ABORT-OPERATION"-bit (bit 7)*/ -- saa7146_write(dev, I2C_STATUS, (dev->i2c_bitrate | MASK_07)); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- msleep(SAA7146_I2C_DELAY); -- -- /* clear all error-bits pending; this is needed because p.123, note 1 */ -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- msleep(SAA7146_I2C_DELAY); -- } -- -- /* check if any error is (still) present. (this can be necessary because p.123, note 1) */ -- status = saa7146_i2c_status(dev); -- -- if ( dev->i2c_bitrate != status ) { -- -- DEB_I2C("error_state detected. status:0x%08x\n", status); -- -- /* Repeat the abort operation. This seems to be necessary -- after serious protocol errors caused by e.g. the SAA7740 */ -- saa7146_write(dev, I2C_STATUS, (dev->i2c_bitrate | MASK_07)); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- msleep(SAA7146_I2C_DELAY); -- -- /* clear all error-bits pending */ -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- msleep(SAA7146_I2C_DELAY); -- -- /* the data sheet says it might be necessary to clear the status -- twice after an abort */ -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- msleep(SAA7146_I2C_DELAY); -- } -- -- /* if any error is still present, a fatal error has occurred ... */ -- status = saa7146_i2c_status(dev); -- if ( dev->i2c_bitrate != status ) { -- DEB_I2C("fatal error. status:0x%08x\n", status); -- return -1; -- } -- -- return 0; --} -- --/* this functions writes out the data-byte 'dword' to the i2c-device. -- it returns 0 if ok, -1 if the transfer failed, -2 if the transfer -- failed badly (e.g. address error) */ --static int saa7146_i2c_writeout(struct saa7146_dev *dev, __le32 *dword, int short_delay) --{ -- u32 status = 0, mc2 = 0; -- int trial = 0; -- unsigned long timeout; -- -- /* write out i2c-command */ -- DEB_I2C("before: 0x%08x (status: 0x%08x), %d\n", -- *dword, saa7146_read(dev, I2C_STATUS), dev->i2c_op); -- -- if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) { -- -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, I2C_TRANSFER, le32_to_cpu(*dword)); -- -- dev->i2c_op = 1; -- SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17); -- SAA7146_IER_ENABLE(dev, MASK_16|MASK_17); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- -- timeout = HZ/100 + 1; /* 10ms */ -- timeout = wait_event_interruptible_timeout(dev->i2c_wq, dev->i2c_op == 0, timeout); -- if (timeout == -ERESTARTSYS || dev->i2c_op) { -- SAA7146_IER_DISABLE(dev, MASK_16|MASK_17); -- SAA7146_ISR_CLEAR(dev, MASK_16|MASK_17); -- if (timeout == -ERESTARTSYS) -- /* a signal arrived */ -- return -ERESTARTSYS; -- -- pr_warn("%s %s [irq]: timed out waiting for end of xfer\n", -- dev->name, __func__); -- return -EIO; -- } -- status = saa7146_read(dev, I2C_STATUS); -- } else { -- saa7146_write(dev, I2C_STATUS, dev->i2c_bitrate); -- saa7146_write(dev, I2C_TRANSFER, le32_to_cpu(*dword)); -- saa7146_write(dev, MC2, (MASK_00 | MASK_16)); -- -- /* do not poll for i2c-status before upload is complete */ -- timeout = jiffies + HZ/100 + 1; /* 10ms */ -- while(1) { -- mc2 = (saa7146_read(dev, MC2) & 0x1); -- if( 0 != mc2 ) { -- break; -- } -- if (time_after(jiffies,timeout)) { -- pr_warn("%s %s: timed out waiting for MC2\n", -- dev->name, __func__); -- return -EIO; -- } -- } -- /* wait until we get a transfer done or error */ -- timeout = jiffies + HZ/100 + 1; /* 10ms */ -- /* first read usually delivers bogus results... */ -- saa7146_i2c_status(dev); -- while(1) { -- status = saa7146_i2c_status(dev); -- if ((status & 0x3) != 1) -- break; -- if (time_after(jiffies,timeout)) { -- /* this is normal when probing the bus -- * (no answer from nonexisistant device...) -- */ -- pr_warn("%s %s [poll]: timed out waiting for end of xfer\n", -- dev->name, __func__); -- return -EIO; -- } -- if (++trial < 50 && short_delay) -- udelay(10); -- else -- msleep(1); -- } -- } -- -- /* give a detailed status report */ -- if ( 0 != (status & (SAA7146_I2C_SPERR | SAA7146_I2C_APERR | -- SAA7146_I2C_DTERR | SAA7146_I2C_DRERR | -- SAA7146_I2C_AL | SAA7146_I2C_ERR | -- SAA7146_I2C_BUSY)) ) { -- -- if ( 0 == (status & SAA7146_I2C_ERR) || -- 0 == (status & SAA7146_I2C_BUSY) ) { -- /* it may take some time until ERR goes high - ignore */ -- DEB_I2C("unexpected i2c status %04x\n", status); -- } -- if( 0 != (status & SAA7146_I2C_SPERR) ) { -- DEB_I2C("error due to invalid start/stop condition\n"); -- } -- if( 0 != (status & SAA7146_I2C_DTERR) ) { -- DEB_I2C("error in data transmission\n"); -- } -- if( 0 != (status & SAA7146_I2C_DRERR) ) { -- DEB_I2C("error when receiving data\n"); -- } -- if( 0 != (status & SAA7146_I2C_AL) ) { -- DEB_I2C("error because arbitration lost\n"); -- } -- -- /* we handle address-errors here */ -- if( 0 != (status & SAA7146_I2C_APERR) ) { -- DEB_I2C("error in address phase\n"); -- return -EREMOTEIO; -- } -- -- return -EIO; -- } -- -- /* read back data, just in case we were reading ... */ -- *dword = cpu_to_le32(saa7146_read(dev, I2C_TRANSFER)); -- -- DEB_I2C("after: 0x%08x\n", *dword); -- return 0; --} -- --static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *msgs, int num, int retries) --{ -- int i = 0, count = 0; -- __le32 *buffer = dev->d_i2c.cpu_addr; -- int err = 0; -- int short_delay = 0; -- -- if (mutex_lock_interruptible(&dev->i2c_lock)) -- return -ERESTARTSYS; -- -- for(i=0;i count ) { -- err = -1; -- goto out; -- } -- -- if ( count > 3 || 0 != (SAA7146_I2C_SHORT_DELAY & dev->ext->flags) ) -- short_delay = 1; -- -- do { -- /* reset the i2c-device if necessary */ -- err = saa7146_i2c_reset(dev); -- if ( 0 > err ) { -- DEB_I2C("could not reset i2c-device\n"); -- goto out; -- } -- -- /* write out the u32s one after another */ -- for(i = 0; i < count; i++) { -- err = saa7146_i2c_writeout(dev, &buffer[i], short_delay); -- if ( 0 != err) { -- /* this one is unsatisfying: some i2c slaves on some -- dvb cards don't acknowledge correctly, so the saa7146 -- thinks that an address error occurred. in that case, the -- transaction should be retrying, even if an address error -- occurred. analog saa7146 based cards extensively rely on -- i2c address probing, however, and address errors indicate that a -- device is really *not* there. retrying in that case -- increases the time the device needs to probe greatly, so -- it should be avoided. So we bail out in irq mode after an -- address error and trust the saa7146 address error detection. */ -- if (-EREMOTEIO == err && 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) -- goto out; -- DEB_I2C("error while sending message(s). starting again\n"); -- break; -- } -- } -- if( 0 == err ) { -- err = num; -- break; -- } -- -- /* delay a bit before retrying */ -- msleep(10); -- -- } while (err != num && retries--); -- -- /* quit if any error occurred */ -- if (err != num) -- goto out; -- -- /* if any things had to be read, get the results */ -- if ( 0 != saa7146_i2c_msg_cleanup(msgs, num, buffer)) { -- DEB_I2C("could not cleanup i2c-message\n"); -- err = -1; -- goto out; -- } -- -- /* return the number of delivered messages */ -- DEB_I2C("transmission successful. (msg:%d)\n", err); --out: -- /* another bug in revision 0: the i2c-registers get uploaded randomly by other -- uploads, so we better clear them out before continuing */ -- if( 0 == dev->revision ) { -- __le32 zero = 0; -- saa7146_i2c_reset(dev); -- if( 0 != saa7146_i2c_writeout(dev, &zero, short_delay)) { -- pr_info("revision 0 error. this should never happen\n"); -- } -- } -- -- mutex_unlock(&dev->i2c_lock); -- return err; --} -- --/* utility functions */ --static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num) --{ -- struct v4l2_device *v4l2_dev = i2c_get_adapdata(adapter); -- struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev); -- -- /* use helper function to transfer data */ -- return saa7146_i2c_transfer(dev, msg, num, adapter->retries); --} -- -- --/*****************************************************************************/ --/* i2c-adapter helper functions */ -- --/* exported algorithm data */ --static struct i2c_algorithm saa7146_algo = { -- .master_xfer = saa7146_i2c_xfer, -- .functionality = saa7146_i2c_func, --}; -- --int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate) --{ -- DEB_EE("bitrate: 0x%08x\n", bitrate); -- -- /* enable i2c-port pins */ -- saa7146_write(dev, MC1, (MASK_08 | MASK_24)); -- -- dev->i2c_bitrate = bitrate; -- saa7146_i2c_reset(dev); -- -- if (i2c_adapter) { -- i2c_set_adapdata(i2c_adapter, &dev->v4l2_dev); -- i2c_adapter->dev.parent = &dev->pci->dev; -- i2c_adapter->algo = &saa7146_algo; -- i2c_adapter->algo_data = NULL; -- i2c_adapter->timeout = SAA7146_I2C_TIMEOUT; -- i2c_adapter->retries = SAA7146_I2C_RETRIES; -- } -- -- return 0; --} -diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c -deleted file mode 100644 -index b2e7183..0000000 ---- a/drivers/media/common/saa7146_vbi.c -+++ /dev/null -@@ -1,512 +0,0 @@ --#include -- --static int vbi_pixel_to_capture = 720 * 2; -- --static int vbi_workaround(struct saa7146_dev *dev) --{ -- struct saa7146_vv *vv = dev->vv_data; -- -- u32 *cpu; -- dma_addr_t dma_addr; -- -- int count = 0; -- int i; -- -- DECLARE_WAITQUEUE(wait, current); -- -- DEB_VBI("dev:%p\n", dev); -- -- /* once again, a bug in the saa7146: the brs acquisition -- is buggy and especially the BXO-counter does not work -- as specified. there is this workaround, but please -- don't let me explain it. ;-) */ -- -- cpu = pci_alloc_consistent(dev->pci, 4096, &dma_addr); -- if (NULL == cpu) -- return -ENOMEM; -- -- /* setup some basic programming, just for the workaround */ -- saa7146_write(dev, BASE_EVEN3, dma_addr); -- saa7146_write(dev, BASE_ODD3, dma_addr+vbi_pixel_to_capture); -- saa7146_write(dev, PROT_ADDR3, dma_addr+4096); -- saa7146_write(dev, PITCH3, vbi_pixel_to_capture); -- saa7146_write(dev, BASE_PAGE3, 0x0); -- saa7146_write(dev, NUM_LINE_BYTE3, (2<<16)|((vbi_pixel_to_capture)<<0)); -- saa7146_write(dev, MC2, MASK_04|MASK_20); -- -- /* load brs-control register */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -- /* BXO = 1h, BRS to outbound */ -- WRITE_RPS1(0xc000008c); -- /* wait for vbi_a or vbi_b*/ -- if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) { -- DEB_D("...using port b\n"); -- WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_E_FID_B); -- WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | CMD_O_FID_B); --/* -- WRITE_RPS1(CMD_PAUSE | MASK_09); --*/ -- } else { -- DEB_D("...using port a\n"); -- WRITE_RPS1(CMD_PAUSE | MASK_10); -- } -- /* upload brs */ -- WRITE_RPS1(CMD_UPLOAD | MASK_08); -- /* load brs-control register */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -- /* BYO = 1, BXO = NQBIL (=1728 for PAL, for NTSC this is 858*2) - NumByte3 (=1440) = 288 */ -- WRITE_RPS1(((1728-(vbi_pixel_to_capture)) << 7) | MASK_19); -- /* wait for brs_done */ -- WRITE_RPS1(CMD_PAUSE | MASK_08); -- /* upload brs */ -- WRITE_RPS1(CMD_UPLOAD | MASK_08); -- /* load video-dma3 NumLines3 and NumBytes3 */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (NUM_LINE_BYTE3/4)); -- /* dev->vbi_count*2 lines, 720 pixel (= 1440 Bytes) */ -- WRITE_RPS1((2 << 16) | (vbi_pixel_to_capture)); -- /* load brs-control register */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (BRS_CTRL/4)); -- /* Set BRS right: note: this is an experimental value for BXO (=> PAL!) */ -- WRITE_RPS1((540 << 7) | (5 << 19)); // 5 == vbi_start -- /* wait for brs_done */ -- WRITE_RPS1(CMD_PAUSE | MASK_08); -- /* upload brs and video-dma3*/ -- WRITE_RPS1(CMD_UPLOAD | MASK_08 | MASK_04); -- /* load mc2 register: enable dma3 */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC1/4)); -- WRITE_RPS1(MASK_20 | MASK_04); -- /* generate interrupt */ -- WRITE_RPS1(CMD_INTERRUPT); -- /* stop rps1 */ -- WRITE_RPS1(CMD_STOP); -- -- /* we have to do the workaround twice to be sure that -- everything is ok */ -- for(i = 0; i < 2; i++) { -- -- /* indicate to the irq handler that we do the workaround */ -- saa7146_write(dev, MC2, MASK_31|MASK_15); -- -- saa7146_write(dev, NUM_LINE_BYTE3, (1<<16)|(2<<0)); -- saa7146_write(dev, MC2, MASK_04|MASK_20); -- -- /* enable rps1 irqs */ -- SAA7146_IER_ENABLE(dev,MASK_28); -- -- /* prepare to wait to be woken up by the irq-handler */ -- add_wait_queue(&vv->vbi_wq, &wait); -- current->state = TASK_INTERRUPTIBLE; -- -- /* start rps1 to enable workaround */ -- saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); -- saa7146_write(dev, MC1, (MASK_13 | MASK_29)); -- -- schedule(); -- -- DEB_VBI("brs bug workaround %d/1\n", i); -- -- remove_wait_queue(&vv->vbi_wq, &wait); -- current->state = TASK_RUNNING; -- -- /* disable rps1 irqs */ -- SAA7146_IER_DISABLE(dev,MASK_28); -- -- /* stop video-dma3 */ -- saa7146_write(dev, MC1, MASK_20); -- -- if(signal_pending(current)) { -- -- DEB_VBI("aborted (rps:0x%08x)\n", -- saa7146_read(dev, RPS_ADDR1)); -- -- /* stop rps1 for sure */ -- saa7146_write(dev, MC1, MASK_29); -- -- pci_free_consistent(dev->pci, 4096, cpu, dma_addr); -- return -EINTR; -- } -- } -- -- pci_free_consistent(dev->pci, 4096, cpu, dma_addr); -- return 0; --} -- --static void saa7146_set_vbi_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next) --{ -- struct saa7146_vv *vv = dev->vv_data; -- -- struct saa7146_video_dma vdma3; -- -- int count = 0; -- unsigned long e_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_E_FID_A : CMD_E_FID_B; -- unsigned long o_wait = vv->current_hps_sync == SAA7146_HPS_SYNC_PORT_A ? CMD_O_FID_A : CMD_O_FID_B; -- --/* -- vdma3.base_even = 0xc8000000+2560*70; -- vdma3.base_odd = 0xc8000000; -- vdma3.prot_addr = 0xc8000000+2560*164; -- vdma3.pitch = 2560; -- vdma3.base_page = 0; -- vdma3.num_line_byte = (64<<16)|((vbi_pixel_to_capture)<<0); // set above! --*/ -- vdma3.base_even = buf->pt[2].offset; -- vdma3.base_odd = buf->pt[2].offset + 16 * vbi_pixel_to_capture; -- vdma3.prot_addr = buf->pt[2].offset + 16 * 2 * vbi_pixel_to_capture; -- vdma3.pitch = vbi_pixel_to_capture; -- vdma3.base_page = buf->pt[2].dma | ME1; -- vdma3.num_line_byte = (16 << 16) | vbi_pixel_to_capture; -- -- saa7146_write_out_dma(dev, 3, &vdma3); -- -- /* write beginning of rps-program */ -- count = 0; -- -- /* wait for o_fid_a/b / e_fid_a/b toggle only if bit 1 is not set */ -- -- /* we don't wait here for the first field anymore. this is different from the video -- capture and might cause that the first buffer is only half filled (with only -- one field). but since this is some sort of streaming data, this is not that negative. -- but by doing this, we can use the whole engine from videobuf-dma-sg.c... */ -- --/* -- WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | e_wait); -- WRITE_RPS1(CMD_PAUSE | CMD_OAN | CMD_SIG1 | o_wait); --*/ -- /* set bit 1 */ -- WRITE_RPS1(CMD_WR_REG | (1 << 8) | (MC2/4)); -- WRITE_RPS1(MASK_28 | MASK_12); -- -- /* turn on video-dma3 */ -- WRITE_RPS1(CMD_WR_REG_MASK | (MC1/4)); -- WRITE_RPS1(MASK_04 | MASK_20); /* => mask */ -- WRITE_RPS1(MASK_04 | MASK_20); /* => values */ -- -- /* wait for o_fid_a/b / e_fid_a/b toggle */ -- WRITE_RPS1(CMD_PAUSE | o_wait); -- WRITE_RPS1(CMD_PAUSE | e_wait); -- -- /* generate interrupt */ -- WRITE_RPS1(CMD_INTERRUPT); -- -- /* stop */ -- WRITE_RPS1(CMD_STOP); -- -- /* enable rps1 irqs */ -- SAA7146_IER_ENABLE(dev, MASK_28); -- -- /* write the address of the rps-program */ -- saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); -- -- /* turn on rps */ -- saa7146_write(dev, MC1, (MASK_13 | MASK_29)); --} -- --static int buffer_activate(struct saa7146_dev *dev, -- struct saa7146_buf *buf, -- struct saa7146_buf *next) --{ -- struct saa7146_vv *vv = dev->vv_data; -- buf->vb.state = VIDEOBUF_ACTIVE; -- -- DEB_VBI("dev:%p, buf:%p, next:%p\n", dev, buf, next); -- saa7146_set_vbi_capture(dev,buf,next); -- -- mod_timer(&vv->vbi_q.timeout, jiffies+BUFFER_TIMEOUT); -- return 0; --} -- --static int buffer_prepare(struct videobuf_queue *q, struct videobuf_buffer *vb,enum v4l2_field field) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- -- int err = 0; -- int lines, llength, size; -- -- lines = 16 * 2 ; /* 2 fields */ -- llength = vbi_pixel_to_capture; -- size = lines * llength; -- -- DEB_VBI("vb:%p\n", vb); -- -- if (0 != buf->vb.baddr && buf->vb.bsize < size) { -- DEB_VBI("size mismatch\n"); -- return -EINVAL; -- } -- -- if (buf->vb.size != size) -- saa7146_dma_free(dev,q,buf); -- -- if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { -- struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -- -- buf->vb.width = llength; -- buf->vb.height = lines; -- buf->vb.size = size; -- buf->vb.field = field; // FIXME: check this -- -- saa7146_pgtable_free(dev->pci, &buf->pt[2]); -- saa7146_pgtable_alloc(dev->pci, &buf->pt[2]); -- -- err = videobuf_iolock(q,&buf->vb, NULL); -- if (err) -- goto oops; -- err = saa7146_pgtable_build_single(dev->pci, &buf->pt[2], -- dma->sglist, dma->sglen); -- if (0 != err) -- return err; -- } -- buf->vb.state = VIDEOBUF_PREPARED; -- buf->activate = buffer_activate; -- -- return 0; -- -- oops: -- DEB_VBI("error out\n"); -- saa7146_dma_free(dev,q,buf); -- -- return err; --} -- --static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) --{ -- int llength,lines; -- -- lines = 16 * 2 ; /* 2 fields */ -- llength = vbi_pixel_to_capture; -- -- *size = lines * llength; -- *count = 2; -- -- DEB_VBI("count:%d, size:%d\n", *count, *size); -- -- return 0; --} -- --static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- -- DEB_VBI("vb:%p\n", vb); -- saa7146_buffer_queue(dev,&vv->vbi_q,buf); --} -- --static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- -- DEB_VBI("vb:%p\n", vb); -- saa7146_dma_free(dev,q,buf); --} -- --static struct videobuf_queue_ops vbi_qops = { -- .buf_setup = buffer_setup, -- .buf_prepare = buffer_prepare, -- .buf_queue = buffer_queue, -- .buf_release = buffer_release, --}; -- --/* ------------------------------------------------------------------ */ -- --static void vbi_stop(struct saa7146_fh *fh, struct file *file) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- unsigned long flags; -- DEB_VBI("dev:%p, fh:%p\n", dev, fh); -- -- spin_lock_irqsave(&dev->slock,flags); -- -- /* disable rps1 */ -- saa7146_write(dev, MC1, MASK_29); -- -- /* disable rps1 irqs */ -- SAA7146_IER_DISABLE(dev, MASK_28); -- -- /* shut down dma 3 transfers */ -- saa7146_write(dev, MC1, MASK_20); -- -- if (vv->vbi_q.curr) { -- saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE); -- } -- -- videobuf_queue_cancel(&fh->vbi_q); -- -- vv->vbi_streaming = NULL; -- -- del_timer(&vv->vbi_q.timeout); -- del_timer(&fh->vbi_read_timeout); -- -- spin_unlock_irqrestore(&dev->slock, flags); --} -- --static void vbi_read_timeout(unsigned long data) --{ -- struct file *file = (struct file*)data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- -- DEB_VBI("dev:%p, fh:%p\n", dev, fh); -- -- vbi_stop(fh, file); --} -- --static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv) --{ -- DEB_VBI("dev:%p\n", dev); -- -- INIT_LIST_HEAD(&vv->vbi_q.queue); -- -- init_timer(&vv->vbi_q.timeout); -- vv->vbi_q.timeout.function = saa7146_buffer_timeout; -- vv->vbi_q.timeout.data = (unsigned long)(&vv->vbi_q); -- vv->vbi_q.dev = dev; -- -- init_waitqueue_head(&vv->vbi_wq); --} -- --static int vbi_open(struct saa7146_dev *dev, struct file *file) --{ -- struct saa7146_fh *fh = file->private_data; -- -- u32 arbtr_ctrl = saa7146_read(dev, PCI_BT_V1); -- int ret = 0; -- -- DEB_VBI("dev:%p, fh:%p\n", dev, fh); -- -- ret = saa7146_res_get(fh, RESOURCE_DMA3_BRS); -- if (0 == ret) { -- DEB_S("cannot get vbi RESOURCE_DMA3_BRS resource\n"); -- return -EBUSY; -- } -- -- /* adjust arbitrition control for video dma 3 */ -- arbtr_ctrl &= ~0x1f0000; -- arbtr_ctrl |= 0x1d0000; -- saa7146_write(dev, PCI_BT_V1, arbtr_ctrl); -- saa7146_write(dev, MC2, (MASK_04|MASK_20)); -- -- memset(&fh->vbi_fmt,0,sizeof(fh->vbi_fmt)); -- -- fh->vbi_fmt.sampling_rate = 27000000; -- fh->vbi_fmt.offset = 248; /* todo */ -- fh->vbi_fmt.samples_per_line = vbi_pixel_to_capture; -- fh->vbi_fmt.sample_format = V4L2_PIX_FMT_GREY; -- -- /* fixme: this only works for PAL */ -- fh->vbi_fmt.start[0] = 5; -- fh->vbi_fmt.count[0] = 16; -- fh->vbi_fmt.start[1] = 312; -- fh->vbi_fmt.count[1] = 16; -- -- videobuf_queue_sg_init(&fh->vbi_q, &vbi_qops, -- &dev->pci->dev, &dev->slock, -- V4L2_BUF_TYPE_VBI_CAPTURE, -- V4L2_FIELD_SEQ_TB, // FIXME: does this really work? -- sizeof(struct saa7146_buf), -- file, &dev->v4l2_lock); -- -- init_timer(&fh->vbi_read_timeout); -- fh->vbi_read_timeout.function = vbi_read_timeout; -- fh->vbi_read_timeout.data = (unsigned long)file; -- -- /* initialize the brs */ -- if ( 0 != (SAA7146_USE_PORT_B_FOR_VBI & dev->ext_vv_data->flags)) { -- saa7146_write(dev, BRS_CTRL, MASK_30|MASK_29 | (7 << 19)); -- } else { -- saa7146_write(dev, BRS_CTRL, 0x00000001); -- -- if (0 != (ret = vbi_workaround(dev))) { -- DEB_VBI("vbi workaround failed!\n"); -- /* return ret;*/ -- } -- } -- -- /* upload brs register */ -- saa7146_write(dev, MC2, (MASK_08|MASK_24)); -- return 0; --} -- --static void vbi_close(struct saa7146_dev *dev, struct file *file) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_vv *vv = dev->vv_data; -- DEB_VBI("dev:%p, fh:%p\n", dev, fh); -- -- if( fh == vv->vbi_streaming ) { -- vbi_stop(fh, file); -- } -- saa7146_res_free(fh, RESOURCE_DMA3_BRS); --} -- --static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status) --{ -- struct saa7146_vv *vv = dev->vv_data; -- spin_lock(&dev->slock); -- -- if (vv->vbi_q.curr) { -- DEB_VBI("dev:%p, curr:%p\n", dev, vv->vbi_q.curr); -- /* this must be += 2, one count for each field */ -- vv->vbi_fieldcount+=2; -- vv->vbi_q.curr->vb.field_count = vv->vbi_fieldcount; -- saa7146_buffer_finish(dev,&vv->vbi_q,VIDEOBUF_DONE); -- } else { -- DEB_VBI("dev:%p\n", dev); -- } -- saa7146_buffer_next(dev,&vv->vbi_q,1); -- -- spin_unlock(&dev->slock); --} -- --static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff_t *ppos) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- ssize_t ret = 0; -- -- DEB_VBI("dev:%p, fh:%p\n", dev, fh); -- -- if( NULL == vv->vbi_streaming ) { -- // fixme: check if dma3 is available -- // fixme: activate vbi engine here if necessary. (really?) -- vv->vbi_streaming = fh; -- } -- -- if( fh != vv->vbi_streaming ) { -- DEB_VBI("open %p is already using vbi capture\n", -- vv->vbi_streaming); -- return -EBUSY; -- } -- -- mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT); -- ret = videobuf_read_stream(&fh->vbi_q, data, count, ppos, 1, -- file->f_flags & O_NONBLOCK); --/* -- printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3)); -- printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3)); -- printk("PROT_ADDR3: 0x%08x\n", saa7146_read(dev, PROT_ADDR3)); -- printk("PITCH3: 0x%08x\n", saa7146_read(dev, PITCH3)); -- printk("BASE_PAGE3: 0x%08x\n", saa7146_read(dev, BASE_PAGE3)); -- printk("NUM_LINE_BYTE3: 0x%08x\n", saa7146_read(dev, NUM_LINE_BYTE3)); -- printk("BRS_CTRL: 0x%08x\n", saa7146_read(dev, BRS_CTRL)); --*/ -- return ret; --} -- --struct saa7146_use_ops saa7146_vbi_uops = { -- .init = vbi_init, -- .open = vbi_open, -- .release = vbi_close, -- .irq_done = vbi_irq_done, -- .read = vbi_read, --}; -diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c -deleted file mode 100644 -index ce30533..0000000 ---- a/drivers/media/common/saa7146_video.c -+++ /dev/null -@@ -1,1435 +0,0 @@ --#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- --#include --#include --#include -- --static int max_memory = 32; -- --module_param(max_memory, int, 0644); --MODULE_PARM_DESC(max_memory, "maximum memory usage for capture buffers (default: 32Mb)"); -- --#define IS_CAPTURE_ACTIVE(fh) \ -- (((vv->video_status & STATUS_CAPTURE) != 0) && (vv->video_fh == fh)) -- --#define IS_OVERLAY_ACTIVE(fh) \ -- (((vv->video_status & STATUS_OVERLAY) != 0) && (vv->video_fh == fh)) -- --/* format descriptions for capture and preview */ --static struct saa7146_format formats[] = { -- { -- .name = "RGB-8 (3-3-2)", -- .pixelformat = V4L2_PIX_FMT_RGB332, -- .trans = RGB08_COMPOSED, -- .depth = 8, -- .flags = 0, -- }, { -- .name = "RGB-16 (5/B-6/G-5/R)", -- .pixelformat = V4L2_PIX_FMT_RGB565, -- .trans = RGB16_COMPOSED, -- .depth = 16, -- .flags = 0, -- }, { -- .name = "RGB-24 (B-G-R)", -- .pixelformat = V4L2_PIX_FMT_BGR24, -- .trans = RGB24_COMPOSED, -- .depth = 24, -- .flags = 0, -- }, { -- .name = "RGB-32 (B-G-R)", -- .pixelformat = V4L2_PIX_FMT_BGR32, -- .trans = RGB32_COMPOSED, -- .depth = 32, -- .flags = 0, -- }, { -- .name = "RGB-32 (R-G-B)", -- .pixelformat = V4L2_PIX_FMT_RGB32, -- .trans = RGB32_COMPOSED, -- .depth = 32, -- .flags = 0, -- .swap = 0x2, -- }, { -- .name = "Greyscale-8", -- .pixelformat = V4L2_PIX_FMT_GREY, -- .trans = Y8, -- .depth = 8, -- .flags = 0, -- }, { -- .name = "YUV 4:2:2 planar (Y-Cb-Cr)", -- .pixelformat = V4L2_PIX_FMT_YUV422P, -- .trans = YUV422_DECOMPOSED, -- .depth = 16, -- .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, -- }, { -- .name = "YVU 4:2:0 planar (Y-Cb-Cr)", -- .pixelformat = V4L2_PIX_FMT_YVU420, -- .trans = YUV420_DECOMPOSED, -- .depth = 12, -- .flags = FORMAT_BYTE_SWAP|FORMAT_IS_PLANAR, -- }, { -- .name = "YUV 4:2:0 planar (Y-Cb-Cr)", -- .pixelformat = V4L2_PIX_FMT_YUV420, -- .trans = YUV420_DECOMPOSED, -- .depth = 12, -- .flags = FORMAT_IS_PLANAR, -- }, { -- .name = "YUV 4:2:2 (U-Y-V-Y)", -- .pixelformat = V4L2_PIX_FMT_UYVY, -- .trans = YUV422_COMPOSED, -- .depth = 16, -- .flags = 0, -- } --}; -- --/* unfortunately, the saa7146 contains a bug which prevents it from doing on-the-fly byte swaps. -- due to this, it's impossible to provide additional *packed* formats, which are simply byte swapped -- (like V4L2_PIX_FMT_YUYV) ... 8-( */ -- --static int NUM_FORMATS = sizeof(formats)/sizeof(struct saa7146_format); -- --struct saa7146_format* saa7146_format_by_fourcc(struct saa7146_dev *dev, int fourcc) --{ -- int i, j = NUM_FORMATS; -- -- for (i = 0; i < j; i++) { -- if (formats[i].pixelformat == fourcc) { -- return formats+i; -- } -- } -- -- DEB_D("unknown pixelformat:'%4.4s'\n", (char *)&fourcc); -- return NULL; --} -- --static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f); -- --int saa7146_start_preview(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct v4l2_format fmt; -- int ret = 0, err = 0; -- -- DEB_EE("dev:%p, fh:%p\n", dev, fh); -- -- /* check if we have overlay informations */ -- if( NULL == fh->ov.fh ) { -- DEB_D("no overlay data available. try S_FMT first.\n"); -- return -EAGAIN; -- } -- -- /* check if streaming capture is running */ -- if (IS_CAPTURE_ACTIVE(fh) != 0) { -- DEB_D("streaming capture is active\n"); -- return -EBUSY; -- } -- -- /* check if overlay is running */ -- if (IS_OVERLAY_ACTIVE(fh) != 0) { -- if (vv->video_fh == fh) { -- DEB_D("overlay is already active\n"); -- return 0; -- } -- DEB_D("overlay is already active in another open\n"); -- return -EBUSY; -- } -- -- if (0 == saa7146_res_get(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP)) { -- DEB_D("cannot get necessary overlay resources\n"); -- return -EBUSY; -- } -- -- fmt.fmt.win = fh->ov.win; -- err = vidioc_try_fmt_vid_overlay(NULL, fh, &fmt); -- if (0 != err) { -- saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -- return -EBUSY; -- } -- fh->ov.win = fmt.fmt.win; -- vv->ov_data = &fh->ov; -- -- DEB_D("%dx%d+%d+%d %s field=%s\n", -- fh->ov.win.w.width, fh->ov.win.w.height, -- fh->ov.win.w.left, fh->ov.win.w.top, -- vv->ov_fmt->name, v4l2_field_names[fh->ov.win.field]); -- -- if (0 != (ret = saa7146_enable_overlay(fh))) { -- DEB_D("enabling overlay failed: %d\n", ret); -- saa7146_res_free(vv->video_fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -- return ret; -- } -- -- vv->video_status = STATUS_OVERLAY; -- vv->video_fh = fh; -- -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_start_preview); -- --int saa7146_stop_preview(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- DEB_EE("dev:%p, fh:%p\n", dev, fh); -- -- /* check if streaming capture is running */ -- if (IS_CAPTURE_ACTIVE(fh) != 0) { -- DEB_D("streaming capture is active\n"); -- return -EBUSY; -- } -- -- /* check if overlay is running at all */ -- if ((vv->video_status & STATUS_OVERLAY) == 0) { -- DEB_D("no active overlay\n"); -- return 0; -- } -- -- if (vv->video_fh != fh) { -- DEB_D("overlay is active, but in another open\n"); -- return -EBUSY; -- } -- -- vv->video_status = 0; -- vv->video_fh = NULL; -- -- saa7146_disable_overlay(fh); -- -- saa7146_res_free(fh, RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP); -- -- return 0; --} --EXPORT_SYMBOL_GPL(saa7146_stop_preview); -- --/********************************************************************************/ --/* device controls */ -- --static struct v4l2_queryctrl controls[] = { -- { -- .id = V4L2_CID_BRIGHTNESS, -- .name = "Brightness", -- .minimum = 0, -- .maximum = 255, -- .step = 1, -- .default_value = 128, -- .type = V4L2_CTRL_TYPE_INTEGER, -- .flags = V4L2_CTRL_FLAG_SLIDER, -- },{ -- .id = V4L2_CID_CONTRAST, -- .name = "Contrast", -- .minimum = 0, -- .maximum = 127, -- .step = 1, -- .default_value = 64, -- .type = V4L2_CTRL_TYPE_INTEGER, -- .flags = V4L2_CTRL_FLAG_SLIDER, -- },{ -- .id = V4L2_CID_SATURATION, -- .name = "Saturation", -- .minimum = 0, -- .maximum = 127, -- .step = 1, -- .default_value = 64, -- .type = V4L2_CTRL_TYPE_INTEGER, -- .flags = V4L2_CTRL_FLAG_SLIDER, -- },{ -- .id = V4L2_CID_VFLIP, -- .name = "Vertical Flip", -- .minimum = 0, -- .maximum = 1, -- .type = V4L2_CTRL_TYPE_BOOLEAN, -- },{ -- .id = V4L2_CID_HFLIP, -- .name = "Horizontal Flip", -- .minimum = 0, -- .maximum = 1, -- .type = V4L2_CTRL_TYPE_BOOLEAN, -- }, --}; --static int NUM_CONTROLS = sizeof(controls)/sizeof(struct v4l2_queryctrl); -- --#define V4L2_CID_PRIVATE_LASTP1 (V4L2_CID_PRIVATE_BASE + 0) -- --static struct v4l2_queryctrl* ctrl_by_id(int id) --{ -- int i; -- -- for (i = 0; i < NUM_CONTROLS; i++) -- if (controls[i].id == id) -- return controls+i; -- return NULL; --} -- --/********************************************************************************/ --/* common pagetable functions */ -- --static int saa7146_pgtable_build(struct saa7146_dev *dev, struct saa7146_buf *buf) --{ -- struct pci_dev *pci = dev->pci; -- struct videobuf_dmabuf *dma=videobuf_to_dma(&buf->vb); -- struct scatterlist *list = dma->sglist; -- int length = dma->sglen; -- struct saa7146_format *sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -- -- DEB_EE("dev:%p, buf:%p, sg_len:%d\n", dev, buf, length); -- -- if( 0 != IS_PLANAR(sfmt->trans)) { -- struct saa7146_pgtable *pt1 = &buf->pt[0]; -- struct saa7146_pgtable *pt2 = &buf->pt[1]; -- struct saa7146_pgtable *pt3 = &buf->pt[2]; -- __le32 *ptr1, *ptr2, *ptr3; -- __le32 fill; -- -- int size = buf->fmt->width*buf->fmt->height; -- int i,p,m1,m2,m3,o1,o2; -- -- switch( sfmt->depth ) { -- case 12: { -- /* create some offsets inside the page table */ -- m1 = ((size+PAGE_SIZE)/PAGE_SIZE)-1; -- m2 = ((size+(size/4)+PAGE_SIZE)/PAGE_SIZE)-1; -- m3 = ((size+(size/2)+PAGE_SIZE)/PAGE_SIZE)-1; -- o1 = size%PAGE_SIZE; -- o2 = (size+(size/4))%PAGE_SIZE; -- DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n", -- size, m1, m2, m3, o1, o2); -- break; -- } -- case 16: { -- /* create some offsets inside the page table */ -- m1 = ((size+PAGE_SIZE)/PAGE_SIZE)-1; -- m2 = ((size+(size/2)+PAGE_SIZE)/PAGE_SIZE)-1; -- m3 = ((2*size+PAGE_SIZE)/PAGE_SIZE)-1; -- o1 = size%PAGE_SIZE; -- o2 = (size+(size/2))%PAGE_SIZE; -- DEB_CAP("size:%d, m1:%d, m2:%d, m3:%d, o1:%d, o2:%d\n", -- size, m1, m2, m3, o1, o2); -- break; -- } -- default: { -- return -1; -- } -- } -- -- ptr1 = pt1->cpu; -- ptr2 = pt2->cpu; -- ptr3 = pt3->cpu; -- -- /* walk all pages, copy all page addresses to ptr1 */ -- for (i = 0; i < length; i++, list++) { -- for (p = 0; p * 4096 < list->length; p++, ptr1++) { -- *ptr1 = cpu_to_le32(sg_dma_address(list) - list->offset); -- } -- } --/* -- ptr1 = pt1->cpu; -- for(j=0;j<40;j++) { -- printk("ptr1 %d: 0x%08x\n",j,ptr1[j]); -- } --*/ -- -- /* if we have a user buffer, the first page may not be -- aligned to a page boundary. */ -- pt1->offset = dma->sglist->offset; -- pt2->offset = pt1->offset+o1; -- pt3->offset = pt1->offset+o2; -- -- /* create video-dma2 page table */ -- ptr1 = pt1->cpu; -- for(i = m1; i <= m2 ; i++, ptr2++) { -- *ptr2 = ptr1[i]; -- } -- fill = *(ptr2-1); -- for(;i<1024;i++,ptr2++) { -- *ptr2 = fill; -- } -- /* create video-dma3 page table */ -- ptr1 = pt1->cpu; -- for(i = m2; i <= m3; i++,ptr3++) { -- *ptr3 = ptr1[i]; -- } -- fill = *(ptr3-1); -- for(;i<1024;i++,ptr3++) { -- *ptr3 = fill; -- } -- /* finally: finish up video-dma1 page table */ -- ptr1 = pt1->cpu+m1; -- fill = pt1->cpu[m1]; -- for(i=m1;i<1024;i++,ptr1++) { -- *ptr1 = fill; -- } --/* -- ptr1 = pt1->cpu; -- ptr2 = pt2->cpu; -- ptr3 = pt3->cpu; -- for(j=0;j<40;j++) { -- printk("ptr1 %d: 0x%08x\n",j,ptr1[j]); -- } -- for(j=0;j<40;j++) { -- printk("ptr2 %d: 0x%08x\n",j,ptr2[j]); -- } -- for(j=0;j<40;j++) { -- printk("ptr3 %d: 0x%08x\n",j,ptr3[j]); -- } --*/ -- } else { -- struct saa7146_pgtable *pt = &buf->pt[0]; -- return saa7146_pgtable_build_single(pci, pt, list, length); -- } -- -- return 0; --} -- -- --/********************************************************************************/ --/* file operations */ -- --static int video_begin(struct saa7146_fh *fh) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_format *fmt = NULL; -- unsigned int resource; -- int ret = 0, err = 0; -- -- DEB_EE("dev:%p, fh:%p\n", dev, fh); -- -- if ((vv->video_status & STATUS_CAPTURE) != 0) { -- if (vv->video_fh == fh) { -- DEB_S("already capturing\n"); -- return 0; -- } -- DEB_S("already capturing in another open\n"); -- return -EBUSY; -- } -- -- if ((vv->video_status & STATUS_OVERLAY) != 0) { -- DEB_S("warning: suspending overlay video for streaming capture\n"); -- vv->ov_suspend = vv->video_fh; -- err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */ -- if (0 != err) { -- DEB_D("suspending video failed. aborting\n"); -- return err; -- } -- } -- -- fmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat); -- /* we need to have a valid format set here */ -- BUG_ON(NULL == fmt); -- -- if (0 != (fmt->flags & FORMAT_IS_PLANAR)) { -- resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; -- } else { -- resource = RESOURCE_DMA1_HPS; -- } -- -- ret = saa7146_res_get(fh, resource); -- if (0 == ret) { -- DEB_S("cannot get capture resource %d\n", resource); -- if (vv->ov_suspend != NULL) { -- saa7146_start_preview(vv->ov_suspend); -- vv->ov_suspend = NULL; -- } -- return -EBUSY; -- } -- -- /* clear out beginning of streaming bit (rps register 0)*/ -- saa7146_write(dev, MC2, MASK_27 ); -- -- /* enable rps0 irqs */ -- SAA7146_IER_ENABLE(dev, MASK_27); -- -- vv->video_fh = fh; -- vv->video_status = STATUS_CAPTURE; -- -- return 0; --} -- --static int video_end(struct saa7146_fh *fh, struct file *file) --{ -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_format *fmt = NULL; -- unsigned long flags; -- unsigned int resource; -- u32 dmas = 0; -- DEB_EE("dev:%p, fh:%p\n", dev, fh); -- -- if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) { -- DEB_S("not capturing\n"); -- return 0; -- } -- -- if (vv->video_fh != fh) { -- DEB_S("capturing, but in another open\n"); -- return -EBUSY; -- } -- -- fmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat); -- /* we need to have a valid format set here */ -- BUG_ON(NULL == fmt); -- -- if (0 != (fmt->flags & FORMAT_IS_PLANAR)) { -- resource = RESOURCE_DMA1_HPS|RESOURCE_DMA2_CLP|RESOURCE_DMA3_BRS; -- dmas = MASK_22 | MASK_21 | MASK_20; -- } else { -- resource = RESOURCE_DMA1_HPS; -- dmas = MASK_22; -- } -- spin_lock_irqsave(&dev->slock,flags); -- -- /* disable rps0 */ -- saa7146_write(dev, MC1, MASK_28); -- -- /* disable rps0 irqs */ -- SAA7146_IER_DISABLE(dev, MASK_27); -- -- /* shut down all used video dma transfers */ -- saa7146_write(dev, MC1, dmas); -- -- spin_unlock_irqrestore(&dev->slock, flags); -- -- vv->video_fh = NULL; -- vv->video_status = 0; -- -- saa7146_res_free(fh, resource); -- -- if (vv->ov_suspend != NULL) { -- saa7146_start_preview(vv->ov_suspend); -- vv->ov_suspend = NULL; -- } -- -- return 0; --} -- --static int vidioc_querycap(struct file *file, void *fh, struct v4l2_capability *cap) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- -- strcpy((char *)cap->driver, "saa7146 v4l2"); -- strlcpy((char *)cap->card, dev->ext->name, sizeof(cap->card)); -- sprintf((char *)cap->bus_info, "PCI:%s", pci_name(dev->pci)); -- cap->version = SAA7146_VERSION_CODE; -- cap->capabilities = -- V4L2_CAP_VIDEO_CAPTURE | -- V4L2_CAP_VIDEO_OVERLAY | -- V4L2_CAP_READWRITE | -- V4L2_CAP_STREAMING; -- cap->capabilities |= dev->ext_vv_data->capabilities; -- return 0; --} -- --static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- *fb = vv->ov_fb; -- fb->capability = V4L2_FBUF_CAP_LIST_CLIPPING; -- return 0; --} -- --static int vidioc_s_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *fb) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_format *fmt; -- -- DEB_EE("VIDIOC_S_FBUF\n"); -- -- if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RAWIO)) -- return -EPERM; -- -- /* check args */ -- fmt = saa7146_format_by_fourcc(dev, fb->fmt.pixelformat); -- if (NULL == fmt) -- return -EINVAL; -- -- /* planar formats are not allowed for overlay video, clipping and video dma would clash */ -- if (fmt->flags & FORMAT_IS_PLANAR) -- DEB_S("planar pixelformat '%4.4s' not allowed for overlay\n", -- (char *)&fmt->pixelformat); -- -- /* check if overlay is running */ -- if (IS_OVERLAY_ACTIVE(fh) != 0) { -- if (vv->video_fh != fh) { -- DEB_D("refusing to change framebuffer informations while overlay is active in another open\n"); -- return -EBUSY; -- } -- } -- -- /* ok, accept it */ -- vv->ov_fb = *fb; -- vv->ov_fmt = fmt; -- -- if (vv->ov_fb.fmt.bytesperline < vv->ov_fb.fmt.width) { -- vv->ov_fb.fmt.bytesperline = vv->ov_fb.fmt.width * fmt->depth / 8; -- DEB_D("setting bytesperline to %d\n", vv->ov_fb.fmt.bytesperline); -- } -- return 0; --} -- --static int vidioc_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) --{ -- if (f->index >= NUM_FORMATS) -- return -EINVAL; -- strlcpy((char *)f->description, formats[f->index].name, -- sizeof(f->description)); -- f->pixelformat = formats[f->index].pixelformat; -- return 0; --} -- --static int vidioc_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *c) --{ -- const struct v4l2_queryctrl *ctrl; -- -- if ((c->id < V4L2_CID_BASE || -- c->id >= V4L2_CID_LASTP1) && -- (c->id < V4L2_CID_PRIVATE_BASE || -- c->id >= V4L2_CID_PRIVATE_LASTP1)) -- return -EINVAL; -- -- ctrl = ctrl_by_id(c->id); -- if (ctrl == NULL) -- return -EINVAL; -- -- DEB_EE("VIDIOC_QUERYCTRL: id:%d\n", c->id); -- *c = *ctrl; -- return 0; --} -- --static int vidioc_g_ctrl(struct file *file, void *fh, struct v4l2_control *c) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- const struct v4l2_queryctrl *ctrl; -- u32 value = 0; -- -- ctrl = ctrl_by_id(c->id); -- if (NULL == ctrl) -- return -EINVAL; -- switch (c->id) { -- case V4L2_CID_BRIGHTNESS: -- value = saa7146_read(dev, BCS_CTRL); -- c->value = 0xff & (value >> 24); -- DEB_D("V4L2_CID_BRIGHTNESS: %d\n", c->value); -- break; -- case V4L2_CID_CONTRAST: -- value = saa7146_read(dev, BCS_CTRL); -- c->value = 0x7f & (value >> 16); -- DEB_D("V4L2_CID_CONTRAST: %d\n", c->value); -- break; -- case V4L2_CID_SATURATION: -- value = saa7146_read(dev, BCS_CTRL); -- c->value = 0x7f & (value >> 0); -- DEB_D("V4L2_CID_SATURATION: %d\n", c->value); -- break; -- case V4L2_CID_VFLIP: -- c->value = vv->vflip; -- DEB_D("V4L2_CID_VFLIP: %d\n", c->value); -- break; -- case V4L2_CID_HFLIP: -- c->value = vv->hflip; -- DEB_D("V4L2_CID_HFLIP: %d\n", c->value); -- break; -- default: -- return -EINVAL; -- } -- return 0; --} -- --static int vidioc_s_ctrl(struct file *file, void *fh, struct v4l2_control *c) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- const struct v4l2_queryctrl *ctrl; -- -- ctrl = ctrl_by_id(c->id); -- if (NULL == ctrl) { -- DEB_D("unknown control %d\n", c->id); -- return -EINVAL; -- } -- -- switch (ctrl->type) { -- case V4L2_CTRL_TYPE_BOOLEAN: -- case V4L2_CTRL_TYPE_MENU: -- case V4L2_CTRL_TYPE_INTEGER: -- if (c->value < ctrl->minimum) -- c->value = ctrl->minimum; -- if (c->value > ctrl->maximum) -- c->value = ctrl->maximum; -- break; -- default: -- /* nothing */; -- } -- -- switch (c->id) { -- case V4L2_CID_BRIGHTNESS: { -- u32 value = saa7146_read(dev, BCS_CTRL); -- value &= 0x00ffffff; -- value |= (c->value << 24); -- saa7146_write(dev, BCS_CTRL, value); -- saa7146_write(dev, MC2, MASK_22 | MASK_06); -- break; -- } -- case V4L2_CID_CONTRAST: { -- u32 value = saa7146_read(dev, BCS_CTRL); -- value &= 0xff00ffff; -- value |= (c->value << 16); -- saa7146_write(dev, BCS_CTRL, value); -- saa7146_write(dev, MC2, MASK_22 | MASK_06); -- break; -- } -- case V4L2_CID_SATURATION: { -- u32 value = saa7146_read(dev, BCS_CTRL); -- value &= 0xffffff00; -- value |= (c->value << 0); -- saa7146_write(dev, BCS_CTRL, value); -- saa7146_write(dev, MC2, MASK_22 | MASK_06); -- break; -- } -- case V4L2_CID_HFLIP: -- /* fixme: we can support changing VFLIP and HFLIP here... */ -- if (IS_CAPTURE_ACTIVE(fh) != 0) { -- DEB_D("V4L2_CID_HFLIP while active capture\n"); -- return -EBUSY; -- } -- vv->hflip = c->value; -- break; -- case V4L2_CID_VFLIP: -- if (IS_CAPTURE_ACTIVE(fh) != 0) { -- DEB_D("V4L2_CID_VFLIP while active capture\n"); -- return -EBUSY; -- } -- vv->vflip = c->value; -- break; -- default: -- return -EINVAL; -- } -- -- if (IS_OVERLAY_ACTIVE(fh) != 0) { -- saa7146_stop_preview(fh); -- saa7146_start_preview(fh); -- } -- return 0; --} -- --static int vidioc_g_parm(struct file *file, void *fh, -- struct v4l2_streamparm *parm) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- parm->parm.capture.readbuffers = 1; -- v4l2_video_std_frame_period(vv->standard->id, -- &parm->parm.capture.timeperframe); -- return 0; --} -- --static int vidioc_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) --{ -- f->fmt.pix = ((struct saa7146_fh *)fh)->video_fmt; -- return 0; --} -- --static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) --{ -- f->fmt.win = ((struct saa7146_fh *)fh)->ov.win; -- return 0; --} -- --static int vidioc_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_format *f) --{ -- f->fmt.vbi = ((struct saa7146_fh *)fh)->vbi_fmt; -- return 0; --} -- --static int vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_format *fmt; -- enum v4l2_field field; -- int maxw, maxh; -- int calc_bpl; -- -- DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); -- -- fmt = saa7146_format_by_fourcc(dev, f->fmt.pix.pixelformat); -- if (NULL == fmt) -- return -EINVAL; -- -- field = f->fmt.pix.field; -- maxw = vv->standard->h_max_out; -- maxh = vv->standard->v_max_out; -- -- if (V4L2_FIELD_ANY == field) { -- field = (f->fmt.pix.height > maxh / 2) -- ? V4L2_FIELD_INTERLACED -- : V4L2_FIELD_BOTTOM; -- } -- switch (field) { -- case V4L2_FIELD_ALTERNATE: -- vv->last_field = V4L2_FIELD_TOP; -- maxh = maxh / 2; -- break; -- case V4L2_FIELD_TOP: -- case V4L2_FIELD_BOTTOM: -- vv->last_field = V4L2_FIELD_INTERLACED; -- maxh = maxh / 2; -- break; -- case V4L2_FIELD_INTERLACED: -- vv->last_field = V4L2_FIELD_INTERLACED; -- break; -- default: -- DEB_D("no known field mode '%d'\n", field); -- return -EINVAL; -- } -- -- f->fmt.pix.field = field; -- if (f->fmt.pix.width > maxw) -- f->fmt.pix.width = maxw; -- if (f->fmt.pix.height > maxh) -- f->fmt.pix.height = maxh; -- -- calc_bpl = (f->fmt.pix.width * fmt->depth) / 8; -- -- if (f->fmt.pix.bytesperline < calc_bpl) -- f->fmt.pix.bytesperline = calc_bpl; -- -- if (f->fmt.pix.bytesperline > (2 * PAGE_SIZE * fmt->depth) / 8) /* arbitrary constraint */ -- f->fmt.pix.bytesperline = calc_bpl; -- -- f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * f->fmt.pix.height; -- DEB_D("w:%d, h:%d, bytesperline:%d, sizeimage:%d\n", -- f->fmt.pix.width, f->fmt.pix.height, -- f->fmt.pix.bytesperline, f->fmt.pix.sizeimage); -- -- return 0; --} -- -- --static int vidioc_try_fmt_vid_overlay(struct file *file, void *fh, struct v4l2_format *f) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct v4l2_window *win = &f->fmt.win; -- enum v4l2_field field; -- int maxw, maxh; -- -- DEB_EE("dev:%p\n", dev); -- -- if (NULL == vv->ov_fb.base) { -- DEB_D("no fb base set\n"); -- return -EINVAL; -- } -- if (NULL == vv->ov_fmt) { -- DEB_D("no fb fmt set\n"); -- return -EINVAL; -- } -- if (win->w.width < 48 || win->w.height < 32) { -- DEB_D("min width/height. (%d,%d)\n", -- win->w.width, win->w.height); -- return -EINVAL; -- } -- if (win->clipcount > 16) { -- DEB_D("clipcount too big\n"); -- return -EINVAL; -- } -- -- field = win->field; -- maxw = vv->standard->h_max_out; -- maxh = vv->standard->v_max_out; -- -- if (V4L2_FIELD_ANY == field) { -- field = (win->w.height > maxh / 2) -- ? V4L2_FIELD_INTERLACED -- : V4L2_FIELD_TOP; -- } -- switch (field) { -- case V4L2_FIELD_TOP: -- case V4L2_FIELD_BOTTOM: -- case V4L2_FIELD_ALTERNATE: -- maxh = maxh / 2; -- break; -- case V4L2_FIELD_INTERLACED: -- break; -- default: -- DEB_D("no known field mode '%d'\n", field); -- return -EINVAL; -- } -- -- win->field = field; -- if (win->w.width > maxw) -- win->w.width = maxw; -- if (win->w.height > maxh) -- win->w.height = maxh; -- -- return 0; --} -- --static int vidioc_s_fmt_vid_cap(struct file *file, void *__fh, struct v4l2_format *f) --{ -- struct saa7146_fh *fh = __fh; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- int err; -- -- DEB_EE("V4L2_BUF_TYPE_VIDEO_CAPTURE: dev:%p, fh:%p\n", dev, fh); -- if (IS_CAPTURE_ACTIVE(fh) != 0) { -- DEB_EE("streaming capture is active\n"); -- return -EBUSY; -- } -- err = vidioc_try_fmt_vid_cap(file, fh, f); -- if (0 != err) -- return err; -- fh->video_fmt = f->fmt.pix; -- DEB_EE("set to pixelformat '%4.4s'\n", -- (char *)&fh->video_fmt.pixelformat); -- return 0; --} -- --static int vidioc_s_fmt_vid_overlay(struct file *file, void *__fh, struct v4l2_format *f) --{ -- struct saa7146_fh *fh = __fh; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- int err; -- -- DEB_EE("V4L2_BUF_TYPE_VIDEO_OVERLAY: dev:%p, fh:%p\n", dev, fh); -- err = vidioc_try_fmt_vid_overlay(file, fh, f); -- if (0 != err) -- return err; -- fh->ov.win = f->fmt.win; -- fh->ov.nclips = f->fmt.win.clipcount; -- if (fh->ov.nclips > 16) -- fh->ov.nclips = 16; -- if (copy_from_user(fh->ov.clips, f->fmt.win.clips, -- sizeof(struct v4l2_clip) * fh->ov.nclips)) { -- return -EFAULT; -- } -- -- /* fh->ov.fh is used to indicate that we have valid overlay informations, too */ -- fh->ov.fh = fh; -- -- /* check if our current overlay is active */ -- if (IS_OVERLAY_ACTIVE(fh) != 0) { -- saa7146_stop_preview(fh); -- saa7146_start_preview(fh); -- } -- return 0; --} -- --static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- -- *norm = vv->standard->id; -- return 0; --} -- -- /* the saa7146 supfhrts (used in conjunction with the saa7111a for example) -- PAL / NTSC / SECAM. if your hardware does not (or does more) -- -- override this function in your extension */ --/* -- case VIDIOC_ENUMSTD: -- { -- struct v4l2_standard *e = arg; -- if (e->index < 0 ) -- return -EINVAL; -- if( e->index < dev->ext_vv_data->num_stds ) { -- DEB_EE("VIDIOC_ENUMSTD: index:%d\n", e->index); -- v4l2_video_std_construct(e, dev->ext_vv_data->stds[e->index].id, dev->ext_vv_data->stds[e->index].name); -- return 0; -- } -- return -EINVAL; -- } -- */ -- --static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id) --{ -- struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; -- struct saa7146_vv *vv = dev->vv_data; -- int found = 0; -- int err, i; -- -- DEB_EE("VIDIOC_S_STD\n"); -- -- if ((vv->video_status & STATUS_CAPTURE) == STATUS_CAPTURE) { -- DEB_D("cannot change video standard while streaming capture is active\n"); -- return -EBUSY; -- } -- -- if ((vv->video_status & STATUS_OVERLAY) != 0) { -- vv->ov_suspend = vv->video_fh; -- err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */ -- if (0 != err) { -- DEB_D("suspending video failed. aborting\n"); -- return err; -- } -- } -- -- for (i = 0; i < dev->ext_vv_data->num_stds; i++) -- if (*id & dev->ext_vv_data->stds[i].id) -- break; -- if (i != dev->ext_vv_data->num_stds) { -- vv->standard = &dev->ext_vv_data->stds[i]; -- if (NULL != dev->ext_vv_data->std_callback) -- dev->ext_vv_data->std_callback(dev, vv->standard); -- found = 1; -- } -- -- if (vv->ov_suspend != NULL) { -- saa7146_start_preview(vv->ov_suspend); -- vv->ov_suspend = NULL; -- } -- -- if (!found) { -- DEB_EE("VIDIOC_S_STD: standard not found\n"); -- return -EINVAL; -- } -- -- DEB_EE("VIDIOC_S_STD: set to standard to '%s'\n", vv->standard->name); -- return 0; --} -- --static int vidioc_overlay(struct file *file, void *fh, unsigned int on) --{ -- int err; -- -- DEB_D("VIDIOC_OVERLAY on:%d\n", on); -- if (on) -- err = saa7146_start_preview(fh); -- else -- err = saa7146_stop_preview(fh); -- return err; --} -- --static int vidioc_reqbufs(struct file *file, void *__fh, struct v4l2_requestbuffers *b) --{ -- struct saa7146_fh *fh = __fh; -- -- if (b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- return videobuf_reqbufs(&fh->video_q, b); -- if (b->type == V4L2_BUF_TYPE_VBI_CAPTURE) -- return videobuf_reqbufs(&fh->vbi_q, b); -- return -EINVAL; --} -- --static int vidioc_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf) --{ -- struct saa7146_fh *fh = __fh; -- -- if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- return videobuf_querybuf(&fh->video_q, buf); -- if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -- return videobuf_querybuf(&fh->vbi_q, buf); -- return -EINVAL; --} -- --static int vidioc_qbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) --{ -- struct saa7146_fh *fh = __fh; -- -- if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- return videobuf_qbuf(&fh->video_q, buf); -- if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -- return videobuf_qbuf(&fh->vbi_q, buf); -- return -EINVAL; --} -- --static int vidioc_dqbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) --{ -- struct saa7146_fh *fh = __fh; -- -- if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- return videobuf_dqbuf(&fh->video_q, buf, file->f_flags & O_NONBLOCK); -- if (buf->type == V4L2_BUF_TYPE_VBI_CAPTURE) -- return videobuf_dqbuf(&fh->vbi_q, buf, file->f_flags & O_NONBLOCK); -- return -EINVAL; --} -- --static int vidioc_streamon(struct file *file, void *__fh, enum v4l2_buf_type type) --{ -- struct saa7146_fh *fh = __fh; -- int err; -- -- DEB_D("VIDIOC_STREAMON, type:%d\n", type); -- -- err = video_begin(fh); -- if (err) -- return err; -- if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- return videobuf_streamon(&fh->video_q); -- if (type == V4L2_BUF_TYPE_VBI_CAPTURE) -- return videobuf_streamon(&fh->vbi_q); -- return -EINVAL; --} -- --static int vidioc_streamoff(struct file *file, void *__fh, enum v4l2_buf_type type) --{ -- struct saa7146_fh *fh = __fh; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- int err; -- -- DEB_D("VIDIOC_STREAMOFF, type:%d\n", type); -- -- /* ugly: we need to copy some checks from video_end(), -- because videobuf_streamoff() relies on the capture running. -- check and fix this */ -- if ((vv->video_status & STATUS_CAPTURE) != STATUS_CAPTURE) { -- DEB_S("not capturing\n"); -- return 0; -- } -- -- if (vv->video_fh != fh) { -- DEB_S("capturing, but in another open\n"); -- return -EBUSY; -- } -- -- err = -EINVAL; -- if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE) -- err = videobuf_streamoff(&fh->video_q); -- else if (type == V4L2_BUF_TYPE_VBI_CAPTURE) -- err = videobuf_streamoff(&fh->vbi_q); -- if (0 != err) { -- DEB_D("warning: videobuf_streamoff() failed\n"); -- video_end(fh, file); -- } else { -- err = video_end(fh, file); -- } -- return err; --} -- --static int vidioc_g_chip_ident(struct file *file, void *__fh, -- struct v4l2_dbg_chip_ident *chip) --{ -- struct saa7146_fh *fh = __fh; -- struct saa7146_dev *dev = fh->dev; -- -- chip->ident = V4L2_IDENT_NONE; -- chip->revision = 0; -- if (chip->match.type == V4L2_CHIP_MATCH_HOST && !chip->match.addr) { -- chip->ident = V4L2_IDENT_SAA7146; -- return 0; -- } -- return v4l2_device_call_until_err(&dev->v4l2_dev, 0, -- core, g_chip_ident, chip); --} -- --const struct v4l2_ioctl_ops saa7146_video_ioctl_ops = { -- .vidioc_querycap = vidioc_querycap, -- .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, -- .vidioc_enum_fmt_vid_overlay = vidioc_enum_fmt_vid_cap, -- .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, -- .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, -- .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, -- .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay, -- .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, -- .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, -- .vidioc_g_fmt_vbi_cap = vidioc_g_fmt_vbi_cap, -- .vidioc_g_chip_ident = vidioc_g_chip_ident, -- -- .vidioc_overlay = vidioc_overlay, -- .vidioc_g_fbuf = vidioc_g_fbuf, -- .vidioc_s_fbuf = vidioc_s_fbuf, -- .vidioc_reqbufs = vidioc_reqbufs, -- .vidioc_querybuf = vidioc_querybuf, -- .vidioc_qbuf = vidioc_qbuf, -- .vidioc_dqbuf = vidioc_dqbuf, -- .vidioc_g_std = vidioc_g_std, -- .vidioc_s_std = vidioc_s_std, -- .vidioc_queryctrl = vidioc_queryctrl, -- .vidioc_g_ctrl = vidioc_g_ctrl, -- .vidioc_s_ctrl = vidioc_s_ctrl, -- .vidioc_streamon = vidioc_streamon, -- .vidioc_streamoff = vidioc_streamoff, -- .vidioc_g_parm = vidioc_g_parm, --}; -- --/*********************************************************************************/ --/* buffer handling functions */ -- --static int buffer_activate (struct saa7146_dev *dev, -- struct saa7146_buf *buf, -- struct saa7146_buf *next) --{ -- struct saa7146_vv *vv = dev->vv_data; -- -- buf->vb.state = VIDEOBUF_ACTIVE; -- saa7146_set_capture(dev,buf,next); -- -- mod_timer(&vv->video_q.timeout, jiffies+BUFFER_TIMEOUT); -- return 0; --} -- --static void release_all_pagetables(struct saa7146_dev *dev, struct saa7146_buf *buf) --{ -- saa7146_pgtable_free(dev->pci, &buf->pt[0]); -- saa7146_pgtable_free(dev->pci, &buf->pt[1]); -- saa7146_pgtable_free(dev->pci, &buf->pt[2]); --} -- --static int buffer_prepare(struct videobuf_queue *q, -- struct videobuf_buffer *vb, enum v4l2_field field) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- int size,err = 0; -- -- DEB_CAP("vbuf:%p\n", vb); -- -- /* sanity checks */ -- if (fh->video_fmt.width < 48 || -- fh->video_fmt.height < 32 || -- fh->video_fmt.width > vv->standard->h_max_out || -- fh->video_fmt.height > vv->standard->v_max_out) { -- DEB_D("w (%d) / h (%d) out of bounds\n", -- fh->video_fmt.width, fh->video_fmt.height); -- return -EINVAL; -- } -- -- size = fh->video_fmt.sizeimage; -- if (0 != buf->vb.baddr && buf->vb.bsize < size) { -- DEB_D("size mismatch\n"); -- return -EINVAL; -- } -- -- DEB_CAP("buffer_prepare [size=%dx%d,bytes=%d,fields=%s]\n", -- fh->video_fmt.width, fh->video_fmt.height, -- size, v4l2_field_names[fh->video_fmt.field]); -- if (buf->vb.width != fh->video_fmt.width || -- buf->vb.bytesperline != fh->video_fmt.bytesperline || -- buf->vb.height != fh->video_fmt.height || -- buf->vb.size != size || -- buf->vb.field != field || -- buf->vb.field != fh->video_fmt.field || -- buf->fmt != &fh->video_fmt) { -- saa7146_dma_free(dev,q,buf); -- } -- -- if (VIDEOBUF_NEEDS_INIT == buf->vb.state) { -- struct saa7146_format *sfmt; -- -- buf->vb.bytesperline = fh->video_fmt.bytesperline; -- buf->vb.width = fh->video_fmt.width; -- buf->vb.height = fh->video_fmt.height; -- buf->vb.size = size; -- buf->vb.field = field; -- buf->fmt = &fh->video_fmt; -- buf->vb.field = fh->video_fmt.field; -- -- sfmt = saa7146_format_by_fourcc(dev,buf->fmt->pixelformat); -- -- release_all_pagetables(dev, buf); -- if( 0 != IS_PLANAR(sfmt->trans)) { -- saa7146_pgtable_alloc(dev->pci, &buf->pt[0]); -- saa7146_pgtable_alloc(dev->pci, &buf->pt[1]); -- saa7146_pgtable_alloc(dev->pci, &buf->pt[2]); -- } else { -- saa7146_pgtable_alloc(dev->pci, &buf->pt[0]); -- } -- -- err = videobuf_iolock(q,&buf->vb, &vv->ov_fb); -- if (err) -- goto oops; -- err = saa7146_pgtable_build(dev,buf); -- if (err) -- goto oops; -- } -- buf->vb.state = VIDEOBUF_PREPARED; -- buf->activate = buffer_activate; -- -- return 0; -- -- oops: -- DEB_D("error out\n"); -- saa7146_dma_free(dev,q,buf); -- -- return err; --} -- --static int buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- -- if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) -- *count = MAX_SAA7146_CAPTURE_BUFFERS; -- -- *size = fh->video_fmt.sizeimage; -- -- /* check if we exceed the "max_memory" parameter */ -- if( (*count * *size) > (max_memory*1048576) ) { -- *count = (max_memory*1048576) / *size; -- } -- -- DEB_CAP("%d buffers, %d bytes each\n", *count, *size); -- -- return 0; --} -- --static void buffer_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- -- DEB_CAP("vbuf:%p\n", vb); -- saa7146_buffer_queue(fh->dev,&vv->video_q,buf); --} -- --static void buffer_release(struct videobuf_queue *q, struct videobuf_buffer *vb) --{ -- struct file *file = q->priv_data; -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_buf *buf = (struct saa7146_buf *)vb; -- -- DEB_CAP("vbuf:%p\n", vb); -- -- saa7146_dma_free(dev,q,buf); -- -- release_all_pagetables(dev, buf); --} -- --static struct videobuf_queue_ops video_qops = { -- .buf_setup = buffer_setup, -- .buf_prepare = buffer_prepare, -- .buf_queue = buffer_queue, -- .buf_release = buffer_release, --}; -- --/********************************************************************************/ --/* file operations */ -- --static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv) --{ -- INIT_LIST_HEAD(&vv->video_q.queue); -- -- init_timer(&vv->video_q.timeout); -- vv->video_q.timeout.function = saa7146_buffer_timeout; -- vv->video_q.timeout.data = (unsigned long)(&vv->video_q); -- vv->video_q.dev = dev; -- -- /* set some default values */ -- vv->standard = &dev->ext_vv_data->stds[0]; -- -- /* FIXME: what's this? */ -- vv->current_hps_source = SAA7146_HPS_SOURCE_PORT_A; -- vv->current_hps_sync = SAA7146_HPS_SYNC_PORT_A; --} -- -- --static int video_open(struct saa7146_dev *dev, struct file *file) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_format *sfmt; -- -- fh->video_fmt.width = 384; -- fh->video_fmt.height = 288; -- fh->video_fmt.pixelformat = V4L2_PIX_FMT_BGR24; -- fh->video_fmt.bytesperline = 0; -- fh->video_fmt.field = V4L2_FIELD_ANY; -- sfmt = saa7146_format_by_fourcc(dev,fh->video_fmt.pixelformat); -- fh->video_fmt.sizeimage = (fh->video_fmt.width * fh->video_fmt.height * sfmt->depth)/8; -- -- videobuf_queue_sg_init(&fh->video_q, &video_qops, -- &dev->pci->dev, &dev->slock, -- V4L2_BUF_TYPE_VIDEO_CAPTURE, -- V4L2_FIELD_INTERLACED, -- sizeof(struct saa7146_buf), -- file, &dev->v4l2_lock); -- -- return 0; --} -- -- --static void video_close(struct saa7146_dev *dev, struct file *file) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_vv *vv = dev->vv_data; -- struct videobuf_queue *q = &fh->video_q; -- -- if (IS_CAPTURE_ACTIVE(fh) != 0) -- video_end(fh, file); -- else if (IS_OVERLAY_ACTIVE(fh) != 0) -- saa7146_stop_preview(fh); -- -- videobuf_stop(q); -- /* hmm, why is this function declared void? */ --} -- -- --static void video_irq_done(struct saa7146_dev *dev, unsigned long st) --{ -- struct saa7146_vv *vv = dev->vv_data; -- struct saa7146_dmaqueue *q = &vv->video_q; -- -- spin_lock(&dev->slock); -- DEB_CAP("called\n"); -- -- /* only finish the buffer if we have one... */ -- if( NULL != q->curr ) { -- saa7146_buffer_finish(dev,q,VIDEOBUF_DONE); -- } -- saa7146_buffer_next(dev,q,0); -- -- spin_unlock(&dev->slock); --} -- --static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos) --{ -- struct saa7146_fh *fh = file->private_data; -- struct saa7146_dev *dev = fh->dev; -- struct saa7146_vv *vv = dev->vv_data; -- ssize_t ret = 0; -- -- DEB_EE("called\n"); -- -- if ((vv->video_status & STATUS_CAPTURE) != 0) { -- /* fixme: should we allow read() captures while streaming capture? */ -- if (vv->video_fh == fh) { -- DEB_S("already capturing\n"); -- return -EBUSY; -- } -- DEB_S("already capturing in another open\n"); -- return -EBUSY; -- } -- -- ret = video_begin(fh); -- if( 0 != ret) { -- goto out; -- } -- -- ret = videobuf_read_one(&fh->video_q , data, count, ppos, -- file->f_flags & O_NONBLOCK); -- if (ret != 0) { -- video_end(fh, file); -- } else { -- ret = video_end(fh, file); -- } --out: -- /* restart overlay if it was active before */ -- if (vv->ov_suspend != NULL) { -- saa7146_start_preview(vv->ov_suspend); -- vv->ov_suspend = NULL; -- } -- -- return ret; --} -- --struct saa7146_use_ops saa7146_video_uops = { -- .init = video_init, -- .open = video_open, -- .release = video_close, -- .irq_done = video_irq_done, -- .read = video_read, --}; -diff --git a/drivers/media/common/siano/Kconfig b/drivers/media/common/siano/Kconfig -new file mode 100644 -index 0000000..68f0f60 ---- /dev/null -+++ b/drivers/media/common/siano/Kconfig -@@ -0,0 +1,19 @@ -+# -+# Siano Mobile Silicon Digital TV device configuration -+# -+ -+config SMS_SIANO_MDTV -+ tristate -+ depends on DVB_CORE && HAS_DMA -+ depends on !RC_CORE || RC_CORE -+ depends on SMS_USB_DRV || SMS_SDIO_DRV -+ default y -+ -+config SMS_SIANO_RC -+ bool "Enable Remote Controller support for Siano devices" -+ depends on SMS_SIANO_MDTV && RC_CORE -+ depends on SMS_USB_DRV || SMS_SDIO_DRV -+ depends on MEDIA_COMMON_OPTIONS -+ default y -+ ---help--- -+ Choose Y to select Remote Controller support for Siano driver. -diff --git a/drivers/media/common/siano/Makefile b/drivers/media/common/siano/Makefile -new file mode 100644 -index 0000000..81b1e98 ---- /dev/null -+++ b/drivers/media/common/siano/Makefile -@@ -0,0 +1,11 @@ -+smsmdtv-objs := smscoreapi.o sms-cards.o smsendian.o -+ -+obj-$(CONFIG_SMS_SIANO_MDTV) += smsmdtv.o smsdvb.o -+ -+ifeq ($(CONFIG_SMS_SIANO_RC),y) -+ smsmdtv-objs += smsir.o -+endif -+ -+ccflags-y += -Idrivers/media/dvb-core -+ccflags-y += $(extra-cflags-y) $(extra-cflags-m) -+ -diff --git a/drivers/media/common/siano/sms-cards.c b/drivers/media/common/siano/sms-cards.c -new file mode 100644 -index 0000000..680c781 ---- /dev/null -+++ b/drivers/media/common/siano/sms-cards.c -@@ -0,0 +1,311 @@ -+/* -+ * Card-specific functions for the Siano SMS1xxx USB dongle -+ * -+ * Copyright (c) 2008 Michael Krufky -+ * -+ * 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; -+ * -+ * Software distributed under the License is distributed on an "AS IS" -+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. -+ * -+ * See the GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include "sms-cards.h" -+#include "smsir.h" -+#include -+ -+static int sms_dbg; -+module_param_named(cards_dbg, sms_dbg, int, 0644); -+MODULE_PARM_DESC(cards_dbg, "set debug level (info=1, adv=2 (or-able))"); -+ -+static struct sms_board sms_boards[] = { -+ [SMS_BOARD_UNKNOWN] = { -+ .name = "Unknown board", -+ }, -+ [SMS1XXX_BOARD_SIANO_STELLAR] = { -+ .name = "Siano Stellar Digital Receiver", -+ .type = SMS_STELLAR, -+ }, -+ [SMS1XXX_BOARD_SIANO_NOVA_A] = { -+ .name = "Siano Nova A Digital Receiver", -+ .type = SMS_NOVA_A0, -+ }, -+ [SMS1XXX_BOARD_SIANO_NOVA_B] = { -+ .name = "Siano Nova B Digital Receiver", -+ .type = SMS_NOVA_B0, -+ }, -+ [SMS1XXX_BOARD_SIANO_VEGA] = { -+ .name = "Siano Vega Digital Receiver", -+ .type = SMS_VEGA, -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT] = { -+ .name = "Hauppauge Catamount", -+ .type = SMS_STELLAR, -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-stellar-dvbt-01.fw", -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A] = { -+ .name = "Hauppauge Okemo-A", -+ .type = SMS_NOVA_A0, -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-a-dvbt-01.fw", -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B] = { -+ .name = "Hauppauge Okemo-B", -+ .type = SMS_NOVA_B0, -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-b-dvbt-01.fw", -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = { -+ .name = "Hauppauge WinTV MiniStick", -+ .type = SMS_NOVA_B0, -+ .fw[DEVICE_MODE_ISDBT_BDA] = "sms1xxx-hcw-55xxx-isdbt-02.fw", -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", -+ .rc_codes = RC_MAP_HAUPPAUGE, -+ .board_cfg.leds_power = 26, -+ .board_cfg.led0 = 27, -+ .board_cfg.led1 = 28, -+ .board_cfg.ir = 9, -+ .led_power = 26, -+ .led_lo = 27, -+ .led_hi = 28, -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = { -+ .name = "Hauppauge WinTV MiniCard", -+ .type = SMS_NOVA_B0, -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", -+ .lna_ctrl = 29, -+ .board_cfg.foreign_lna0_ctrl = 29, -+ .rf_switch = 17, -+ .board_cfg.rf_switch_uhf = 17, -+ }, -+ [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = { -+ .name = "Hauppauge WinTV MiniCard", -+ .type = SMS_NOVA_B0, -+ .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", -+ .lna_ctrl = -1, -+ }, -+ [SMS1XXX_BOARD_SIANO_NICE] = { -+ /* 11 */ -+ .name = "Siano Nice Digital Receiver", -+ .type = SMS_NOVA_B0, -+ }, -+ [SMS1XXX_BOARD_SIANO_VENICE] = { -+ /* 12 */ -+ .name = "Siano Venice Digital Receiver", -+ .type = SMS_VEGA, -+ }, -+}; -+ -+struct sms_board *sms_get_board(unsigned id) -+{ -+ BUG_ON(id >= ARRAY_SIZE(sms_boards)); -+ -+ return &sms_boards[id]; -+} -+EXPORT_SYMBOL_GPL(sms_get_board); -+static inline void sms_gpio_assign_11xx_default_led_config( -+ struct smscore_gpio_config *pGpioConfig) { -+ pGpioConfig->Direction = SMS_GPIO_DIRECTION_OUTPUT; -+ pGpioConfig->InputCharacteristics = -+ SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL; -+ pGpioConfig->OutputDriving = SMS_GPIO_OUTPUT_DRIVING_4mA; -+ pGpioConfig->OutputSlewRate = SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS; -+ pGpioConfig->PullUpDown = SMS_GPIO_PULL_UP_DOWN_NONE; -+} -+ -+int sms_board_event(struct smscore_device_t *coredev, -+ enum SMS_BOARD_EVENTS gevent) { -+ struct smscore_gpio_config MyGpioConfig; -+ -+ sms_gpio_assign_11xx_default_led_config(&MyGpioConfig); -+ -+ switch (gevent) { -+ case BOARD_EVENT_POWER_INIT: /* including hotplug */ -+ break; /* BOARD_EVENT_BIND */ -+ -+ case BOARD_EVENT_POWER_SUSPEND: -+ break; /* BOARD_EVENT_POWER_SUSPEND */ -+ -+ case BOARD_EVENT_POWER_RESUME: -+ break; /* BOARD_EVENT_POWER_RESUME */ -+ -+ case BOARD_EVENT_BIND: -+ break; /* BOARD_EVENT_BIND */ -+ -+ case BOARD_EVENT_SCAN_PROG: -+ break; /* BOARD_EVENT_SCAN_PROG */ -+ case BOARD_EVENT_SCAN_COMP: -+ break; /* BOARD_EVENT_SCAN_COMP */ -+ case BOARD_EVENT_EMERGENCY_WARNING_SIGNAL: -+ break; /* BOARD_EVENT_EMERGENCY_WARNING_SIGNAL */ -+ case BOARD_EVENT_FE_LOCK: -+ break; /* BOARD_EVENT_FE_LOCK */ -+ case BOARD_EVENT_FE_UNLOCK: -+ break; /* BOARD_EVENT_FE_UNLOCK */ -+ case BOARD_EVENT_DEMOD_LOCK: -+ break; /* BOARD_EVENT_DEMOD_LOCK */ -+ case BOARD_EVENT_DEMOD_UNLOCK: -+ break; /* BOARD_EVENT_DEMOD_UNLOCK */ -+ case BOARD_EVENT_RECEPTION_MAX_4: -+ break; /* BOARD_EVENT_RECEPTION_MAX_4 */ -+ case BOARD_EVENT_RECEPTION_3: -+ break; /* BOARD_EVENT_RECEPTION_3 */ -+ case BOARD_EVENT_RECEPTION_2: -+ break; /* BOARD_EVENT_RECEPTION_2 */ -+ case BOARD_EVENT_RECEPTION_1: -+ break; /* BOARD_EVENT_RECEPTION_1 */ -+ case BOARD_EVENT_RECEPTION_LOST_0: -+ break; /* BOARD_EVENT_RECEPTION_LOST_0 */ -+ case BOARD_EVENT_MULTIPLEX_OK: -+ break; /* BOARD_EVENT_MULTIPLEX_OK */ -+ case BOARD_EVENT_MULTIPLEX_ERRORS: -+ break; /* BOARD_EVENT_MULTIPLEX_ERRORS */ -+ -+ default: -+ sms_err("Unknown SMS board event"); -+ break; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(sms_board_event); -+ -+static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) -+{ -+ int lvl, ret; -+ u32 gpio; -+ struct smscore_config_gpio gpioconfig = { -+ .direction = SMS_GPIO_DIRECTION_OUTPUT, -+ .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, -+ .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, -+ .outputslewrate = SMS_GPIO_OUTPUTSLEWRATE_FAST, -+ .outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA, -+ }; -+ -+ if (pin == 0) -+ return -EINVAL; -+ -+ if (pin < 0) { -+ /* inverted gpio */ -+ gpio = pin * -1; -+ lvl = enable ? 0 : 1; -+ } else { -+ gpio = pin; -+ lvl = enable ? 1 : 0; -+ } -+ -+ ret = smscore_configure_gpio(coredev, gpio, &gpioconfig); -+ if (ret < 0) -+ return ret; -+ -+ return smscore_set_gpio(coredev, gpio, lvl); -+} -+ -+int sms_board_setup(struct smscore_device_t *coredev) -+{ -+ int board_id = smscore_get_board_id(coredev); -+ struct sms_board *board = sms_get_board(board_id); -+ -+ switch (board_id) { -+ case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: -+ /* turn off all LEDs */ -+ sms_set_gpio(coredev, board->led_power, 0); -+ sms_set_gpio(coredev, board->led_hi, 0); -+ sms_set_gpio(coredev, board->led_lo, 0); -+ break; -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: -+ /* turn off LNA */ -+ sms_set_gpio(coredev, board->lna_ctrl, 0); -+ break; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(sms_board_setup); -+ -+int sms_board_power(struct smscore_device_t *coredev, int onoff) -+{ -+ int board_id = smscore_get_board_id(coredev); -+ struct sms_board *board = sms_get_board(board_id); -+ -+ switch (board_id) { -+ case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: -+ /* power LED */ -+ sms_set_gpio(coredev, -+ board->led_power, onoff ? 1 : 0); -+ break; -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: -+ /* LNA */ -+ if (!onoff) -+ sms_set_gpio(coredev, board->lna_ctrl, 0); -+ break; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(sms_board_power); -+ -+int sms_board_led_feedback(struct smscore_device_t *coredev, int led) -+{ -+ int board_id = smscore_get_board_id(coredev); -+ struct sms_board *board = sms_get_board(board_id); -+ -+ /* dont touch GPIO if LEDs are already set */ -+ if (smscore_led_state(coredev, -1) == led) -+ return 0; -+ -+ switch (board_id) { -+ case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: -+ sms_set_gpio(coredev, -+ board->led_lo, (led & SMS_LED_LO) ? 1 : 0); -+ sms_set_gpio(coredev, -+ board->led_hi, (led & SMS_LED_HI) ? 1 : 0); -+ -+ smscore_led_state(coredev, led); -+ break; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(sms_board_led_feedback); -+ -+int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) -+{ -+ int board_id = smscore_get_board_id(coredev); -+ struct sms_board *board = sms_get_board(board_id); -+ -+ sms_debug("%s: LNA %s", __func__, onoff ? "enabled" : "disabled"); -+ -+ switch (board_id) { -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: -+ sms_set_gpio(coredev, -+ board->rf_switch, onoff ? 1 : 0); -+ return sms_set_gpio(coredev, -+ board->lna_ctrl, onoff ? 1 : 0); -+ } -+ return -EINVAL; -+} -+EXPORT_SYMBOL_GPL(sms_board_lna_control); -+ -+int sms_board_load_modules(int id) -+{ -+ switch (id) { -+ case SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT: -+ case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A: -+ case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B: -+ case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: -+ case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: -+ request_module("smsdvb"); -+ break; -+ default: -+ /* do nothing */ -+ break; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(sms_board_load_modules); -diff --git a/drivers/media/common/siano/sms-cards.h b/drivers/media/common/siano/sms-cards.h -new file mode 100644 -index 0000000..d8cdf75 ---- /dev/null -+++ b/drivers/media/common/siano/sms-cards.h -@@ -0,0 +1,123 @@ -+/* -+ * Card-specific functions for the Siano SMS1xxx USB dongle -+ * -+ * Copyright (c) 2008 Michael Krufky -+ * -+ * 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; -+ * -+ * Software distributed under the License is distributed on an "AS IS" -+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. -+ * -+ * See the GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#ifndef __SMS_CARDS_H__ -+#define __SMS_CARDS_H__ -+ -+#include -+#include "smscoreapi.h" -+#include "smsir.h" -+ -+#define SMS_BOARD_UNKNOWN 0 -+#define SMS1XXX_BOARD_SIANO_STELLAR 1 -+#define SMS1XXX_BOARD_SIANO_NOVA_A 2 -+#define SMS1XXX_BOARD_SIANO_NOVA_B 3 -+#define SMS1XXX_BOARD_SIANO_VEGA 4 -+#define SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT 5 -+#define SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A 6 -+#define SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B 7 -+#define SMS1XXX_BOARD_HAUPPAUGE_WINDHAM 8 -+#define SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD 9 -+#define SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 10 -+#define SMS1XXX_BOARD_SIANO_NICE 11 -+#define SMS1XXX_BOARD_SIANO_VENICE 12 -+ -+struct sms_board_gpio_cfg { -+ int lna_vhf_exist; -+ int lna_vhf_ctrl; -+ int lna_uhf_exist; -+ int lna_uhf_ctrl; -+ int lna_uhf_d_ctrl; -+ int lna_sband_exist; -+ int lna_sband_ctrl; -+ int lna_sband_d_ctrl; -+ int foreign_lna0_ctrl; -+ int foreign_lna1_ctrl; -+ int foreign_lna2_ctrl; -+ int rf_switch_vhf; -+ int rf_switch_uhf; -+ int rf_switch_sband; -+ int leds_power; -+ int led0; -+ int led1; -+ int led2; -+ int led3; -+ int led4; -+ int ir; -+ int eeprom_wp; -+ int mrc_sense; -+ int mrc_pdn_resetn; -+ int mrc_gp0; /* mrcs spi int */ -+ int mrc_gp1; -+ int mrc_gp2; -+ int mrc_gp3; -+ int mrc_gp4; -+ int host_spi_gsp_ts_int; -+}; -+ -+struct sms_board { -+ enum sms_device_type_st type; -+ char *name, *fw[DEVICE_MODE_MAX]; -+ struct sms_board_gpio_cfg board_cfg; -+ char *rc_codes; /* Name of IR codes table */ -+ -+ /* gpios */ -+ int led_power, led_hi, led_lo, lna_ctrl, rf_switch; -+}; -+ -+struct sms_board *sms_get_board(unsigned id); -+ -+extern struct smscore_device_t *coredev; -+ -+enum SMS_BOARD_EVENTS { -+ BOARD_EVENT_POWER_INIT, -+ BOARD_EVENT_POWER_SUSPEND, -+ BOARD_EVENT_POWER_RESUME, -+ BOARD_EVENT_BIND, -+ BOARD_EVENT_SCAN_PROG, -+ BOARD_EVENT_SCAN_COMP, -+ BOARD_EVENT_EMERGENCY_WARNING_SIGNAL, -+ BOARD_EVENT_FE_LOCK, -+ BOARD_EVENT_FE_UNLOCK, -+ BOARD_EVENT_DEMOD_LOCK, -+ BOARD_EVENT_DEMOD_UNLOCK, -+ BOARD_EVENT_RECEPTION_MAX_4, -+ BOARD_EVENT_RECEPTION_3, -+ BOARD_EVENT_RECEPTION_2, -+ BOARD_EVENT_RECEPTION_1, -+ BOARD_EVENT_RECEPTION_LOST_0, -+ BOARD_EVENT_MULTIPLEX_OK, -+ BOARD_EVENT_MULTIPLEX_ERRORS -+}; -+ -+int sms_board_event(struct smscore_device_t *coredev, -+ enum SMS_BOARD_EVENTS gevent); -+ -+int sms_board_setup(struct smscore_device_t *coredev); -+ -+#define SMS_LED_OFF 0 -+#define SMS_LED_LO 1 -+#define SMS_LED_HI 2 -+int sms_board_led_feedback(struct smscore_device_t *coredev, int led); -+int sms_board_power(struct smscore_device_t *coredev, int onoff); -+int sms_board_lna_control(struct smscore_device_t *coredev, int onoff); -+ -+extern int sms_board_load_modules(int id); -+ -+#endif /* __SMS_CARDS_H__ */ -diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c -new file mode 100644 -index 0000000..1842e64 ---- /dev/null -+++ b/drivers/media/common/siano/smscoreapi.c -@@ -0,0 +1,1637 @@ -+/* -+ * Siano core API module -+ * -+ * This file contains implementation for the interface to sms core component -+ * -+ * author: Uri Shkolnik -+ * -+ * Copyright (c), 2005-2008 Siano Mobile Silicon, Inc. -+ * -+ * 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; -+ * -+ * Software distributed under the License is distributed on an "AS IS" -+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. -+ * -+ * See the GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include "smscoreapi.h" -+#include "sms-cards.h" -+#include "smsir.h" -+#include "smsendian.h" -+ -+static int sms_dbg; -+module_param_named(debug, sms_dbg, int, 0644); -+MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); -+ -+struct smscore_device_notifyee_t { -+ struct list_head entry; -+ hotplug_t hotplug; -+}; -+ -+struct smscore_idlist_t { -+ struct list_head entry; -+ int id; -+ int data_type; -+}; -+ -+struct smscore_client_t { -+ struct list_head entry; -+ struct smscore_device_t *coredev; -+ void *context; -+ struct list_head idlist; -+ onresponse_t onresponse_handler; -+ onremove_t onremove_handler; -+}; -+ -+void smscore_set_board_id(struct smscore_device_t *core, int id) -+{ -+ core->board_id = id; -+} -+ -+int smscore_led_state(struct smscore_device_t *core, int led) -+{ -+ if (led >= 0) -+ core->led_state = led; -+ return core->led_state; -+} -+EXPORT_SYMBOL_GPL(smscore_set_board_id); -+ -+int smscore_get_board_id(struct smscore_device_t *core) -+{ -+ return core->board_id; -+} -+EXPORT_SYMBOL_GPL(smscore_get_board_id); -+ -+struct smscore_registry_entry_t { -+ struct list_head entry; -+ char devpath[32]; -+ int mode; -+ enum sms_device_type_st type; -+}; -+ -+static struct list_head g_smscore_notifyees; -+static struct list_head g_smscore_devices; -+static struct mutex g_smscore_deviceslock; -+ -+static struct list_head g_smscore_registry; -+static struct mutex g_smscore_registrylock; -+ -+static int default_mode = 4; -+ -+module_param(default_mode, int, 0644); -+MODULE_PARM_DESC(default_mode, "default firmware id (device mode)"); -+ -+static struct smscore_registry_entry_t *smscore_find_registry(char *devpath) -+{ -+ struct smscore_registry_entry_t *entry; -+ struct list_head *next; -+ -+ kmutex_lock(&g_smscore_registrylock); -+ for (next = g_smscore_registry.next; -+ next != &g_smscore_registry; -+ next = next->next) { -+ entry = (struct smscore_registry_entry_t *) next; -+ if (!strcmp(entry->devpath, devpath)) { -+ kmutex_unlock(&g_smscore_registrylock); -+ return entry; -+ } -+ } -+ entry = kmalloc(sizeof(struct smscore_registry_entry_t), GFP_KERNEL); -+ if (entry) { -+ entry->mode = default_mode; -+ strcpy(entry->devpath, devpath); -+ list_add(&entry->entry, &g_smscore_registry); -+ } else -+ sms_err("failed to create smscore_registry."); -+ kmutex_unlock(&g_smscore_registrylock); -+ return entry; -+} -+ -+int smscore_registry_getmode(char *devpath) -+{ -+ struct smscore_registry_entry_t *entry; -+ -+ entry = smscore_find_registry(devpath); -+ if (entry) -+ return entry->mode; -+ else -+ sms_err("No registry found."); -+ -+ return default_mode; -+} -+EXPORT_SYMBOL_GPL(smscore_registry_getmode); -+ -+static enum sms_device_type_st smscore_registry_gettype(char *devpath) -+{ -+ struct smscore_registry_entry_t *entry; -+ -+ entry = smscore_find_registry(devpath); -+ if (entry) -+ return entry->type; -+ else -+ sms_err("No registry found."); -+ -+ return -1; -+} -+ -+void smscore_registry_setmode(char *devpath, int mode) -+{ -+ struct smscore_registry_entry_t *entry; -+ -+ entry = smscore_find_registry(devpath); -+ if (entry) -+ entry->mode = mode; -+ else -+ sms_err("No registry found."); -+} -+ -+static void smscore_registry_settype(char *devpath, -+ enum sms_device_type_st type) -+{ -+ struct smscore_registry_entry_t *entry; -+ -+ entry = smscore_find_registry(devpath); -+ if (entry) -+ entry->type = type; -+ else -+ sms_err("No registry found."); -+} -+ -+ -+static void list_add_locked(struct list_head *new, struct list_head *head, -+ spinlock_t *lock) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(lock, flags); -+ -+ list_add(new, head); -+ -+ spin_unlock_irqrestore(lock, flags); -+} -+ -+/** -+ * register a client callback that called when device plugged in/unplugged -+ * NOTE: if devices exist callback is called immediately for each device -+ * -+ * @param hotplug callback -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smscore_register_hotplug(hotplug_t hotplug) -+{ -+ struct smscore_device_notifyee_t *notifyee; -+ struct list_head *next, *first; -+ int rc = 0; -+ -+ kmutex_lock(&g_smscore_deviceslock); -+ -+ notifyee = kmalloc(sizeof(struct smscore_device_notifyee_t), -+ GFP_KERNEL); -+ if (notifyee) { -+ /* now notify callback about existing devices */ -+ first = &g_smscore_devices; -+ for (next = first->next; -+ next != first && !rc; -+ next = next->next) { -+ struct smscore_device_t *coredev = -+ (struct smscore_device_t *) next; -+ rc = hotplug(coredev, coredev->device, 1); -+ } -+ -+ if (rc >= 0) { -+ notifyee->hotplug = hotplug; -+ list_add(¬ifyee->entry, &g_smscore_notifyees); -+ } else -+ kfree(notifyee); -+ } else -+ rc = -ENOMEM; -+ -+ kmutex_unlock(&g_smscore_deviceslock); -+ -+ return rc; -+} -+EXPORT_SYMBOL_GPL(smscore_register_hotplug); -+ -+/** -+ * unregister a client callback that called when device plugged in/unplugged -+ * -+ * @param hotplug callback -+ * -+ */ -+void smscore_unregister_hotplug(hotplug_t hotplug) -+{ -+ struct list_head *next, *first; -+ -+ kmutex_lock(&g_smscore_deviceslock); -+ -+ first = &g_smscore_notifyees; -+ -+ for (next = first->next; next != first;) { -+ struct smscore_device_notifyee_t *notifyee = -+ (struct smscore_device_notifyee_t *) next; -+ next = next->next; -+ -+ if (notifyee->hotplug == hotplug) { -+ list_del(¬ifyee->entry); -+ kfree(notifyee); -+ } -+ } -+ -+ kmutex_unlock(&g_smscore_deviceslock); -+} -+EXPORT_SYMBOL_GPL(smscore_unregister_hotplug); -+ -+static void smscore_notify_clients(struct smscore_device_t *coredev) -+{ -+ struct smscore_client_t *client; -+ -+ /* the client must call smscore_unregister_client from remove handler */ -+ while (!list_empty(&coredev->clients)) { -+ client = (struct smscore_client_t *) coredev->clients.next; -+ client->onremove_handler(client->context); -+ } -+} -+ -+static int smscore_notify_callbacks(struct smscore_device_t *coredev, -+ struct device *device, int arrival) -+{ -+ struct smscore_device_notifyee_t *elem; -+ int rc = 0; -+ -+ /* note: must be called under g_deviceslock */ -+ -+ list_for_each_entry(elem, &g_smscore_notifyees, entry) { -+ rc = elem->hotplug(coredev, device, arrival); -+ if (rc < 0) -+ break; -+ } -+ -+ return rc; -+} -+ -+static struct -+smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer, -+ dma_addr_t common_buffer_phys) -+{ -+ struct smscore_buffer_t *cb = -+ kmalloc(sizeof(struct smscore_buffer_t), GFP_KERNEL); -+ if (!cb) { -+ sms_info("kmalloc(...) failed"); -+ return NULL; -+ } -+ -+ cb->p = buffer; -+ cb->offset_in_common = buffer - (u8 *) common_buffer; -+ cb->phys = common_buffer_phys + cb->offset_in_common; -+ -+ return cb; -+} -+ -+/** -+ * creates coredev object for a device, prepares buffers, -+ * creates buffer mappings, notifies registered hotplugs about new device. -+ * -+ * @param params device pointer to struct with device specific parameters -+ * and handlers -+ * @param coredev pointer to a value that receives created coredev object -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smscore_register_device(struct smsdevice_params_t *params, -+ struct smscore_device_t **coredev) -+{ -+ struct smscore_device_t *dev; -+ u8 *buffer; -+ -+ dev = kzalloc(sizeof(struct smscore_device_t), GFP_KERNEL); -+ if (!dev) { -+ sms_info("kzalloc(...) failed"); -+ return -ENOMEM; -+ } -+ -+ /* init list entry so it could be safe in smscore_unregister_device */ -+ INIT_LIST_HEAD(&dev->entry); -+ -+ /* init queues */ -+ INIT_LIST_HEAD(&dev->clients); -+ INIT_LIST_HEAD(&dev->buffers); -+ -+ /* init locks */ -+ spin_lock_init(&dev->clientslock); -+ spin_lock_init(&dev->bufferslock); -+ -+ /* init completion events */ -+ init_completion(&dev->version_ex_done); -+ init_completion(&dev->data_download_done); -+ init_completion(&dev->trigger_done); -+ init_completion(&dev->init_device_done); -+ init_completion(&dev->reload_start_done); -+ init_completion(&dev->resume_done); -+ init_completion(&dev->gpio_configuration_done); -+ init_completion(&dev->gpio_set_level_done); -+ init_completion(&dev->gpio_get_level_done); -+ init_completion(&dev->ir_init_done); -+ -+ /* Buffer management */ -+ init_waitqueue_head(&dev->buffer_mng_waitq); -+ -+ /* alloc common buffer */ -+ dev->common_buffer_size = params->buffer_size * params->num_buffers; -+ dev->common_buffer = dma_alloc_coherent(NULL, dev->common_buffer_size, -+ &dev->common_buffer_phys, -+ GFP_KERNEL | GFP_DMA); -+ if (!dev->common_buffer) { -+ smscore_unregister_device(dev); -+ return -ENOMEM; -+ } -+ -+ /* prepare dma buffers */ -+ for (buffer = dev->common_buffer; -+ dev->num_buffers < params->num_buffers; -+ dev->num_buffers++, buffer += params->buffer_size) { -+ struct smscore_buffer_t *cb = -+ smscore_createbuffer(buffer, dev->common_buffer, -+ dev->common_buffer_phys); -+ if (!cb) { -+ smscore_unregister_device(dev); -+ return -ENOMEM; -+ } -+ -+ smscore_putbuffer(dev, cb); -+ } -+ -+ sms_info("allocated %d buffers", dev->num_buffers); -+ -+ dev->mode = DEVICE_MODE_NONE; -+ dev->context = params->context; -+ dev->device = params->device; -+ dev->setmode_handler = params->setmode_handler; -+ dev->detectmode_handler = params->detectmode_handler; -+ dev->sendrequest_handler = params->sendrequest_handler; -+ dev->preload_handler = params->preload_handler; -+ dev->postload_handler = params->postload_handler; -+ -+ dev->device_flags = params->flags; -+ strcpy(dev->devpath, params->devpath); -+ -+ smscore_registry_settype(dev->devpath, params->device_type); -+ -+ /* add device to devices list */ -+ kmutex_lock(&g_smscore_deviceslock); -+ list_add(&dev->entry, &g_smscore_devices); -+ kmutex_unlock(&g_smscore_deviceslock); -+ -+ *coredev = dev; -+ -+ sms_info("device %p created", dev); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(smscore_register_device); -+ -+ -+static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, -+ void *buffer, size_t size, struct completion *completion) { -+ int rc = coredev->sendrequest_handler(coredev->context, buffer, size); -+ if (rc < 0) { -+ sms_info("sendrequest returned error %d", rc); -+ return rc; -+ } -+ -+ return wait_for_completion_timeout(completion, -+ msecs_to_jiffies(SMS_PROTOCOL_MAX_RAOUNDTRIP_MS)) ? -+ 0 : -ETIME; -+} -+ -+/** -+ * Starts & enables IR operations -+ * -+ * @return 0 on success, < 0 on error. -+ */ -+static int smscore_init_ir(struct smscore_device_t *coredev) -+{ -+ int ir_io; -+ int rc; -+ void *buffer; -+ -+ coredev->ir.dev = NULL; -+ ir_io = sms_get_board(smscore_get_board_id(coredev))->board_cfg.ir; -+ if (ir_io) {/* only if IR port exist we use IR sub-module */ -+ sms_info("IR loading"); -+ rc = sms_ir_init(coredev); -+ -+ if (rc != 0) -+ sms_err("Error initialization DTV IR sub-module"); -+ else { -+ buffer = kmalloc(sizeof(struct SmsMsgData_ST2) + -+ SMS_DMA_ALIGNMENT, -+ GFP_KERNEL | GFP_DMA); -+ if (buffer) { -+ struct SmsMsgData_ST2 *msg = -+ (struct SmsMsgData_ST2 *) -+ SMS_ALIGN_ADDRESS(buffer); -+ -+ SMS_INIT_MSG(&msg->xMsgHeader, -+ MSG_SMS_START_IR_REQ, -+ sizeof(struct SmsMsgData_ST2)); -+ msg->msgData[0] = coredev->ir.controller; -+ msg->msgData[1] = coredev->ir.timeout; -+ -+ smsendian_handle_tx_message( -+ (struct SmsMsgHdr_ST2 *)msg); -+ rc = smscore_sendrequest_and_wait(coredev, msg, -+ msg->xMsgHeader. msgLength, -+ &coredev->ir_init_done); -+ -+ kfree(buffer); -+ } else -+ sms_err -+ ("Sending IR initialization message failed"); -+ } -+ } else -+ sms_info("IR port has not been detected"); -+ -+ return 0; -+} -+ -+/** -+ * sets initial device mode and notifies client hotplugs that device is ready -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smscore_start_device(struct smscore_device_t *coredev) -+{ -+ int rc = smscore_set_device_mode( -+ coredev, smscore_registry_getmode(coredev->devpath)); -+ if (rc < 0) { -+ sms_info("set device mode faile , rc %d", rc); -+ return rc; -+ } -+ -+ kmutex_lock(&g_smscore_deviceslock); -+ -+ rc = smscore_notify_callbacks(coredev, coredev->device, 1); -+ smscore_init_ir(coredev); -+ -+ sms_info("device %p started, rc %d", coredev, rc); -+ -+ kmutex_unlock(&g_smscore_deviceslock); -+ -+ return rc; -+} -+EXPORT_SYMBOL_GPL(smscore_start_device); -+ -+ -+static int smscore_load_firmware_family2(struct smscore_device_t *coredev, -+ void *buffer, size_t size) -+{ -+ struct SmsFirmware_ST *firmware = (struct SmsFirmware_ST *) buffer; -+ struct SmsMsgHdr_ST *msg; -+ u32 mem_address; -+ u8 *payload = firmware->Payload; -+ int rc = 0; -+ firmware->StartAddress = le32_to_cpu(firmware->StartAddress); -+ firmware->Length = le32_to_cpu(firmware->Length); -+ -+ mem_address = firmware->StartAddress; -+ -+ sms_info("loading FW to addr 0x%x size %d", -+ mem_address, firmware->Length); -+ if (coredev->preload_handler) { -+ rc = coredev->preload_handler(coredev->context); -+ if (rc < 0) -+ return rc; -+ } -+ -+ /* PAGE_SIZE buffer shall be enough and dma aligned */ -+ msg = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA); -+ if (!msg) -+ return -ENOMEM; -+ -+ if (coredev->mode != DEVICE_MODE_NONE) { -+ sms_debug("sending reload command."); -+ SMS_INIT_MSG(msg, MSG_SW_RELOAD_START_REQ, -+ sizeof(struct SmsMsgHdr_ST)); -+ rc = smscore_sendrequest_and_wait(coredev, msg, -+ msg->msgLength, -+ &coredev->reload_start_done); -+ mem_address = *(u32 *) &payload[20]; -+ } -+ -+ while (size && rc >= 0) { -+ struct SmsDataDownload_ST *DataMsg = -+ (struct SmsDataDownload_ST *) msg; -+ int payload_size = min((int) size, SMS_MAX_PAYLOAD_SIZE); -+ -+ SMS_INIT_MSG(msg, MSG_SMS_DATA_DOWNLOAD_REQ, -+ (u16)(sizeof(struct SmsMsgHdr_ST) + -+ sizeof(u32) + payload_size)); -+ -+ DataMsg->MemAddr = mem_address; -+ memcpy(DataMsg->Payload, payload, payload_size); -+ -+ if ((coredev->device_flags & SMS_ROM_NO_RESPONSE) && -+ (coredev->mode == DEVICE_MODE_NONE)) -+ rc = coredev->sendrequest_handler( -+ coredev->context, DataMsg, -+ DataMsg->xMsgHeader.msgLength); -+ else -+ rc = smscore_sendrequest_and_wait( -+ coredev, DataMsg, -+ DataMsg->xMsgHeader.msgLength, -+ &coredev->data_download_done); -+ -+ payload += payload_size; -+ size -= payload_size; -+ mem_address += payload_size; -+ } -+ -+ if (rc >= 0) { -+ if (coredev->mode == DEVICE_MODE_NONE) { -+ struct SmsMsgData_ST *TriggerMsg = -+ (struct SmsMsgData_ST *) msg; -+ -+ SMS_INIT_MSG(msg, MSG_SMS_SWDOWNLOAD_TRIGGER_REQ, -+ sizeof(struct SmsMsgHdr_ST) + -+ sizeof(u32) * 5); -+ -+ TriggerMsg->msgData[0] = firmware->StartAddress; -+ /* Entry point */ -+ TriggerMsg->msgData[1] = 5; /* Priority */ -+ TriggerMsg->msgData[2] = 0x200; /* Stack size */ -+ TriggerMsg->msgData[3] = 0; /* Parameter */ -+ TriggerMsg->msgData[4] = 4; /* Task ID */ -+ -+ if (coredev->device_flags & SMS_ROM_NO_RESPONSE) { -+ rc = coredev->sendrequest_handler( -+ coredev->context, TriggerMsg, -+ TriggerMsg->xMsgHeader.msgLength); -+ msleep(100); -+ } else -+ rc = smscore_sendrequest_and_wait( -+ coredev, TriggerMsg, -+ TriggerMsg->xMsgHeader.msgLength, -+ &coredev->trigger_done); -+ } else { -+ SMS_INIT_MSG(msg, MSG_SW_RELOAD_EXEC_REQ, -+ sizeof(struct SmsMsgHdr_ST)); -+ -+ rc = coredev->sendrequest_handler(coredev->context, -+ msg, msg->msgLength); -+ } -+ msleep(500); -+ } -+ -+ sms_debug("rc=%d, postload=%p ", rc, -+ coredev->postload_handler); -+ -+ kfree(msg); -+ -+ return ((rc >= 0) && coredev->postload_handler) ? -+ coredev->postload_handler(coredev->context) : -+ rc; -+} -+ -+/** -+ * loads specified firmware into a buffer and calls device loadfirmware_handler -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * @param filename null-terminated string specifies firmware file name -+ * @param loadfirmware_handler device handler that loads firmware -+ * -+ * @return 0 on success, <0 on error. -+ */ -+static int smscore_load_firmware_from_file(struct smscore_device_t *coredev, -+ char *filename, -+ loadfirmware_t loadfirmware_handler) -+{ -+ int rc = -ENOENT; -+ const struct firmware *fw; -+ u8 *fw_buffer; -+ -+ if (loadfirmware_handler == NULL && !(coredev->device_flags & -+ SMS_DEVICE_FAMILY2)) -+ return -EINVAL; -+ -+ rc = request_firmware(&fw, filename, coredev->device); -+ if (rc < 0) { -+ sms_info("failed to open \"%s\"", filename); -+ return rc; -+ } -+ sms_info("read FW %s, size=%zd", filename, fw->size); -+ fw_buffer = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT), -+ GFP_KERNEL | GFP_DMA); -+ if (fw_buffer) { -+ memcpy(fw_buffer, fw->data, fw->size); -+ -+ rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ? -+ smscore_load_firmware_family2(coredev, -+ fw_buffer, -+ fw->size) : -+ loadfirmware_handler(coredev->context, -+ fw_buffer, fw->size); -+ -+ kfree(fw_buffer); -+ } else { -+ sms_info("failed to allocate firmware buffer"); -+ rc = -ENOMEM; -+ } -+ -+ release_firmware(fw); -+ -+ return rc; -+} -+ -+/** -+ * notifies all clients registered with the device, notifies hotplugs, -+ * frees all buffers and coredev object -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * -+ * @return 0 on success, <0 on error. -+ */ -+void smscore_unregister_device(struct smscore_device_t *coredev) -+{ -+ struct smscore_buffer_t *cb; -+ int num_buffers = 0; -+ int retry = 0; -+ -+ kmutex_lock(&g_smscore_deviceslock); -+ -+ /* Release input device (IR) resources */ -+ sms_ir_exit(coredev); -+ -+ smscore_notify_clients(coredev); -+ smscore_notify_callbacks(coredev, NULL, 0); -+ -+ /* at this point all buffers should be back -+ * onresponse must no longer be called */ -+ -+ while (1) { -+ while (!list_empty(&coredev->buffers)) { -+ cb = (struct smscore_buffer_t *) coredev->buffers.next; -+ list_del(&cb->entry); -+ kfree(cb); -+ num_buffers++; -+ } -+ if (num_buffers == coredev->num_buffers) -+ break; -+ if (++retry > 10) { -+ sms_info("exiting although " -+ "not all buffers released."); -+ break; -+ } -+ -+ sms_info("waiting for %d buffer(s)", -+ coredev->num_buffers - num_buffers); -+ msleep(100); -+ } -+ -+ sms_info("freed %d buffers", num_buffers); -+ -+ if (coredev->common_buffer) -+ dma_free_coherent(NULL, coredev->common_buffer_size, -+ coredev->common_buffer, coredev->common_buffer_phys); -+ -+ if (coredev->fw_buf != NULL) -+ kfree(coredev->fw_buf); -+ -+ list_del(&coredev->entry); -+ kfree(coredev); -+ -+ kmutex_unlock(&g_smscore_deviceslock); -+ -+ sms_info("device %p destroyed", coredev); -+} -+EXPORT_SYMBOL_GPL(smscore_unregister_device); -+ -+static int smscore_detect_mode(struct smscore_device_t *coredev) -+{ -+ void *buffer = kmalloc(sizeof(struct SmsMsgHdr_ST) + SMS_DMA_ALIGNMENT, -+ GFP_KERNEL | GFP_DMA); -+ struct SmsMsgHdr_ST *msg = -+ (struct SmsMsgHdr_ST *) SMS_ALIGN_ADDRESS(buffer); -+ int rc; -+ -+ if (!buffer) -+ return -ENOMEM; -+ -+ SMS_INIT_MSG(msg, MSG_SMS_GET_VERSION_EX_REQ, -+ sizeof(struct SmsMsgHdr_ST)); -+ -+ rc = smscore_sendrequest_and_wait(coredev, msg, msg->msgLength, -+ &coredev->version_ex_done); -+ if (rc == -ETIME) { -+ sms_err("MSG_SMS_GET_VERSION_EX_REQ failed first try"); -+ -+ if (wait_for_completion_timeout(&coredev->resume_done, -+ msecs_to_jiffies(5000))) { -+ rc = smscore_sendrequest_and_wait( -+ coredev, msg, msg->msgLength, -+ &coredev->version_ex_done); -+ if (rc < 0) -+ sms_err("MSG_SMS_GET_VERSION_EX_REQ failed " -+ "second try, rc %d", rc); -+ } else -+ rc = -ETIME; -+ } -+ -+ kfree(buffer); -+ -+ return rc; -+} -+ -+static char *smscore_fw_lkup[][SMS_NUM_OF_DEVICE_TYPES] = { -+ /*Stellar NOVA A0 Nova B0 VEGA*/ -+ /*DVBT*/ -+ {"none", "dvb_nova_12mhz.inp", "dvb_nova_12mhz_b0.inp", "none"}, -+ /*DVBH*/ -+ {"none", "dvb_nova_12mhz.inp", "dvb_nova_12mhz_b0.inp", "none"}, -+ /*TDMB*/ -+ {"none", "tdmb_nova_12mhz.inp", "tdmb_nova_12mhz_b0.inp", "none"}, -+ /*DABIP*/ -+ {"none", "none", "none", "none"}, -+ /*BDA*/ -+ {"none", "dvb_nova_12mhz.inp", "dvb_nova_12mhz_b0.inp", "none"}, -+ /*ISDBT*/ -+ {"none", "isdbt_nova_12mhz.inp", "isdbt_nova_12mhz_b0.inp", "none"}, -+ /*ISDBTBDA*/ -+ {"none", "isdbt_nova_12mhz.inp", "isdbt_nova_12mhz_b0.inp", "none"}, -+ /*CMMB*/ -+ {"none", "none", "none", "cmmb_vega_12mhz.inp"} -+}; -+ -+static inline char *sms_get_fw_name(struct smscore_device_t *coredev, -+ int mode, enum sms_device_type_st type) -+{ -+ char **fw = sms_get_board(smscore_get_board_id(coredev))->fw; -+ return (fw && fw[mode]) ? fw[mode] : smscore_fw_lkup[mode][type]; -+} -+ -+/** -+ * calls device handler to change mode of operation -+ * NOTE: stellar/usb may disconnect when changing mode -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * @param mode requested mode of operation -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smscore_set_device_mode(struct smscore_device_t *coredev, int mode) -+{ -+ void *buffer; -+ int rc = 0; -+ enum sms_device_type_st type; -+ -+ sms_debug("set device mode to %d", mode); -+ if (coredev->device_flags & SMS_DEVICE_FAMILY2) { -+ if (mode < DEVICE_MODE_DVBT || mode >= DEVICE_MODE_RAW_TUNER) { -+ sms_err("invalid mode specified %d", mode); -+ return -EINVAL; -+ } -+ -+ smscore_registry_setmode(coredev->devpath, mode); -+ -+ if (!(coredev->device_flags & SMS_DEVICE_NOT_READY)) { -+ rc = smscore_detect_mode(coredev); -+ if (rc < 0) { -+ sms_err("mode detect failed %d", rc); -+ return rc; -+ } -+ } -+ -+ if (coredev->mode == mode) { -+ sms_info("device mode %d already set", mode); -+ return 0; -+ } -+ -+ if (!(coredev->modes_supported & (1 << mode))) { -+ char *fw_filename; -+ -+ type = smscore_registry_gettype(coredev->devpath); -+ fw_filename = sms_get_fw_name(coredev, mode, type); -+ -+ rc = smscore_load_firmware_from_file(coredev, -+ fw_filename, NULL); -+ if (rc < 0) { -+ sms_warn("error %d loading firmware: %s, " -+ "trying again with default firmware", -+ rc, fw_filename); -+ -+ /* try again with the default firmware */ -+ fw_filename = smscore_fw_lkup[mode][type]; -+ rc = smscore_load_firmware_from_file(coredev, -+ fw_filename, NULL); -+ -+ if (rc < 0) { -+ sms_warn("error %d loading " -+ "firmware: %s", rc, -+ fw_filename); -+ return rc; -+ } -+ } -+ sms_log("firmware download success: %s", fw_filename); -+ } else -+ sms_info("mode %d supported by running " -+ "firmware", mode); -+ -+ buffer = kmalloc(sizeof(struct SmsMsgData_ST) + -+ SMS_DMA_ALIGNMENT, GFP_KERNEL | GFP_DMA); -+ if (buffer) { -+ struct SmsMsgData_ST *msg = -+ (struct SmsMsgData_ST *) -+ SMS_ALIGN_ADDRESS(buffer); -+ -+ SMS_INIT_MSG(&msg->xMsgHeader, MSG_SMS_INIT_DEVICE_REQ, -+ sizeof(struct SmsMsgData_ST)); -+ msg->msgData[0] = mode; -+ -+ rc = smscore_sendrequest_and_wait( -+ coredev, msg, msg->xMsgHeader.msgLength, -+ &coredev->init_device_done); -+ -+ kfree(buffer); -+ } else { -+ sms_err("Could not allocate buffer for " -+ "init device message."); -+ rc = -ENOMEM; -+ } -+ } else { -+ if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) { -+ sms_err("invalid mode specified %d", mode); -+ return -EINVAL; -+ } -+ -+ smscore_registry_setmode(coredev->devpath, mode); -+ -+ if (coredev->detectmode_handler) -+ coredev->detectmode_handler(coredev->context, -+ &coredev->mode); -+ -+ if (coredev->mode != mode && coredev->setmode_handler) -+ rc = coredev->setmode_handler(coredev->context, mode); -+ } -+ -+ if (rc >= 0) { -+ coredev->mode = mode; -+ coredev->device_flags &= ~SMS_DEVICE_NOT_READY; -+ } -+ -+ if (rc < 0) -+ sms_err("return error code %d.", rc); -+ return rc; -+} -+ -+/** -+ * calls device handler to get current mode of operation -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * -+ * @return current mode -+ */ -+int smscore_get_device_mode(struct smscore_device_t *coredev) -+{ -+ return coredev->mode; -+} -+EXPORT_SYMBOL_GPL(smscore_get_device_mode); -+ -+/** -+ * find client by response id & type within the clients list. -+ * return client handle or NULL. -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * @param data_type client data type (SMS_DONT_CARE for all types) -+ * @param id client id (SMS_DONT_CARE for all id) -+ * -+ */ -+static struct -+smscore_client_t *smscore_find_client(struct smscore_device_t *coredev, -+ int data_type, int id) -+{ -+ struct list_head *first; -+ struct smscore_client_t *client; -+ unsigned long flags; -+ struct list_head *firstid; -+ struct smscore_idlist_t *client_id; -+ -+ spin_lock_irqsave(&coredev->clientslock, flags); -+ first = &coredev->clients; -+ list_for_each_entry(client, first, entry) { -+ firstid = &client->idlist; -+ list_for_each_entry(client_id, firstid, entry) { -+ if ((client_id->id == id) && -+ (client_id->data_type == data_type || -+ (client_id->data_type == 0))) -+ goto found; -+ } -+ } -+ client = NULL; -+found: -+ spin_unlock_irqrestore(&coredev->clientslock, flags); -+ return client; -+} -+ -+/** -+ * find client by response id/type, call clients onresponse handler -+ * return buffer to pool on error -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * @param cb pointer to response buffer descriptor -+ * -+ */ -+void smscore_onresponse(struct smscore_device_t *coredev, -+ struct smscore_buffer_t *cb) { -+ struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) ((u8 *) cb->p -+ + cb->offset); -+ struct smscore_client_t *client; -+ int rc = -EBUSY; -+ static unsigned long last_sample_time; /* = 0; */ -+ static int data_total; /* = 0; */ -+ unsigned long time_now = jiffies_to_msecs(jiffies); -+ -+ if (!last_sample_time) -+ last_sample_time = time_now; -+ -+ if (time_now - last_sample_time > 10000) { -+ sms_debug("\ndata rate %d bytes/secs", -+ (int)((data_total * 1000) / -+ (time_now - last_sample_time))); -+ -+ last_sample_time = time_now; -+ data_total = 0; -+ } -+ -+ data_total += cb->size; -+ /* Do we need to re-route? */ -+ if ((phdr->msgType == MSG_SMS_HO_PER_SLICES_IND) || -+ (phdr->msgType == MSG_SMS_TRANSMISSION_IND)) { -+ if (coredev->mode == DEVICE_MODE_DVBT_BDA) -+ phdr->msgDstId = DVBT_BDA_CONTROL_MSG_ID; -+ } -+ -+ -+ client = smscore_find_client(coredev, phdr->msgType, phdr->msgDstId); -+ -+ /* If no client registered for type & id, -+ * check for control client where type is not registered */ -+ if (client) -+ rc = client->onresponse_handler(client->context, cb); -+ -+ if (rc < 0) { -+ switch (phdr->msgType) { -+ case MSG_SMS_GET_VERSION_EX_RES: -+ { -+ struct SmsVersionRes_ST *ver = -+ (struct SmsVersionRes_ST *) phdr; -+ sms_debug("MSG_SMS_GET_VERSION_EX_RES " -+ "id %d prots 0x%x ver %d.%d", -+ ver->FirmwareId, ver->SupportedProtocols, -+ ver->RomVersionMajor, ver->RomVersionMinor); -+ -+ coredev->mode = ver->FirmwareId == 255 ? -+ DEVICE_MODE_NONE : ver->FirmwareId; -+ coredev->modes_supported = ver->SupportedProtocols; -+ -+ complete(&coredev->version_ex_done); -+ break; -+ } -+ case MSG_SMS_INIT_DEVICE_RES: -+ sms_debug("MSG_SMS_INIT_DEVICE_RES"); -+ complete(&coredev->init_device_done); -+ break; -+ case MSG_SW_RELOAD_START_RES: -+ sms_debug("MSG_SW_RELOAD_START_RES"); -+ complete(&coredev->reload_start_done); -+ break; -+ case MSG_SMS_DATA_DOWNLOAD_RES: -+ complete(&coredev->data_download_done); -+ break; -+ case MSG_SW_RELOAD_EXEC_RES: -+ sms_debug("MSG_SW_RELOAD_EXEC_RES"); -+ break; -+ case MSG_SMS_SWDOWNLOAD_TRIGGER_RES: -+ sms_debug("MSG_SMS_SWDOWNLOAD_TRIGGER_RES"); -+ complete(&coredev->trigger_done); -+ break; -+ case MSG_SMS_SLEEP_RESUME_COMP_IND: -+ complete(&coredev->resume_done); -+ break; -+ case MSG_SMS_GPIO_CONFIG_EX_RES: -+ sms_debug("MSG_SMS_GPIO_CONFIG_EX_RES"); -+ complete(&coredev->gpio_configuration_done); -+ break; -+ case MSG_SMS_GPIO_SET_LEVEL_RES: -+ sms_debug("MSG_SMS_GPIO_SET_LEVEL_RES"); -+ complete(&coredev->gpio_set_level_done); -+ break; -+ case MSG_SMS_GPIO_GET_LEVEL_RES: -+ { -+ u32 *msgdata = (u32 *) phdr; -+ coredev->gpio_get_res = msgdata[1]; -+ sms_debug("MSG_SMS_GPIO_GET_LEVEL_RES gpio level %d", -+ coredev->gpio_get_res); -+ complete(&coredev->gpio_get_level_done); -+ break; -+ } -+ case MSG_SMS_START_IR_RES: -+ complete(&coredev->ir_init_done); -+ break; -+ case MSG_SMS_IR_SAMPLES_IND: -+ sms_ir_event(coredev, -+ (const char *) -+ ((char *)phdr -+ + sizeof(struct SmsMsgHdr_ST)), -+ (int)phdr->msgLength -+ - sizeof(struct SmsMsgHdr_ST)); -+ break; -+ -+ default: -+ break; -+ } -+ smscore_putbuffer(coredev, cb); -+ } -+} -+EXPORT_SYMBOL_GPL(smscore_onresponse); -+ -+/** -+ * return pointer to next free buffer descriptor from core pool -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * -+ * @return pointer to descriptor on success, NULL on error. -+ */ -+ -+static struct smscore_buffer_t *get_entry(struct smscore_device_t *coredev) -+{ -+ struct smscore_buffer_t *cb = NULL; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&coredev->bufferslock, flags); -+ if (!list_empty(&coredev->buffers)) { -+ cb = (struct smscore_buffer_t *) coredev->buffers.next; -+ list_del(&cb->entry); -+ } -+ spin_unlock_irqrestore(&coredev->bufferslock, flags); -+ return cb; -+} -+ -+struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) -+{ -+ struct smscore_buffer_t *cb = NULL; -+ -+ wait_event(coredev->buffer_mng_waitq, (cb = get_entry(coredev))); -+ -+ return cb; -+} -+EXPORT_SYMBOL_GPL(smscore_getbuffer); -+ -+/** -+ * return buffer descriptor to a pool -+ * -+ * @param coredev pointer to a coredev object returned by -+ * smscore_register_device -+ * @param cb pointer buffer descriptor -+ * -+ */ -+void smscore_putbuffer(struct smscore_device_t *coredev, -+ struct smscore_buffer_t *cb) { -+ wake_up_interruptible(&coredev->buffer_mng_waitq); -+ list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock); -+} -+EXPORT_SYMBOL_GPL(smscore_putbuffer); -+ -+static int smscore_validate_client(struct smscore_device_t *coredev, -+ struct smscore_client_t *client, -+ int data_type, int id) -+{ -+ struct smscore_idlist_t *listentry; -+ struct smscore_client_t *registered_client; -+ -+ if (!client) { -+ sms_err("bad parameter."); -+ return -EINVAL; -+ } -+ registered_client = smscore_find_client(coredev, data_type, id); -+ if (registered_client == client) -+ return 0; -+ -+ if (registered_client) { -+ sms_err("The msg ID already registered to another client."); -+ return -EEXIST; -+ } -+ listentry = kzalloc(sizeof(struct smscore_idlist_t), GFP_KERNEL); -+ if (!listentry) { -+ sms_err("Can't allocate memory for client id."); -+ return -ENOMEM; -+ } -+ listentry->id = id; -+ listentry->data_type = data_type; -+ list_add_locked(&listentry->entry, &client->idlist, -+ &coredev->clientslock); -+ return 0; -+} -+ -+/** -+ * creates smsclient object, check that id is taken by another client -+ * -+ * @param coredev pointer to a coredev object from clients hotplug -+ * @param initial_id all messages with this id would be sent to this client -+ * @param data_type all messages of this type would be sent to this client -+ * @param onresponse_handler client handler that is called to -+ * process incoming messages -+ * @param onremove_handler client handler that is called when device is removed -+ * @param context client-specific context -+ * @param client pointer to a value that receives created smsclient object -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smscore_register_client(struct smscore_device_t *coredev, -+ struct smsclient_params_t *params, -+ struct smscore_client_t **client) -+{ -+ struct smscore_client_t *newclient; -+ /* check that no other channel with same parameters exists */ -+ if (smscore_find_client(coredev, params->data_type, -+ params->initial_id)) { -+ sms_err("Client already exist."); -+ return -EEXIST; -+ } -+ -+ newclient = kzalloc(sizeof(struct smscore_client_t), GFP_KERNEL); -+ if (!newclient) { -+ sms_err("Failed to allocate memory for client."); -+ return -ENOMEM; -+ } -+ -+ INIT_LIST_HEAD(&newclient->idlist); -+ newclient->coredev = coredev; -+ newclient->onresponse_handler = params->onresponse_handler; -+ newclient->onremove_handler = params->onremove_handler; -+ newclient->context = params->context; -+ list_add_locked(&newclient->entry, &coredev->clients, -+ &coredev->clientslock); -+ smscore_validate_client(coredev, newclient, params->data_type, -+ params->initial_id); -+ *client = newclient; -+ sms_debug("%p %d %d", params->context, params->data_type, -+ params->initial_id); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(smscore_register_client); -+ -+/** -+ * frees smsclient object and all subclients associated with it -+ * -+ * @param client pointer to smsclient object returned by -+ * smscore_register_client -+ * -+ */ -+void smscore_unregister_client(struct smscore_client_t *client) -+{ -+ struct smscore_device_t *coredev = client->coredev; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&coredev->clientslock, flags); -+ -+ -+ while (!list_empty(&client->idlist)) { -+ struct smscore_idlist_t *identry = -+ (struct smscore_idlist_t *) client->idlist.next; -+ list_del(&identry->entry); -+ kfree(identry); -+ } -+ -+ sms_info("%p", client->context); -+ -+ list_del(&client->entry); -+ kfree(client); -+ -+ spin_unlock_irqrestore(&coredev->clientslock, flags); -+} -+EXPORT_SYMBOL_GPL(smscore_unregister_client); -+ -+/** -+ * verifies that source id is not taken by another client, -+ * calls device handler to send requests to the device -+ * -+ * @param client pointer to smsclient object returned by -+ * smscore_register_client -+ * @param buffer pointer to a request buffer -+ * @param size size (in bytes) of request buffer -+ * -+ * @return 0 on success, <0 on error. -+ */ -+int smsclient_sendrequest(struct smscore_client_t *client, -+ void *buffer, size_t size) -+{ -+ struct smscore_device_t *coredev; -+ struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) buffer; -+ int rc; -+ -+ if (client == NULL) { -+ sms_err("Got NULL client"); -+ return -EINVAL; -+ } -+ -+ coredev = client->coredev; -+ -+ /* check that no other channel with same id exists */ -+ if (coredev == NULL) { -+ sms_err("Got NULL coredev"); -+ return -EINVAL; -+ } -+ -+ rc = smscore_validate_client(client->coredev, client, 0, -+ phdr->msgSrcId); -+ if (rc < 0) -+ return rc; -+ -+ return coredev->sendrequest_handler(coredev->context, buffer, size); -+} -+EXPORT_SYMBOL_GPL(smsclient_sendrequest); -+ -+ -+/* old GPIO managements implementation */ -+int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, -+ struct smscore_config_gpio *pinconfig) -+{ -+ struct { -+ struct SmsMsgHdr_ST hdr; -+ u32 data[6]; -+ } msg; -+ -+ if (coredev->device_flags & SMS_DEVICE_FAMILY2) { -+ msg.hdr.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ msg.hdr.msgDstId = HIF_TASK; -+ msg.hdr.msgFlags = 0; -+ msg.hdr.msgType = MSG_SMS_GPIO_CONFIG_EX_REQ; -+ msg.hdr.msgLength = sizeof(msg); -+ -+ msg.data[0] = pin; -+ msg.data[1] = pinconfig->pullupdown; -+ -+ /* Convert slew rate for Nova: Fast(0) = 3 / Slow(1) = 0; */ -+ msg.data[2] = pinconfig->outputslewrate == 0 ? 3 : 0; -+ -+ switch (pinconfig->outputdriving) { -+ case SMS_GPIO_OUTPUTDRIVING_16mA: -+ msg.data[3] = 7; /* Nova - 16mA */ -+ break; -+ case SMS_GPIO_OUTPUTDRIVING_12mA: -+ msg.data[3] = 5; /* Nova - 11mA */ -+ break; -+ case SMS_GPIO_OUTPUTDRIVING_8mA: -+ msg.data[3] = 3; /* Nova - 7mA */ -+ break; -+ case SMS_GPIO_OUTPUTDRIVING_4mA: -+ default: -+ msg.data[3] = 2; /* Nova - 4mA */ -+ break; -+ } -+ -+ msg.data[4] = pinconfig->direction; -+ msg.data[5] = 0; -+ } else /* TODO: SMS_DEVICE_FAMILY1 */ -+ return -EINVAL; -+ -+ return coredev->sendrequest_handler(coredev->context, -+ &msg, sizeof(msg)); -+} -+ -+int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level) -+{ -+ struct { -+ struct SmsMsgHdr_ST hdr; -+ u32 data[3]; -+ } msg; -+ -+ if (pin > MAX_GPIO_PIN_NUMBER) -+ return -EINVAL; -+ -+ msg.hdr.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ msg.hdr.msgDstId = HIF_TASK; -+ msg.hdr.msgFlags = 0; -+ msg.hdr.msgType = MSG_SMS_GPIO_SET_LEVEL_REQ; -+ msg.hdr.msgLength = sizeof(msg); -+ -+ msg.data[0] = pin; -+ msg.data[1] = level ? 1 : 0; -+ msg.data[2] = 0; -+ -+ return coredev->sendrequest_handler(coredev->context, -+ &msg, sizeof(msg)); -+} -+ -+/* new GPIO management implementation */ -+static int GetGpioPinParams(u32 PinNum, u32 *pTranslatedPinNum, -+ u32 *pGroupNum, u32 *pGroupCfg) { -+ -+ *pGroupCfg = 1; -+ -+ if (PinNum <= 1) { -+ *pTranslatedPinNum = 0; -+ *pGroupNum = 9; -+ *pGroupCfg = 2; -+ } else if (PinNum >= 2 && PinNum <= 6) { -+ *pTranslatedPinNum = 2; -+ *pGroupNum = 0; -+ *pGroupCfg = 2; -+ } else if (PinNum >= 7 && PinNum <= 11) { -+ *pTranslatedPinNum = 7; -+ *pGroupNum = 1; -+ } else if (PinNum >= 12 && PinNum <= 15) { -+ *pTranslatedPinNum = 12; -+ *pGroupNum = 2; -+ *pGroupCfg = 3; -+ } else if (PinNum == 16) { -+ *pTranslatedPinNum = 16; -+ *pGroupNum = 23; -+ } else if (PinNum >= 17 && PinNum <= 24) { -+ *pTranslatedPinNum = 17; -+ *pGroupNum = 3; -+ } else if (PinNum == 25) { -+ *pTranslatedPinNum = 25; -+ *pGroupNum = 6; -+ } else if (PinNum >= 26 && PinNum <= 28) { -+ *pTranslatedPinNum = 26; -+ *pGroupNum = 4; -+ } else if (PinNum == 29) { -+ *pTranslatedPinNum = 29; -+ *pGroupNum = 5; -+ *pGroupCfg = 2; -+ } else if (PinNum == 30) { -+ *pTranslatedPinNum = 30; -+ *pGroupNum = 8; -+ } else if (PinNum == 31) { -+ *pTranslatedPinNum = 31; -+ *pGroupNum = 17; -+ } else -+ return -1; -+ -+ *pGroupCfg <<= 24; -+ -+ return 0; -+} -+ -+int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, -+ struct smscore_gpio_config *pGpioConfig) { -+ -+ u32 totalLen; -+ u32 TranslatedPinNum = 0; -+ u32 GroupNum = 0; -+ u32 ElectricChar; -+ u32 groupCfg; -+ void *buffer; -+ int rc; -+ -+ struct SetGpioMsg { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 msgData[6]; -+ } *pMsg; -+ -+ -+ if (PinNum > MAX_GPIO_PIN_NUMBER) -+ return -EINVAL; -+ -+ if (pGpioConfig == NULL) -+ return -EINVAL; -+ -+ totalLen = sizeof(struct SmsMsgHdr_ST) + (sizeof(u32) * 6); -+ -+ buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, -+ GFP_KERNEL | GFP_DMA); -+ if (!buffer) -+ return -ENOMEM; -+ -+ pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); -+ -+ pMsg->xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ pMsg->xMsgHeader.msgDstId = HIF_TASK; -+ pMsg->xMsgHeader.msgFlags = 0; -+ pMsg->xMsgHeader.msgLength = (u16) totalLen; -+ pMsg->msgData[0] = PinNum; -+ -+ if (!(coredev->device_flags & SMS_DEVICE_FAMILY2)) { -+ pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_REQ; -+ if (GetGpioPinParams(PinNum, &TranslatedPinNum, &GroupNum, -+ &groupCfg) != 0) { -+ rc = -EINVAL; -+ goto free; -+ } -+ -+ pMsg->msgData[1] = TranslatedPinNum; -+ pMsg->msgData[2] = GroupNum; -+ ElectricChar = (pGpioConfig->PullUpDown) -+ | (pGpioConfig->InputCharacteristics << 2) -+ | (pGpioConfig->OutputSlewRate << 3) -+ | (pGpioConfig->OutputDriving << 4); -+ pMsg->msgData[3] = ElectricChar; -+ pMsg->msgData[4] = pGpioConfig->Direction; -+ pMsg->msgData[5] = groupCfg; -+ } else { -+ pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_CONFIG_EX_REQ; -+ pMsg->msgData[1] = pGpioConfig->PullUpDown; -+ pMsg->msgData[2] = pGpioConfig->OutputSlewRate; -+ pMsg->msgData[3] = pGpioConfig->OutputDriving; -+ pMsg->msgData[4] = pGpioConfig->Direction; -+ pMsg->msgData[5] = 0; -+ } -+ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)pMsg); -+ rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, -+ &coredev->gpio_configuration_done); -+ -+ if (rc != 0) { -+ if (rc == -ETIME) -+ sms_err("smscore_gpio_configure timeout"); -+ else -+ sms_err("smscore_gpio_configure error"); -+ } -+free: -+ kfree(buffer); -+ -+ return rc; -+} -+ -+int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 PinNum, -+ u8 NewLevel) { -+ -+ u32 totalLen; -+ int rc; -+ void *buffer; -+ -+ struct SetGpioMsg { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 msgData[3]; /* keep it 3 ! */ -+ } *pMsg; -+ -+ if ((NewLevel > 1) || (PinNum > MAX_GPIO_PIN_NUMBER)) -+ return -EINVAL; -+ -+ totalLen = sizeof(struct SmsMsgHdr_ST) + -+ (3 * sizeof(u32)); /* keep it 3 ! */ -+ -+ buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, -+ GFP_KERNEL | GFP_DMA); -+ if (!buffer) -+ return -ENOMEM; -+ -+ pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); -+ -+ pMsg->xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ pMsg->xMsgHeader.msgDstId = HIF_TASK; -+ pMsg->xMsgHeader.msgFlags = 0; -+ pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_SET_LEVEL_REQ; -+ pMsg->xMsgHeader.msgLength = (u16) totalLen; -+ pMsg->msgData[0] = PinNum; -+ pMsg->msgData[1] = NewLevel; -+ -+ /* Send message to SMS */ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)pMsg); -+ rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, -+ &coredev->gpio_set_level_done); -+ -+ if (rc != 0) { -+ if (rc == -ETIME) -+ sms_err("smscore_gpio_set_level timeout"); -+ else -+ sms_err("smscore_gpio_set_level error"); -+ } -+ kfree(buffer); -+ -+ return rc; -+} -+ -+int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 PinNum, -+ u8 *level) { -+ -+ u32 totalLen; -+ int rc; -+ void *buffer; -+ -+ struct SetGpioMsg { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 msgData[2]; -+ } *pMsg; -+ -+ -+ if (PinNum > MAX_GPIO_PIN_NUMBER) -+ return -EINVAL; -+ -+ totalLen = sizeof(struct SmsMsgHdr_ST) + (2 * sizeof(u32)); -+ -+ buffer = kmalloc(totalLen + SMS_DMA_ALIGNMENT, -+ GFP_KERNEL | GFP_DMA); -+ if (!buffer) -+ return -ENOMEM; -+ -+ pMsg = (struct SetGpioMsg *) SMS_ALIGN_ADDRESS(buffer); -+ -+ pMsg->xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ pMsg->xMsgHeader.msgDstId = HIF_TASK; -+ pMsg->xMsgHeader.msgFlags = 0; -+ pMsg->xMsgHeader.msgType = MSG_SMS_GPIO_GET_LEVEL_REQ; -+ pMsg->xMsgHeader.msgLength = (u16) totalLen; -+ pMsg->msgData[0] = PinNum; -+ pMsg->msgData[1] = 0; -+ -+ /* Send message to SMS */ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)pMsg); -+ rc = smscore_sendrequest_and_wait(coredev, pMsg, totalLen, -+ &coredev->gpio_get_level_done); -+ -+ if (rc != 0) { -+ if (rc == -ETIME) -+ sms_err("smscore_gpio_get_level timeout"); -+ else -+ sms_err("smscore_gpio_get_level error"); -+ } -+ kfree(buffer); -+ -+ /* Its a race between other gpio_get_level() and the copy of the single -+ * global 'coredev->gpio_get_res' to the function's variable 'level' -+ */ -+ *level = coredev->gpio_get_res; -+ -+ return rc; -+} -+ -+static int __init smscore_module_init(void) -+{ -+ int rc = 0; -+ -+ INIT_LIST_HEAD(&g_smscore_notifyees); -+ INIT_LIST_HEAD(&g_smscore_devices); -+ kmutex_init(&g_smscore_deviceslock); -+ -+ INIT_LIST_HEAD(&g_smscore_registry); -+ kmutex_init(&g_smscore_registrylock); -+ -+ return rc; -+} -+ -+static void __exit smscore_module_exit(void) -+{ -+ kmutex_lock(&g_smscore_deviceslock); -+ while (!list_empty(&g_smscore_notifyees)) { -+ struct smscore_device_notifyee_t *notifyee = -+ (struct smscore_device_notifyee_t *) -+ g_smscore_notifyees.next; -+ -+ list_del(¬ifyee->entry); -+ kfree(notifyee); -+ } -+ kmutex_unlock(&g_smscore_deviceslock); -+ -+ kmutex_lock(&g_smscore_registrylock); -+ while (!list_empty(&g_smscore_registry)) { -+ struct smscore_registry_entry_t *entry = -+ (struct smscore_registry_entry_t *) -+ g_smscore_registry.next; -+ -+ list_del(&entry->entry); -+ kfree(entry); -+ } -+ kmutex_unlock(&g_smscore_registrylock); -+ -+ sms_debug(""); -+} -+ -+module_init(smscore_module_init); -+module_exit(smscore_module_exit); -+ -+MODULE_DESCRIPTION("Siano MDTV Core module"); -+MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/siano/smscoreapi.h b/drivers/media/common/siano/smscoreapi.h -new file mode 100644 -index 0000000..c592ae0 ---- /dev/null -+++ b/drivers/media/common/siano/smscoreapi.h -@@ -0,0 +1,775 @@ -+/**************************************************************** -+ -+Siano Mobile Silicon, Inc. -+MDTV receiver kernel modules. -+Copyright (C) 2006-2008, Uri Shkolnik, Anatoly Greenblat -+ -+This program is free software: you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation, either version 2 of the License, or -+(at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program. If not, see . -+ -+****************************************************************/ -+ -+#ifndef __SMS_CORE_API_H__ -+#define __SMS_CORE_API_H__ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include "smsir.h" -+ -+#define kmutex_init(_p_) mutex_init(_p_) -+#define kmutex_lock(_p_) mutex_lock(_p_) -+#define kmutex_trylock(_p_) mutex_trylock(_p_) -+#define kmutex_unlock(_p_) mutex_unlock(_p_) -+ -+#ifndef min -+#define min(a, b) (((a) < (b)) ? (a) : (b)) -+#endif -+ -+#define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS (10000) -+#define SMS_ALLOC_ALIGNMENT 128 -+#define SMS_DMA_ALIGNMENT 16 -+#define SMS_ALIGN_ADDRESS(addr) \ -+ ((((uintptr_t)(addr)) + (SMS_DMA_ALIGNMENT-1)) & ~(SMS_DMA_ALIGNMENT-1)) -+ -+#define SMS_DEVICE_FAMILY2 1 -+#define SMS_ROM_NO_RESPONSE 2 -+#define SMS_DEVICE_NOT_READY 0x8000000 -+ -+enum sms_device_type_st { -+ SMS_STELLAR = 0, -+ SMS_NOVA_A0, -+ SMS_NOVA_B0, -+ SMS_VEGA, -+ SMS_NUM_OF_DEVICE_TYPES -+}; -+ -+struct smscore_device_t; -+struct smscore_client_t; -+struct smscore_buffer_t; -+ -+typedef int (*hotplug_t)(struct smscore_device_t *coredev, -+ struct device *device, int arrival); -+ -+typedef int (*setmode_t)(void *context, int mode); -+typedef void (*detectmode_t)(void *context, int *mode); -+typedef int (*sendrequest_t)(void *context, void *buffer, size_t size); -+typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size); -+typedef int (*preload_t)(void *context); -+typedef int (*postload_t)(void *context); -+ -+typedef int (*onresponse_t)(void *context, struct smscore_buffer_t *cb); -+typedef void (*onremove_t)(void *context); -+ -+struct smscore_buffer_t { -+ /* public members, once passed to clients can be changed freely */ -+ struct list_head entry; -+ int size; -+ int offset; -+ -+ /* private members, read-only for clients */ -+ void *p; -+ dma_addr_t phys; -+ unsigned long offset_in_common; -+}; -+ -+struct smsdevice_params_t { -+ struct device *device; -+ -+ int buffer_size; -+ int num_buffers; -+ -+ char devpath[32]; -+ unsigned long flags; -+ -+ setmode_t setmode_handler; -+ detectmode_t detectmode_handler; -+ sendrequest_t sendrequest_handler; -+ preload_t preload_handler; -+ postload_t postload_handler; -+ -+ void *context; -+ enum sms_device_type_st device_type; -+}; -+ -+struct smsclient_params_t { -+ int initial_id; -+ int data_type; -+ onresponse_t onresponse_handler; -+ onremove_t onremove_handler; -+ void *context; -+}; -+ -+struct smscore_device_t { -+ struct list_head entry; -+ -+ struct list_head clients; -+ struct list_head subclients; -+ spinlock_t clientslock; -+ -+ struct list_head buffers; -+ spinlock_t bufferslock; -+ int num_buffers; -+ -+ void *common_buffer; -+ int common_buffer_size; -+ dma_addr_t common_buffer_phys; -+ -+ void *context; -+ struct device *device; -+ -+ char devpath[32]; -+ unsigned long device_flags; -+ -+ setmode_t setmode_handler; -+ detectmode_t detectmode_handler; -+ sendrequest_t sendrequest_handler; -+ preload_t preload_handler; -+ postload_t postload_handler; -+ -+ int mode, modes_supported; -+ -+ /* host <--> device messages */ -+ struct completion version_ex_done, data_download_done, trigger_done; -+ struct completion init_device_done, reload_start_done, resume_done; -+ struct completion gpio_configuration_done, gpio_set_level_done; -+ struct completion gpio_get_level_done, ir_init_done; -+ -+ /* Buffer management */ -+ wait_queue_head_t buffer_mng_waitq; -+ -+ /* GPIO */ -+ int gpio_get_res; -+ -+ /* Target hardware board */ -+ int board_id; -+ -+ /* Firmware */ -+ u8 *fw_buf; -+ u32 fw_buf_size; -+ -+ /* Infrared (IR) */ -+ struct ir_t ir; -+ -+ int led_state; -+}; -+ -+/* GPIO definitions for antenna frequency domain control (SMS8021) */ -+#define SMS_ANTENNA_GPIO_0 1 -+#define SMS_ANTENNA_GPIO_1 0 -+ -+#define BW_8_MHZ 0 -+#define BW_7_MHZ 1 -+#define BW_6_MHZ 2 -+#define BW_5_MHZ 3 -+#define BW_ISDBT_1SEG 4 -+#define BW_ISDBT_3SEG 5 -+ -+#define MSG_HDR_FLAG_SPLIT_MSG 4 -+ -+#define MAX_GPIO_PIN_NUMBER 31 -+ -+#define HIF_TASK 11 -+#define SMS_HOST_LIB 150 -+#define DVBT_BDA_CONTROL_MSG_ID 201 -+ -+#define SMS_MAX_PAYLOAD_SIZE 240 -+#define SMS_TUNE_TIMEOUT 500 -+ -+#define MSG_SMS_GPIO_CONFIG_REQ 507 -+#define MSG_SMS_GPIO_CONFIG_RES 508 -+#define MSG_SMS_GPIO_SET_LEVEL_REQ 509 -+#define MSG_SMS_GPIO_SET_LEVEL_RES 510 -+#define MSG_SMS_GPIO_GET_LEVEL_REQ 511 -+#define MSG_SMS_GPIO_GET_LEVEL_RES 512 -+#define MSG_SMS_RF_TUNE_REQ 561 -+#define MSG_SMS_RF_TUNE_RES 562 -+#define MSG_SMS_INIT_DEVICE_REQ 578 -+#define MSG_SMS_INIT_DEVICE_RES 579 -+#define MSG_SMS_ADD_PID_FILTER_REQ 601 -+#define MSG_SMS_ADD_PID_FILTER_RES 602 -+#define MSG_SMS_REMOVE_PID_FILTER_REQ 603 -+#define MSG_SMS_REMOVE_PID_FILTER_RES 604 -+#define MSG_SMS_DAB_CHANNEL 607 -+#define MSG_SMS_GET_PID_FILTER_LIST_REQ 608 -+#define MSG_SMS_GET_PID_FILTER_LIST_RES 609 -+#define MSG_SMS_GET_STATISTICS_RES 616 -+#define MSG_SMS_GET_STATISTICS_REQ 615 -+#define MSG_SMS_HO_PER_SLICES_IND 630 -+#define MSG_SMS_SET_ANTENNA_CONFIG_REQ 651 -+#define MSG_SMS_SET_ANTENNA_CONFIG_RES 652 -+#define MSG_SMS_SLEEP_RESUME_COMP_IND 655 -+#define MSG_SMS_DATA_DOWNLOAD_REQ 660 -+#define MSG_SMS_DATA_DOWNLOAD_RES 661 -+#define MSG_SMS_SWDOWNLOAD_TRIGGER_REQ 664 -+#define MSG_SMS_SWDOWNLOAD_TRIGGER_RES 665 -+#define MSG_SMS_SWDOWNLOAD_BACKDOOR_REQ 666 -+#define MSG_SMS_SWDOWNLOAD_BACKDOOR_RES 667 -+#define MSG_SMS_GET_VERSION_EX_REQ 668 -+#define MSG_SMS_GET_VERSION_EX_RES 669 -+#define MSG_SMS_SET_CLOCK_OUTPUT_REQ 670 -+#define MSG_SMS_I2C_SET_FREQ_REQ 685 -+#define MSG_SMS_GENERIC_I2C_REQ 687 -+#define MSG_SMS_GENERIC_I2C_RES 688 -+#define MSG_SMS_DVBT_BDA_DATA 693 -+#define MSG_SW_RELOAD_REQ 697 -+#define MSG_SMS_DATA_MSG 699 -+#define MSG_SW_RELOAD_START_REQ 702 -+#define MSG_SW_RELOAD_START_RES 703 -+#define MSG_SW_RELOAD_EXEC_REQ 704 -+#define MSG_SW_RELOAD_EXEC_RES 705 -+#define MSG_SMS_SPI_INT_LINE_SET_REQ 710 -+#define MSG_SMS_GPIO_CONFIG_EX_REQ 712 -+#define MSG_SMS_GPIO_CONFIG_EX_RES 713 -+#define MSG_SMS_ISDBT_TUNE_REQ 776 -+#define MSG_SMS_ISDBT_TUNE_RES 777 -+#define MSG_SMS_TRANSMISSION_IND 782 -+#define MSG_SMS_START_IR_REQ 800 -+#define MSG_SMS_START_IR_RES 801 -+#define MSG_SMS_IR_SAMPLES_IND 802 -+#define MSG_SMS_SIGNAL_DETECTED_IND 827 -+#define MSG_SMS_NO_SIGNAL_IND 828 -+ -+#define SMS_INIT_MSG_EX(ptr, type, src, dst, len) do { \ -+ (ptr)->msgType = type; (ptr)->msgSrcId = src; (ptr)->msgDstId = dst; \ -+ (ptr)->msgLength = len; (ptr)->msgFlags = 0; \ -+} while (0) -+ -+#define SMS_INIT_MSG(ptr, type, len) \ -+ SMS_INIT_MSG_EX(ptr, type, 0, HIF_TASK, len) -+ -+enum SMS_DVB3_EVENTS { -+ DVB3_EVENT_INIT = 0, -+ DVB3_EVENT_SLEEP, -+ DVB3_EVENT_HOTPLUG, -+ DVB3_EVENT_FE_LOCK, -+ DVB3_EVENT_FE_UNLOCK, -+ DVB3_EVENT_UNC_OK, -+ DVB3_EVENT_UNC_ERR -+}; -+ -+enum SMS_DEVICE_MODE { -+ DEVICE_MODE_NONE = -1, -+ DEVICE_MODE_DVBT = 0, -+ DEVICE_MODE_DVBH, -+ DEVICE_MODE_DAB_TDMB, -+ DEVICE_MODE_DAB_TDMB_DABIP, -+ DEVICE_MODE_DVBT_BDA, -+ DEVICE_MODE_ISDBT, -+ DEVICE_MODE_ISDBT_BDA, -+ DEVICE_MODE_CMMB, -+ DEVICE_MODE_RAW_TUNER, -+ DEVICE_MODE_MAX, -+}; -+ -+struct SmsMsgHdr_ST { -+ u16 msgType; -+ u8 msgSrcId; -+ u8 msgDstId; -+ u16 msgLength; /* Length of entire message, including header */ -+ u16 msgFlags; -+}; -+ -+struct SmsMsgData_ST { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 msgData[1]; -+}; -+ -+struct SmsMsgData_ST2 { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 msgData[2]; -+}; -+ -+struct SmsDataDownload_ST { -+ struct SmsMsgHdr_ST xMsgHeader; -+ u32 MemAddr; -+ u8 Payload[SMS_MAX_PAYLOAD_SIZE]; -+}; -+ -+struct SmsVersionRes_ST { -+ struct SmsMsgHdr_ST xMsgHeader; -+ -+ u16 ChipModel; /* e.g. 0x1102 for SMS-1102 "Nova" */ -+ u8 Step; /* 0 - Step A */ -+ u8 MetalFix; /* 0 - Metal 0 */ -+ -+ /* FirmwareId 0xFF if ROM, otherwise the -+ * value indicated by SMSHOSTLIB_DEVICE_MODES_E */ -+ u8 FirmwareId; -+ /* SupportedProtocols Bitwise OR combination of -+ * supported protocols */ -+ u8 SupportedProtocols; -+ -+ u8 VersionMajor; -+ u8 VersionMinor; -+ u8 VersionPatch; -+ u8 VersionFieldPatch; -+ -+ u8 RomVersionMajor; -+ u8 RomVersionMinor; -+ u8 RomVersionPatch; -+ u8 RomVersionFieldPatch; -+ -+ u8 TextLabel[34]; -+}; -+ -+struct SmsFirmware_ST { -+ u32 CheckSum; -+ u32 Length; -+ u32 StartAddress; -+ u8 Payload[1]; -+}; -+ -+/* Statistics information returned as response for -+ * SmsHostApiGetStatistics_Req */ -+struct SMSHOSTLIB_STATISTICS_ST { -+ u32 Reserved; /* Reserved */ -+ -+ /* Common parameters */ -+ u32 IsRfLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsExternalLNAOn; /* 0 - external LNA off, 1 - external LNA on */ -+ -+ /* Reception quality */ -+ s32 SNR; /* dB */ -+ u32 BER; /* Post Viterbi BER [1E-5] */ -+ u32 FIB_CRC; /* CRC errors percentage, valid only for DAB */ -+ u32 TS_PER; /* Transport stream PER, -+ 0xFFFFFFFF indicate N/A, valid only for DVB-T/H */ -+ u32 MFER; /* DVB-H frame error rate in percentage, -+ 0xFFFFFFFF indicate N/A, valid only for DVB-H */ -+ s32 RSSI; /* dBm */ -+ s32 InBandPwr; /* In band power in dBM */ -+ s32 CarrierOffset; /* Carrier Offset in bin/1024 */ -+ -+ /* Transmission parameters */ -+ u32 Frequency; /* Frequency in Hz */ -+ u32 Bandwidth; /* Bandwidth in MHz, valid only for DVB-T/H */ -+ u32 TransmissionMode; /* Transmission Mode, for DAB modes 1-4, -+ for DVB-T/H FFT mode carriers in Kilos */ -+ u32 ModemState; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET, -+ valid only for DVB-T/H */ -+ u32 GuardInterval; /* Guard Interval from -+ SMSHOSTLIB_GUARD_INTERVALS_ET, valid only for DVB-T/H */ -+ u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, -+ valid only for DVB-T/H */ -+ u32 LPCodeRate; /* Low Priority Code Rate from -+ SMSHOSTLIB_CODE_RATE_ET, valid only for DVB-T/H */ -+ u32 Hierarchy; /* Hierarchy from SMSHOSTLIB_HIERARCHY_ET, -+ valid only for DVB-T/H */ -+ u32 Constellation; /* Constellation from -+ SMSHOSTLIB_CONSTELLATION_ET, valid only for DVB-T/H */ -+ -+ /* Burst parameters, valid only for DVB-H */ -+ u32 BurstSize; /* Current burst size in bytes, -+ valid only for DVB-H */ -+ u32 BurstDuration; /* Current burst duration in mSec, -+ valid only for DVB-H */ -+ u32 BurstCycleTime; /* Current burst cycle time in mSec, -+ valid only for DVB-H */ -+ u32 CalculatedBurstCycleTime;/* Current burst cycle time in mSec, -+ as calculated by demodulator, valid only for DVB-H */ -+ u32 NumOfRows; /* Number of rows in MPE table, -+ valid only for DVB-H */ -+ u32 NumOfPaddCols; /* Number of padding columns in MPE table, -+ valid only for DVB-H */ -+ u32 NumOfPunctCols; /* Number of puncturing columns in MPE table, -+ valid only for DVB-H */ -+ u32 ErrorTSPackets; /* Number of erroneous -+ transport-stream packets */ -+ u32 TotalTSPackets; /* Total number of transport-stream packets */ -+ u32 NumOfValidMpeTlbs; /* Number of MPE tables which do not include -+ errors after MPE RS decoding */ -+ u32 NumOfInvalidMpeTlbs;/* Number of MPE tables which include errors -+ after MPE RS decoding */ -+ u32 NumOfCorrectedMpeTlbs;/* Number of MPE tables which were -+ corrected by MPE RS decoding */ -+ /* Common params */ -+ u32 BERErrorCount; /* Number of errornous SYNC bits. */ -+ u32 BERBitCount; /* Total number of SYNC bits. */ -+ -+ /* Interface information */ -+ u32 SmsToHostTxErrors; /* Total number of transmission errors. */ -+ -+ /* DAB/T-DMB */ -+ u32 PreBER; /* DAB/T-DMB only: Pre Viterbi BER [1E-5] */ -+ -+ /* DVB-H TPS parameters */ -+ u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero; -+ if set to 0xFFFFFFFF cell_id not yet recovered */ -+ u32 DvbhSrvIndHP; /* DVB-H service indication info, bit 1 - -+ Time Slicing indicator, bit 0 - MPE-FEC indicator */ -+ u32 DvbhSrvIndLP; /* DVB-H service indication info, bit 1 - -+ Time Slicing indicator, bit 0 - MPE-FEC indicator */ -+ -+ u32 NumMPEReceived; /* DVB-H, Num MPE section received */ -+ -+ u32 ReservedFields[10]; /* Reserved */ -+}; -+ -+struct SmsMsgStatisticsInfo_ST { -+ u32 RequestResult; -+ -+ struct SMSHOSTLIB_STATISTICS_ST Stat; -+ -+ /* Split the calc of the SNR in DAB */ -+ u32 Signal; /* dB */ -+ u32 Noise; /* dB */ -+ -+}; -+ -+struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST { -+ /* Per-layer information */ -+ u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET, -+ * 255 means layer does not exist */ -+ u32 Constellation; /* Constellation from SMSHOSTLIB_CONSTELLATION_ET, -+ * 255 means layer does not exist */ -+ u32 BER; /* Post Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */ -+ u32 BERErrorCount; /* Post Viterbi Error Bits Count */ -+ u32 BERBitCount; /* Post Viterbi Total Bits Count */ -+ u32 PreBER; /* Pre Viterbi BER [1E-5], 0xFFFFFFFF indicate N/A */ -+ u32 TS_PER; /* Transport stream PER [%], 0xFFFFFFFF indicate N/A */ -+ u32 ErrorTSPackets; /* Number of erroneous transport-stream packets */ -+ u32 TotalTSPackets; /* Total number of transport-stream packets */ -+ u32 TILdepthI; /* Time interleaver depth I parameter, -+ * 255 means layer does not exist */ -+ u32 NumberOfSegments; /* Number of segments in layer A, -+ * 255 means layer does not exist */ -+ u32 TMCCErrors; /* TMCC errors */ -+}; -+ -+struct SMSHOSTLIB_STATISTICS_ISDBT_ST { -+ u32 StatisticsType; /* Enumerator identifying the type of the -+ * structure. Values are the same as -+ * SMSHOSTLIB_DEVICE_MODES_E -+ * -+ * This field MUST always be first in any -+ * statistics structure */ -+ -+ u32 FullSize; /* Total size of the structure returned by the modem. -+ * If the size requested by the host is smaller than -+ * FullSize, the struct will be truncated */ -+ -+ /* Common parameters */ -+ u32 IsRfLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsExternalLNAOn; /* 0 - external LNA off, 1 - external LNA on */ -+ -+ /* Reception quality */ -+ s32 SNR; /* dB */ -+ s32 RSSI; /* dBm */ -+ s32 InBandPwr; /* In band power in dBM */ -+ s32 CarrierOffset; /* Carrier Offset in Hz */ -+ -+ /* Transmission parameters */ -+ u32 Frequency; /* Frequency in Hz */ -+ u32 Bandwidth; /* Bandwidth in MHz */ -+ u32 TransmissionMode; /* ISDB-T transmission mode */ -+ u32 ModemState; /* 0 - Acquisition, 1 - Locked */ -+ u32 GuardInterval; /* Guard Interval, 1 divided by value */ -+ u32 SystemType; /* ISDB-T system type (ISDB-T / ISDB-Tsb) */ -+ u32 PartialReception; /* TRUE - partial reception, FALSE otherwise */ -+ u32 NumOfLayers; /* Number of ISDB-T layers in the network */ -+ -+ /* Per-layer information */ -+ /* Layers A, B and C */ -+ struct SMSHOSTLIB_ISDBT_LAYER_STAT_ST LayerInfo[3]; -+ /* Per-layer statistics, see SMSHOSTLIB_ISDBT_LAYER_STAT_ST */ -+ -+ /* Interface information */ -+ u32 SmsToHostTxErrors; /* Total number of transmission errors. */ -+}; -+ -+struct PID_STATISTICS_DATA_S { -+ struct PID_BURST_S { -+ u32 size; -+ u32 padding_cols; -+ u32 punct_cols; -+ u32 duration; -+ u32 cycle; -+ u32 calc_cycle; -+ } burst; -+ -+ u32 tot_tbl_cnt; -+ u32 invalid_tbl_cnt; -+ u32 tot_cor_tbl; -+}; -+ -+struct PID_DATA_S { -+ u32 pid; -+ u32 num_rows; -+ struct PID_STATISTICS_DATA_S pid_statistics; -+}; -+ -+#define CORRECT_STAT_RSSI(_stat) ((_stat).RSSI *= -1) -+#define CORRECT_STAT_BANDWIDTH(_stat) (_stat.Bandwidth = 8 - _stat.Bandwidth) -+#define CORRECT_STAT_TRANSMISSON_MODE(_stat) \ -+ if (_stat.TransmissionMode == 0) \ -+ _stat.TransmissionMode = 2; \ -+ else if (_stat.TransmissionMode == 1) \ -+ _stat.TransmissionMode = 8; \ -+ else \ -+ _stat.TransmissionMode = 4; -+ -+struct TRANSMISSION_STATISTICS_S { -+ u32 Frequency; /* Frequency in Hz */ -+ u32 Bandwidth; /* Bandwidth in MHz */ -+ u32 TransmissionMode; /* FFT mode carriers in Kilos */ -+ u32 GuardInterval; /* Guard Interval from -+ SMSHOSTLIB_GUARD_INTERVALS_ET */ -+ u32 CodeRate; /* Code Rate from SMSHOSTLIB_CODE_RATE_ET */ -+ u32 LPCodeRate; /* Low Priority Code Rate from -+ SMSHOSTLIB_CODE_RATE_ET */ -+ u32 Hierarchy; /* Hierarchy from SMSHOSTLIB_HIERARCHY_ET */ -+ u32 Constellation; /* Constellation from -+ SMSHOSTLIB_CONSTELLATION_ET */ -+ -+ /* DVB-H TPS parameters */ -+ u32 CellId; /* TPS Cell ID in bits 15..0, bits 31..16 zero; -+ if set to 0xFFFFFFFF cell_id not yet recovered */ -+ u32 DvbhSrvIndHP; /* DVB-H service indication info, bit 1 - -+ Time Slicing indicator, bit 0 - MPE-FEC indicator */ -+ u32 DvbhSrvIndLP; /* DVB-H service indication info, bit 1 - -+ Time Slicing indicator, bit 0 - MPE-FEC indicator */ -+ u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ -+}; -+ -+struct RECEPTION_STATISTICS_S { -+ u32 IsRfLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsDemodLocked; /* 0 - not locked, 1 - locked */ -+ u32 IsExternalLNAOn; /* 0 - external LNA off, 1 - external LNA on */ -+ -+ u32 ModemState; /* from SMSHOSTLIB_DVB_MODEM_STATE_ET */ -+ s32 SNR; /* dB */ -+ u32 BER; /* Post Viterbi BER [1E-5] */ -+ u32 BERErrorCount; /* Number of erronous SYNC bits. */ -+ u32 BERBitCount; /* Total number of SYNC bits. */ -+ u32 TS_PER; /* Transport stream PER, -+ 0xFFFFFFFF indicate N/A */ -+ u32 MFER; /* DVB-H frame error rate in percentage, -+ 0xFFFFFFFF indicate N/A, valid only for DVB-H */ -+ s32 RSSI; /* dBm */ -+ s32 InBandPwr; /* In band power in dBM */ -+ s32 CarrierOffset; /* Carrier Offset in bin/1024 */ -+ u32 ErrorTSPackets; /* Number of erroneous -+ transport-stream packets */ -+ u32 TotalTSPackets; /* Total number of transport-stream packets */ -+ -+ s32 MRC_SNR; /* dB */ -+ s32 MRC_RSSI; /* dBm */ -+ s32 MRC_InBandPwr; /* In band power in dBM */ -+}; -+ -+ -+/* Statistics information returned as response for -+ * SmsHostApiGetStatisticsEx_Req for DVB applications, SMS1100 and up */ -+struct SMSHOSTLIB_STATISTICS_DVB_S { -+ /* Reception */ -+ struct RECEPTION_STATISTICS_S ReceptionData; -+ -+ /* Transmission parameters */ -+ struct TRANSMISSION_STATISTICS_S TransmissionData; -+ -+ /* Burst parameters, valid only for DVB-H */ -+#define SRVM_MAX_PID_FILTERS 8 -+ struct PID_DATA_S PidData[SRVM_MAX_PID_FILTERS]; -+}; -+ -+struct SRVM_SIGNAL_STATUS_S { -+ u32 result; -+ u32 snr; -+ u32 tsPackets; -+ u32 etsPackets; -+ u32 constellation; -+ u32 hpCode; -+ u32 tpsSrvIndLP; -+ u32 tpsSrvIndHP; -+ u32 cellId; -+ u32 reason; -+ -+ s32 inBandPower; -+ u32 requestId; -+}; -+ -+struct SMSHOSTLIB_I2C_REQ_ST { -+ u32 DeviceAddress; /* I2c device address */ -+ u32 WriteCount; /* number of bytes to write */ -+ u32 ReadCount; /* number of bytes to read */ -+ u8 Data[1]; -+}; -+ -+struct SMSHOSTLIB_I2C_RES_ST { -+ u32 Status; /* non-zero value in case of failure */ -+ u32 ReadCount; /* number of bytes read */ -+ u8 Data[1]; -+}; -+ -+ -+struct smscore_config_gpio { -+#define SMS_GPIO_DIRECTION_INPUT 0 -+#define SMS_GPIO_DIRECTION_OUTPUT 1 -+ u8 direction; -+ -+#define SMS_GPIO_PULLUPDOWN_NONE 0 -+#define SMS_GPIO_PULLUPDOWN_PULLDOWN 1 -+#define SMS_GPIO_PULLUPDOWN_PULLUP 2 -+#define SMS_GPIO_PULLUPDOWN_KEEPER 3 -+ u8 pullupdown; -+ -+#define SMS_GPIO_INPUTCHARACTERISTICS_NORMAL 0 -+#define SMS_GPIO_INPUTCHARACTERISTICS_SCHMITT 1 -+ u8 inputcharacteristics; -+ -+#define SMS_GPIO_OUTPUTSLEWRATE_FAST 0 -+#define SMS_GPIO_OUTPUTSLEWRATE_SLOW 1 -+ u8 outputslewrate; -+ -+#define SMS_GPIO_OUTPUTDRIVING_4mA 0 -+#define SMS_GPIO_OUTPUTDRIVING_8mA 1 -+#define SMS_GPIO_OUTPUTDRIVING_12mA 2 -+#define SMS_GPIO_OUTPUTDRIVING_16mA 3 -+ u8 outputdriving; -+}; -+ -+struct smscore_gpio_config { -+#define SMS_GPIO_DIRECTION_INPUT 0 -+#define SMS_GPIO_DIRECTION_OUTPUT 1 -+ u8 Direction; -+ -+#define SMS_GPIO_PULL_UP_DOWN_NONE 0 -+#define SMS_GPIO_PULL_UP_DOWN_PULLDOWN 1 -+#define SMS_GPIO_PULL_UP_DOWN_PULLUP 2 -+#define SMS_GPIO_PULL_UP_DOWN_KEEPER 3 -+ u8 PullUpDown; -+ -+#define SMS_GPIO_INPUT_CHARACTERISTICS_NORMAL 0 -+#define SMS_GPIO_INPUT_CHARACTERISTICS_SCHMITT 1 -+ u8 InputCharacteristics; -+ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_SLOW 1 /* 10xx */ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_FAST 0 /* 10xx */ -+ -+ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_0_45_V_NS 0 /* 11xx */ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_0_9_V_NS 1 /* 11xx */ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_1_7_V_NS 2 /* 11xx */ -+#define SMS_GPIO_OUTPUT_SLEW_RATE_3_3_V_NS 3 /* 11xx */ -+ u8 OutputSlewRate; -+ -+#define SMS_GPIO_OUTPUT_DRIVING_S_4mA 0 /* 10xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_S_8mA 1 /* 10xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_S_12mA 2 /* 10xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_S_16mA 3 /* 10xx */ -+ -+#define SMS_GPIO_OUTPUT_DRIVING_1_5mA 0 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_2_8mA 1 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_4mA 2 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_7mA 3 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_10mA 4 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_11mA 5 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_14mA 6 /* 11xx */ -+#define SMS_GPIO_OUTPUT_DRIVING_16mA 7 /* 11xx */ -+ u8 OutputDriving; -+}; -+ -+extern void smscore_registry_setmode(char *devpath, int mode); -+extern int smscore_registry_getmode(char *devpath); -+ -+extern int smscore_register_hotplug(hotplug_t hotplug); -+extern void smscore_unregister_hotplug(hotplug_t hotplug); -+ -+extern int smscore_register_device(struct smsdevice_params_t *params, -+ struct smscore_device_t **coredev); -+extern void smscore_unregister_device(struct smscore_device_t *coredev); -+ -+extern int smscore_start_device(struct smscore_device_t *coredev); -+extern int smscore_load_firmware(struct smscore_device_t *coredev, -+ char *filename, -+ loadfirmware_t loadfirmware_handler); -+ -+extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode); -+extern int smscore_get_device_mode(struct smscore_device_t *coredev); -+ -+extern int smscore_register_client(struct smscore_device_t *coredev, -+ struct smsclient_params_t *params, -+ struct smscore_client_t **client); -+extern void smscore_unregister_client(struct smscore_client_t *client); -+ -+extern int smsclient_sendrequest(struct smscore_client_t *client, -+ void *buffer, size_t size); -+extern void smscore_onresponse(struct smscore_device_t *coredev, -+ struct smscore_buffer_t *cb); -+ -+extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev); -+extern int smscore_map_common_buffer(struct smscore_device_t *coredev, -+ struct vm_area_struct *vma); -+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, -+ int mode, char *filename); -+extern int smscore_send_fw_file(struct smscore_device_t *coredev, -+ u8 *ufwbuf, int size); -+ -+extern -+struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev); -+extern void smscore_putbuffer(struct smscore_device_t *coredev, -+ struct smscore_buffer_t *cb); -+ -+/* old GPIO management */ -+int smscore_configure_gpio(struct smscore_device_t *coredev, u32 pin, -+ struct smscore_config_gpio *pinconfig); -+int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int level); -+ -+/* new GPIO management */ -+extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 PinNum, -+ struct smscore_gpio_config *pGpioConfig); -+extern int smscore_gpio_set_level(struct smscore_device_t *coredev, u8 PinNum, -+ u8 NewLevel); -+extern int smscore_gpio_get_level(struct smscore_device_t *coredev, u8 PinNum, -+ u8 *level); -+ -+void smscore_set_board_id(struct smscore_device_t *core, int id); -+int smscore_get_board_id(struct smscore_device_t *core); -+ -+int smscore_led_state(struct smscore_device_t *core, int led); -+ -+ -+/* ------------------------------------------------------------------------ */ -+ -+#define DBG_INFO 1 -+#define DBG_ADV 2 -+ -+#define sms_printk(kern, fmt, arg...) \ -+ printk(kern "%s: " fmt "\n", __func__, ##arg) -+ -+#define dprintk(kern, lvl, fmt, arg...) do {\ -+ if (sms_dbg & lvl) \ -+ sms_printk(kern, fmt, ##arg); } while (0) -+ -+#define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg) -+#define sms_err(fmt, arg...) \ -+ sms_printk(KERN_ERR, "line: %d: " fmt, __LINE__, ##arg) -+#define sms_warn(fmt, arg...) sms_printk(KERN_WARNING, fmt, ##arg) -+#define sms_info(fmt, arg...) \ -+ dprintk(KERN_INFO, DBG_INFO, fmt, ##arg) -+#define sms_debug(fmt, arg...) \ -+ dprintk(KERN_DEBUG, DBG_ADV, fmt, ##arg) -+ -+ -+#endif /* __SMS_CORE_API_H__ */ -diff --git a/drivers/media/common/siano/smsdvb.c b/drivers/media/common/siano/smsdvb.c -new file mode 100644 -index 0000000..aa77e54 ---- /dev/null -+++ b/drivers/media/common/siano/smsdvb.c -@@ -0,0 +1,1078 @@ -+/**************************************************************** -+ -+Siano Mobile Silicon, Inc. -+MDTV receiver kernel modules. -+Copyright (C) 2006-2008, Uri Shkolnik -+ -+This program is free software: you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation, either version 2 of the License, or -+(at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program. If not, see . -+ -+****************************************************************/ -+ -+#include -+#include -+#include -+ -+#include "dmxdev.h" -+#include "dvbdev.h" -+#include "dvb_demux.h" -+#include "dvb_frontend.h" -+ -+#include "smscoreapi.h" -+#include "smsendian.h" -+#include "sms-cards.h" -+ -+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); -+ -+struct smsdvb_client_t { -+ struct list_head entry; -+ -+ struct smscore_device_t *coredev; -+ struct smscore_client_t *smsclient; -+ -+ struct dvb_adapter adapter; -+ struct dvb_demux demux; -+ struct dmxdev dmxdev; -+ struct dvb_frontend frontend; -+ -+ fe_status_t fe_status; -+ -+ struct completion tune_done; -+ -+ struct SMSHOSTLIB_STATISTICS_DVB_S sms_stat_dvb; -+ int event_fe_state; -+ int event_unc_state; -+}; -+ -+static struct list_head g_smsdvb_clients; -+static struct mutex g_smsdvb_clientslock; -+ -+static int sms_dbg; -+module_param_named(debug, sms_dbg, int, 0644); -+MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); -+ -+/* Events that may come from DVB v3 adapter */ -+static void sms_board_dvb3_event(struct smsdvb_client_t *client, -+ enum SMS_DVB3_EVENTS event) { -+ -+ struct smscore_device_t *coredev = client->coredev; -+ switch (event) { -+ case DVB3_EVENT_INIT: -+ sms_debug("DVB3_EVENT_INIT"); -+ sms_board_event(coredev, BOARD_EVENT_BIND); -+ break; -+ case DVB3_EVENT_SLEEP: -+ sms_debug("DVB3_EVENT_SLEEP"); -+ sms_board_event(coredev, BOARD_EVENT_POWER_SUSPEND); -+ break; -+ case DVB3_EVENT_HOTPLUG: -+ sms_debug("DVB3_EVENT_HOTPLUG"); -+ sms_board_event(coredev, BOARD_EVENT_POWER_INIT); -+ break; -+ case DVB3_EVENT_FE_LOCK: -+ if (client->event_fe_state != DVB3_EVENT_FE_LOCK) { -+ client->event_fe_state = DVB3_EVENT_FE_LOCK; -+ sms_debug("DVB3_EVENT_FE_LOCK"); -+ sms_board_event(coredev, BOARD_EVENT_FE_LOCK); -+ } -+ break; -+ case DVB3_EVENT_FE_UNLOCK: -+ if (client->event_fe_state != DVB3_EVENT_FE_UNLOCK) { -+ client->event_fe_state = DVB3_EVENT_FE_UNLOCK; -+ sms_debug("DVB3_EVENT_FE_UNLOCK"); -+ sms_board_event(coredev, BOARD_EVENT_FE_UNLOCK); -+ } -+ break; -+ case DVB3_EVENT_UNC_OK: -+ if (client->event_unc_state != DVB3_EVENT_UNC_OK) { -+ client->event_unc_state = DVB3_EVENT_UNC_OK; -+ sms_debug("DVB3_EVENT_UNC_OK"); -+ sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_OK); -+ } -+ break; -+ case DVB3_EVENT_UNC_ERR: -+ if (client->event_unc_state != DVB3_EVENT_UNC_ERR) { -+ client->event_unc_state = DVB3_EVENT_UNC_ERR; -+ sms_debug("DVB3_EVENT_UNC_ERR"); -+ sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_ERRORS); -+ } -+ break; -+ -+ default: -+ sms_err("Unknown dvb3 api event"); -+ break; -+ } -+} -+ -+ -+static void smsdvb_update_dvb_stats(struct RECEPTION_STATISTICS_S *pReceptionData, -+ struct SMSHOSTLIB_STATISTICS_ST *p) -+{ -+ if (sms_dbg & 2) { -+ printk(KERN_DEBUG "Reserved = %d", p->Reserved); -+ printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked); -+ printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked); -+ printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn); -+ printk(KERN_DEBUG "SNR = %d", p->SNR); -+ printk(KERN_DEBUG "BER = %d", p->BER); -+ printk(KERN_DEBUG "FIB_CRC = %d", p->FIB_CRC); -+ printk(KERN_DEBUG "TS_PER = %d", p->TS_PER); -+ printk(KERN_DEBUG "MFER = %d", p->MFER); -+ printk(KERN_DEBUG "RSSI = %d", p->RSSI); -+ printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr); -+ printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset); -+ printk(KERN_DEBUG "Frequency = %d", p->Frequency); -+ printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth); -+ printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode); -+ printk(KERN_DEBUG "ModemState = %d", p->ModemState); -+ printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval); -+ printk(KERN_DEBUG "CodeRate = %d", p->CodeRate); -+ printk(KERN_DEBUG "LPCodeRate = %d", p->LPCodeRate); -+ printk(KERN_DEBUG "Hierarchy = %d", p->Hierarchy); -+ printk(KERN_DEBUG "Constellation = %d", p->Constellation); -+ printk(KERN_DEBUG "BurstSize = %d", p->BurstSize); -+ printk(KERN_DEBUG "BurstDuration = %d", p->BurstDuration); -+ printk(KERN_DEBUG "BurstCycleTime = %d", p->BurstCycleTime); -+ printk(KERN_DEBUG "CalculatedBurstCycleTime = %d", p->CalculatedBurstCycleTime); -+ printk(KERN_DEBUG "NumOfRows = %d", p->NumOfRows); -+ printk(KERN_DEBUG "NumOfPaddCols = %d", p->NumOfPaddCols); -+ printk(KERN_DEBUG "NumOfPunctCols = %d", p->NumOfPunctCols); -+ printk(KERN_DEBUG "ErrorTSPackets = %d", p->ErrorTSPackets); -+ printk(KERN_DEBUG "TotalTSPackets = %d", p->TotalTSPackets); -+ printk(KERN_DEBUG "NumOfValidMpeTlbs = %d", p->NumOfValidMpeTlbs); -+ printk(KERN_DEBUG "NumOfInvalidMpeTlbs = %d", p->NumOfInvalidMpeTlbs); -+ printk(KERN_DEBUG "NumOfCorrectedMpeTlbs = %d", p->NumOfCorrectedMpeTlbs); -+ printk(KERN_DEBUG "BERErrorCount = %d", p->BERErrorCount); -+ printk(KERN_DEBUG "BERBitCount = %d", p->BERBitCount); -+ printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors); -+ printk(KERN_DEBUG "PreBER = %d", p->PreBER); -+ printk(KERN_DEBUG "CellId = %d", p->CellId); -+ printk(KERN_DEBUG "DvbhSrvIndHP = %d", p->DvbhSrvIndHP); -+ printk(KERN_DEBUG "DvbhSrvIndLP = %d", p->DvbhSrvIndLP); -+ printk(KERN_DEBUG "NumMPEReceived = %d", p->NumMPEReceived); -+ } -+ -+ pReceptionData->IsDemodLocked = p->IsDemodLocked; -+ -+ pReceptionData->SNR = p->SNR; -+ pReceptionData->BER = p->BER; -+ pReceptionData->BERErrorCount = p->BERErrorCount; -+ pReceptionData->InBandPwr = p->InBandPwr; -+ pReceptionData->ErrorTSPackets = p->ErrorTSPackets; -+}; -+ -+ -+static void smsdvb_update_isdbt_stats(struct RECEPTION_STATISTICS_S *pReceptionData, -+ struct SMSHOSTLIB_STATISTICS_ISDBT_ST *p) -+{ -+ int i; -+ -+ if (sms_dbg & 2) { -+ printk(KERN_DEBUG "IsRfLocked = %d", p->IsRfLocked); -+ printk(KERN_DEBUG "IsDemodLocked = %d", p->IsDemodLocked); -+ printk(KERN_DEBUG "IsExternalLNAOn = %d", p->IsExternalLNAOn); -+ printk(KERN_DEBUG "SNR = %d", p->SNR); -+ printk(KERN_DEBUG "RSSI = %d", p->RSSI); -+ printk(KERN_DEBUG "InBandPwr = %d", p->InBandPwr); -+ printk(KERN_DEBUG "CarrierOffset = %d", p->CarrierOffset); -+ printk(KERN_DEBUG "Frequency = %d", p->Frequency); -+ printk(KERN_DEBUG "Bandwidth = %d", p->Bandwidth); -+ printk(KERN_DEBUG "TransmissionMode = %d", p->TransmissionMode); -+ printk(KERN_DEBUG "ModemState = %d", p->ModemState); -+ printk(KERN_DEBUG "GuardInterval = %d", p->GuardInterval); -+ printk(KERN_DEBUG "SystemType = %d", p->SystemType); -+ printk(KERN_DEBUG "PartialReception = %d", p->PartialReception); -+ printk(KERN_DEBUG "NumOfLayers = %d", p->NumOfLayers); -+ printk(KERN_DEBUG "SmsToHostTxErrors = %d", p->SmsToHostTxErrors); -+ -+ for (i = 0; i < 3; i++) { -+ printk(KERN_DEBUG "%d: CodeRate = %d", i, p->LayerInfo[i].CodeRate); -+ printk(KERN_DEBUG "%d: Constellation = %d", i, p->LayerInfo[i].Constellation); -+ printk(KERN_DEBUG "%d: BER = %d", i, p->LayerInfo[i].BER); -+ printk(KERN_DEBUG "%d: BERErrorCount = %d", i, p->LayerInfo[i].BERErrorCount); -+ printk(KERN_DEBUG "%d: BERBitCount = %d", i, p->LayerInfo[i].BERBitCount); -+ printk(KERN_DEBUG "%d: PreBER = %d", i, p->LayerInfo[i].PreBER); -+ printk(KERN_DEBUG "%d: TS_PER = %d", i, p->LayerInfo[i].TS_PER); -+ printk(KERN_DEBUG "%d: ErrorTSPackets = %d", i, p->LayerInfo[i].ErrorTSPackets); -+ printk(KERN_DEBUG "%d: TotalTSPackets = %d", i, p->LayerInfo[i].TotalTSPackets); -+ printk(KERN_DEBUG "%d: TILdepthI = %d", i, p->LayerInfo[i].TILdepthI); -+ printk(KERN_DEBUG "%d: NumberOfSegments = %d", i, p->LayerInfo[i].NumberOfSegments); -+ printk(KERN_DEBUG "%d: TMCCErrors = %d", i, p->LayerInfo[i].TMCCErrors); -+ } -+ } -+ -+ pReceptionData->IsDemodLocked = p->IsDemodLocked; -+ -+ pReceptionData->SNR = p->SNR; -+ pReceptionData->InBandPwr = p->InBandPwr; -+ -+ pReceptionData->ErrorTSPackets = 0; -+ pReceptionData->BER = 0; -+ pReceptionData->BERErrorCount = 0; -+ for (i = 0; i < 3; i++) { -+ pReceptionData->BER += p->LayerInfo[i].BER; -+ pReceptionData->BERErrorCount += p->LayerInfo[i].BERErrorCount; -+ pReceptionData->ErrorTSPackets += p->LayerInfo[i].ErrorTSPackets; -+ } -+} -+ -+static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) -+{ -+ struct smsdvb_client_t *client = (struct smsdvb_client_t *) context; -+ struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) (((u8 *) cb->p) -+ + cb->offset); -+ u32 *pMsgData = (u32 *) phdr + 1; -+ /*u32 MsgDataLen = phdr->msgLength - sizeof(struct SmsMsgHdr_ST);*/ -+ bool is_status_update = false; -+ -+ smsendian_handle_rx_message((struct SmsMsgData_ST *) phdr); -+ -+ switch (phdr->msgType) { -+ case MSG_SMS_DVBT_BDA_DATA: -+ dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), -+ cb->size - sizeof(struct SmsMsgHdr_ST)); -+ break; -+ -+ case MSG_SMS_RF_TUNE_RES: -+ case MSG_SMS_ISDBT_TUNE_RES: -+ complete(&client->tune_done); -+ break; -+ -+ case MSG_SMS_SIGNAL_DETECTED_IND: -+ sms_info("MSG_SMS_SIGNAL_DETECTED_IND"); -+ client->sms_stat_dvb.TransmissionData.IsDemodLocked = true; -+ is_status_update = true; -+ break; -+ -+ case MSG_SMS_NO_SIGNAL_IND: -+ sms_info("MSG_SMS_NO_SIGNAL_IND"); -+ client->sms_stat_dvb.TransmissionData.IsDemodLocked = false; -+ is_status_update = true; -+ break; -+ -+ case MSG_SMS_TRANSMISSION_IND: { -+ sms_info("MSG_SMS_TRANSMISSION_IND"); -+ -+ pMsgData++; -+ memcpy(&client->sms_stat_dvb.TransmissionData, pMsgData, -+ sizeof(struct TRANSMISSION_STATISTICS_S)); -+ -+ /* Mo need to correct guard interval -+ * (as opposed to old statistics message). -+ */ -+ CORRECT_STAT_BANDWIDTH(client->sms_stat_dvb.TransmissionData); -+ CORRECT_STAT_TRANSMISSON_MODE( -+ client->sms_stat_dvb.TransmissionData); -+ is_status_update = true; -+ break; -+ } -+ case MSG_SMS_HO_PER_SLICES_IND: { -+ struct RECEPTION_STATISTICS_S *pReceptionData = -+ &client->sms_stat_dvb.ReceptionData; -+ struct SRVM_SIGNAL_STATUS_S SignalStatusData; -+ -+ /*sms_info("MSG_SMS_HO_PER_SLICES_IND");*/ -+ pMsgData++; -+ SignalStatusData.result = pMsgData[0]; -+ SignalStatusData.snr = pMsgData[1]; -+ SignalStatusData.inBandPower = (s32) pMsgData[2]; -+ SignalStatusData.tsPackets = pMsgData[3]; -+ SignalStatusData.etsPackets = pMsgData[4]; -+ SignalStatusData.constellation = pMsgData[5]; -+ SignalStatusData.hpCode = pMsgData[6]; -+ SignalStatusData.tpsSrvIndLP = pMsgData[7] & 0x03; -+ SignalStatusData.tpsSrvIndHP = pMsgData[8] & 0x03; -+ SignalStatusData.cellId = pMsgData[9] & 0xFFFF; -+ SignalStatusData.reason = pMsgData[10]; -+ SignalStatusData.requestId = pMsgData[11]; -+ pReceptionData->IsRfLocked = pMsgData[16]; -+ pReceptionData->IsDemodLocked = pMsgData[17]; -+ pReceptionData->ModemState = pMsgData[12]; -+ pReceptionData->SNR = pMsgData[1]; -+ pReceptionData->BER = pMsgData[13]; -+ pReceptionData->RSSI = pMsgData[14]; -+ CORRECT_STAT_RSSI(client->sms_stat_dvb.ReceptionData); -+ -+ pReceptionData->InBandPwr = (s32) pMsgData[2]; -+ pReceptionData->CarrierOffset = (s32) pMsgData[15]; -+ pReceptionData->TotalTSPackets = pMsgData[3]; -+ pReceptionData->ErrorTSPackets = pMsgData[4]; -+ -+ /* TS PER */ -+ if ((SignalStatusData.tsPackets + SignalStatusData.etsPackets) -+ > 0) { -+ pReceptionData->TS_PER = (SignalStatusData.etsPackets -+ * 100) / (SignalStatusData.tsPackets -+ + SignalStatusData.etsPackets); -+ } else { -+ pReceptionData->TS_PER = 0; -+ } -+ -+ pReceptionData->BERBitCount = pMsgData[18]; -+ pReceptionData->BERErrorCount = pMsgData[19]; -+ -+ pReceptionData->MRC_SNR = pMsgData[20]; -+ pReceptionData->MRC_InBandPwr = pMsgData[21]; -+ pReceptionData->MRC_RSSI = pMsgData[22]; -+ -+ is_status_update = true; -+ break; -+ } -+ case MSG_SMS_GET_STATISTICS_RES: { -+ union { -+ struct SMSHOSTLIB_STATISTICS_ISDBT_ST isdbt; -+ struct SmsMsgStatisticsInfo_ST dvb; -+ } *p = (void *) (phdr + 1); -+ struct RECEPTION_STATISTICS_S *pReceptionData = -+ &client->sms_stat_dvb.ReceptionData; -+ -+ sms_info("MSG_SMS_GET_STATISTICS_RES"); -+ -+ is_status_update = true; -+ -+ switch (smscore_get_device_mode(client->coredev)) { -+ case DEVICE_MODE_ISDBT: -+ case DEVICE_MODE_ISDBT_BDA: -+ smsdvb_update_isdbt_stats(pReceptionData, &p->isdbt); -+ break; -+ default: -+ smsdvb_update_dvb_stats(pReceptionData, &p->dvb.Stat); -+ } -+ if (!pReceptionData->IsDemodLocked) { -+ pReceptionData->SNR = 0; -+ pReceptionData->BER = 0; -+ pReceptionData->BERErrorCount = 0; -+ pReceptionData->InBandPwr = 0; -+ pReceptionData->ErrorTSPackets = 0; -+ } -+ -+ complete(&client->tune_done); -+ break; -+ } -+ default: -+ sms_info("Unhandled message %d", phdr->msgType); -+ -+ } -+ smscore_putbuffer(client->coredev, cb); -+ -+ if (is_status_update) { -+ if (client->sms_stat_dvb.ReceptionData.IsDemodLocked) { -+ client->fe_status = FE_HAS_SIGNAL | FE_HAS_CARRIER -+ | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK; -+ sms_board_dvb3_event(client, DVB3_EVENT_FE_LOCK); -+ if (client->sms_stat_dvb.ReceptionData.ErrorTSPackets -+ == 0) -+ sms_board_dvb3_event(client, DVB3_EVENT_UNC_OK); -+ else -+ sms_board_dvb3_event(client, -+ DVB3_EVENT_UNC_ERR); -+ -+ } else { -+ if (client->sms_stat_dvb.ReceptionData.IsRfLocked) -+ client->fe_status = FE_HAS_SIGNAL | FE_HAS_CARRIER; -+ else -+ client->fe_status = 0; -+ sms_board_dvb3_event(client, DVB3_EVENT_FE_UNLOCK); -+ } -+ } -+ -+ return 0; -+} -+ -+static void smsdvb_unregister_client(struct smsdvb_client_t *client) -+{ -+ /* must be called under clientslock */ -+ -+ list_del(&client->entry); -+ -+ smscore_unregister_client(client->smsclient); -+ dvb_unregister_frontend(&client->frontend); -+ dvb_dmxdev_release(&client->dmxdev); -+ dvb_dmx_release(&client->demux); -+ dvb_unregister_adapter(&client->adapter); -+ kfree(client); -+} -+ -+static void smsdvb_onremove(void *context) -+{ -+ kmutex_lock(&g_smsdvb_clientslock); -+ -+ smsdvb_unregister_client((struct smsdvb_client_t *) context); -+ -+ kmutex_unlock(&g_smsdvb_clientslock); -+} -+ -+static int smsdvb_start_feed(struct dvb_demux_feed *feed) -+{ -+ struct smsdvb_client_t *client = -+ container_of(feed->demux, struct smsdvb_client_t, demux); -+ struct SmsMsgData_ST PidMsg; -+ -+ sms_debug("add pid %d(%x)", -+ feed->pid, feed->pid); -+ -+ PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ PidMsg.xMsgHeader.msgDstId = HIF_TASK; -+ PidMsg.xMsgHeader.msgFlags = 0; -+ PidMsg.xMsgHeader.msgType = MSG_SMS_ADD_PID_FILTER_REQ; -+ PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); -+ PidMsg.msgData[0] = feed->pid; -+ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg); -+ return smsclient_sendrequest(client->smsclient, -+ &PidMsg, sizeof(PidMsg)); -+} -+ -+static int smsdvb_stop_feed(struct dvb_demux_feed *feed) -+{ -+ struct smsdvb_client_t *client = -+ container_of(feed->demux, struct smsdvb_client_t, demux); -+ struct SmsMsgData_ST PidMsg; -+ -+ sms_debug("remove pid %d(%x)", -+ feed->pid, feed->pid); -+ -+ PidMsg.xMsgHeader.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ PidMsg.xMsgHeader.msgDstId = HIF_TASK; -+ PidMsg.xMsgHeader.msgFlags = 0; -+ PidMsg.xMsgHeader.msgType = MSG_SMS_REMOVE_PID_FILTER_REQ; -+ PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); -+ PidMsg.msgData[0] = feed->pid; -+ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg); -+ return smsclient_sendrequest(client->smsclient, -+ &PidMsg, sizeof(PidMsg)); -+} -+ -+static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, -+ void *buffer, size_t size, -+ struct completion *completion) -+{ -+ int rc; -+ -+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)buffer); -+ rc = smsclient_sendrequest(client->smsclient, buffer, size); -+ if (rc < 0) -+ return rc; -+ -+ return wait_for_completion_timeout(completion, -+ msecs_to_jiffies(2000)) ? -+ 0 : -ETIME; -+} -+ -+static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) -+{ -+ int rc; -+ struct SmsMsgHdr_ST Msg = { MSG_SMS_GET_STATISTICS_REQ, -+ DVBT_BDA_CONTROL_MSG_ID, -+ HIF_TASK, -+ sizeof(struct SmsMsgHdr_ST), 0 }; -+ -+ rc = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), -+ &client->tune_done); -+ -+ return rc; -+} -+ -+static inline int led_feedback(struct smsdvb_client_t *client) -+{ -+ if (client->fe_status & FE_HAS_LOCK) -+ return sms_board_led_feedback(client->coredev, -+ (client->sms_stat_dvb.ReceptionData.BER -+ == 0) ? SMS_LED_HI : SMS_LED_LO); -+ else -+ return sms_board_led_feedback(client->coredev, SMS_LED_OFF); -+} -+ -+static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) -+{ -+ int rc; -+ struct smsdvb_client_t *client; -+ client = container_of(fe, struct smsdvb_client_t, frontend); -+ -+ rc = smsdvb_send_statistics_request(client); -+ -+ *stat = client->fe_status; -+ -+ led_feedback(client); -+ -+ return rc; -+} -+ -+static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) -+{ -+ int rc; -+ struct smsdvb_client_t *client; -+ client = container_of(fe, struct smsdvb_client_t, frontend); -+ -+ rc = smsdvb_send_statistics_request(client); -+ -+ *ber = client->sms_stat_dvb.ReceptionData.BER; -+ -+ led_feedback(client); -+ -+ return rc; -+} -+ -+static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) -+{ -+ int rc; -+ -+ struct smsdvb_client_t *client; -+ client = container_of(fe, struct smsdvb_client_t, frontend); -+ -+ rc = smsdvb_send_statistics_request(client); -+ -+ if (client->sms_stat_dvb.ReceptionData.InBandPwr < -95) -+ *strength = 0; -+ else if (client->sms_stat_dvb.ReceptionData.InBandPwr > -29) -+ *strength = 100; -+ else -+ *strength = -+ (client->sms_stat_dvb.ReceptionData.InBandPwr -+ + 95) * 3 / 2; -+ -+ led_feedback(client); -+ -+ return rc; -+} -+ -+static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) -+{ -+ int rc; -+ struct smsdvb_client_t *client; -+ client = container_of(fe, struct smsdvb_client_t, frontend); -+ -+ rc = smsdvb_send_statistics_request(client); -+ -+ *snr = client->sms_stat_dvb.ReceptionData.SNR; -+ -+ led_feedback(client); -+ -+ return rc; -+} -+ -+static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) -+{ -+ int rc; -+ struct smsdvb_client_t *client; -+ client = container_of(fe, struct smsdvb_client_t, frontend); -+ -+ rc = smsdvb_send_statistics_request(client); -+ -+ *ucblocks = client->sms_stat_dvb.ReceptionData.ErrorTSPackets; -+ -+ led_feedback(client); -+ -+ return rc; -+} -+ -+static int smsdvb_get_tune_settings(struct dvb_frontend *fe, -+ struct dvb_frontend_tune_settings *tune) -+{ -+ sms_debug(""); -+ -+ tune->min_delay_ms = 400; -+ tune->step_size = 250000; -+ tune->max_drift = 0; -+ return 0; -+} -+ -+static int smsdvb_dvbt_set_frontend(struct dvb_frontend *fe) -+{ -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ -+ struct { -+ struct SmsMsgHdr_ST Msg; -+ u32 Data[3]; -+ } Msg; -+ -+ int ret; -+ -+ client->fe_status = FE_HAS_SIGNAL; -+ client->event_fe_state = -1; -+ client->event_unc_state = -1; -+ fe->dtv_property_cache.delivery_system = SYS_DVBT; -+ -+ Msg.Msg.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ Msg.Msg.msgDstId = HIF_TASK; -+ Msg.Msg.msgFlags = 0; -+ Msg.Msg.msgType = MSG_SMS_RF_TUNE_REQ; -+ Msg.Msg.msgLength = sizeof(Msg); -+ Msg.Data[0] = c->frequency; -+ Msg.Data[2] = 12000000; -+ -+ sms_info("%s: freq %d band %d", __func__, c->frequency, -+ c->bandwidth_hz); -+ -+ switch (c->bandwidth_hz / 1000000) { -+ case 8: -+ Msg.Data[1] = BW_8_MHZ; -+ break; -+ case 7: -+ Msg.Data[1] = BW_7_MHZ; -+ break; -+ case 6: -+ Msg.Data[1] = BW_6_MHZ; -+ break; -+ case 0: -+ return -EOPNOTSUPP; -+ default: -+ return -EINVAL; -+ } -+ /* Disable LNA, if any. An error is returned if no LNA is present */ -+ ret = sms_board_lna_control(client->coredev, 0); -+ if (ret == 0) { -+ fe_status_t status; -+ -+ /* tune with LNA off at first */ -+ ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), -+ &client->tune_done); -+ -+ smsdvb_read_status(fe, &status); -+ -+ if (status & FE_HAS_LOCK) -+ return ret; -+ -+ /* previous tune didn't lock - enable LNA and tune again */ -+ sms_board_lna_control(client->coredev, 1); -+ } -+ -+ return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), -+ &client->tune_done); -+} -+ -+static int smsdvb_isdbt_set_frontend(struct dvb_frontend *fe) -+{ -+ struct dtv_frontend_properties *c = &fe->dtv_property_cache; -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ -+ struct { -+ struct SmsMsgHdr_ST Msg; -+ u32 Data[4]; -+ } Msg; -+ -+ fe->dtv_property_cache.delivery_system = SYS_ISDBT; -+ -+ Msg.Msg.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; -+ Msg.Msg.msgDstId = HIF_TASK; -+ Msg.Msg.msgFlags = 0; -+ Msg.Msg.msgType = MSG_SMS_ISDBT_TUNE_REQ; -+ Msg.Msg.msgLength = sizeof(Msg); -+ -+ if (c->isdbt_sb_segment_idx == -1) -+ c->isdbt_sb_segment_idx = 0; -+ -+ switch (c->isdbt_sb_segment_count) { -+ case 3: -+ Msg.Data[1] = BW_ISDBT_3SEG; -+ break; -+ case 1: -+ Msg.Data[1] = BW_ISDBT_1SEG; -+ break; -+ case 0: /* AUTO */ -+ switch (c->bandwidth_hz / 1000000) { -+ case 8: -+ case 7: -+ c->isdbt_sb_segment_count = 3; -+ Msg.Data[1] = BW_ISDBT_3SEG; -+ break; -+ case 6: -+ c->isdbt_sb_segment_count = 1; -+ Msg.Data[1] = BW_ISDBT_1SEG; -+ break; -+ default: /* Assumes 6 MHZ bw */ -+ c->isdbt_sb_segment_count = 1; -+ c->bandwidth_hz = 6000; -+ Msg.Data[1] = BW_ISDBT_1SEG; -+ break; -+ } -+ break; -+ default: -+ sms_info("Segment count %d not supported", c->isdbt_sb_segment_count); -+ return -EINVAL; -+ } -+ -+ Msg.Data[0] = c->frequency; -+ Msg.Data[2] = 12000000; -+ Msg.Data[3] = c->isdbt_sb_segment_idx; -+ -+ sms_info("%s: freq %d segwidth %d segindex %d\n", __func__, -+ c->frequency, c->isdbt_sb_segment_count, -+ c->isdbt_sb_segment_idx); -+ -+ return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), -+ &client->tune_done); -+} -+ -+static int smsdvb_set_frontend(struct dvb_frontend *fe) -+{ -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ struct smscore_device_t *coredev = client->coredev; -+ -+ switch (smscore_get_device_mode(coredev)) { -+ case DEVICE_MODE_DVBT: -+ case DEVICE_MODE_DVBT_BDA: -+ return smsdvb_dvbt_set_frontend(fe); -+ case DEVICE_MODE_ISDBT: -+ case DEVICE_MODE_ISDBT_BDA: -+ return smsdvb_isdbt_set_frontend(fe); -+ default: -+ return -EINVAL; -+ } -+} -+ -+static int smsdvb_get_frontend(struct dvb_frontend *fe) -+{ -+ struct dtv_frontend_properties *fep = &fe->dtv_property_cache; -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ struct smscore_device_t *coredev = client->coredev; -+ struct TRANSMISSION_STATISTICS_S *td = -+ &client->sms_stat_dvb.TransmissionData; -+ -+ switch (smscore_get_device_mode(coredev)) { -+ case DEVICE_MODE_DVBT: -+ case DEVICE_MODE_DVBT_BDA: -+ fep->frequency = td->Frequency; -+ -+ switch (td->Bandwidth) { -+ case 6: -+ fep->bandwidth_hz = 6000000; -+ break; -+ case 7: -+ fep->bandwidth_hz = 7000000; -+ break; -+ case 8: -+ fep->bandwidth_hz = 8000000; -+ break; -+ } -+ -+ switch (td->TransmissionMode) { -+ case 2: -+ fep->transmission_mode = TRANSMISSION_MODE_2K; -+ break; -+ case 8: -+ fep->transmission_mode = TRANSMISSION_MODE_8K; -+ } -+ -+ switch (td->GuardInterval) { -+ case 0: -+ fep->guard_interval = GUARD_INTERVAL_1_32; -+ break; -+ case 1: -+ fep->guard_interval = GUARD_INTERVAL_1_16; -+ break; -+ case 2: -+ fep->guard_interval = GUARD_INTERVAL_1_8; -+ break; -+ case 3: -+ fep->guard_interval = GUARD_INTERVAL_1_4; -+ break; -+ } -+ -+ switch (td->CodeRate) { -+ case 0: -+ fep->code_rate_HP = FEC_1_2; -+ break; -+ case 1: -+ fep->code_rate_HP = FEC_2_3; -+ break; -+ case 2: -+ fep->code_rate_HP = FEC_3_4; -+ break; -+ case 3: -+ fep->code_rate_HP = FEC_5_6; -+ break; -+ case 4: -+ fep->code_rate_HP = FEC_7_8; -+ break; -+ } -+ -+ switch (td->LPCodeRate) { -+ case 0: -+ fep->code_rate_LP = FEC_1_2; -+ break; -+ case 1: -+ fep->code_rate_LP = FEC_2_3; -+ break; -+ case 2: -+ fep->code_rate_LP = FEC_3_4; -+ break; -+ case 3: -+ fep->code_rate_LP = FEC_5_6; -+ break; -+ case 4: -+ fep->code_rate_LP = FEC_7_8; -+ break; -+ } -+ -+ switch (td->Constellation) { -+ case 0: -+ fep->modulation = QPSK; -+ break; -+ case 1: -+ fep->modulation = QAM_16; -+ break; -+ case 2: -+ fep->modulation = QAM_64; -+ break; -+ } -+ -+ switch (td->Hierarchy) { -+ case 0: -+ fep->hierarchy = HIERARCHY_NONE; -+ break; -+ case 1: -+ fep->hierarchy = HIERARCHY_1; -+ break; -+ case 2: -+ fep->hierarchy = HIERARCHY_2; -+ break; -+ case 3: -+ fep->hierarchy = HIERARCHY_4; -+ break; -+ } -+ -+ fep->inversion = INVERSION_AUTO; -+ break; -+ case DEVICE_MODE_ISDBT: -+ case DEVICE_MODE_ISDBT_BDA: -+ fep->frequency = td->Frequency; -+ fep->bandwidth_hz = 6000000; -+ /* todo: retrive the other parameters */ -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int smsdvb_init(struct dvb_frontend *fe) -+{ -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ -+ sms_board_power(client->coredev, 1); -+ -+ sms_board_dvb3_event(client, DVB3_EVENT_INIT); -+ return 0; -+} -+ -+static int smsdvb_sleep(struct dvb_frontend *fe) -+{ -+ struct smsdvb_client_t *client = -+ container_of(fe, struct smsdvb_client_t, frontend); -+ -+ sms_board_led_feedback(client->coredev, SMS_LED_OFF); -+ sms_board_power(client->coredev, 0); -+ -+ sms_board_dvb3_event(client, DVB3_EVENT_SLEEP); -+ -+ return 0; -+} -+ -+static void smsdvb_release(struct dvb_frontend *fe) -+{ -+ /* do nothing */ -+} -+ -+static struct dvb_frontend_ops smsdvb_fe_ops = { -+ .info = { -+ .name = "Siano Mobile Digital MDTV Receiver", -+ .frequency_min = 44250000, -+ .frequency_max = 867250000, -+ .frequency_stepsize = 250000, -+ .caps = FE_CAN_INVERSION_AUTO | -+ FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | -+ FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | -+ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | -+ FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | -+ FE_CAN_GUARD_INTERVAL_AUTO | -+ FE_CAN_RECOVER | -+ FE_CAN_HIERARCHY_AUTO, -+ }, -+ -+ .release = smsdvb_release, -+ -+ .set_frontend = smsdvb_set_frontend, -+ .get_frontend = smsdvb_get_frontend, -+ .get_tune_settings = smsdvb_get_tune_settings, -+ -+ .read_status = smsdvb_read_status, -+ .read_ber = smsdvb_read_ber, -+ .read_signal_strength = smsdvb_read_signal_strength, -+ .read_snr = smsdvb_read_snr, -+ .read_ucblocks = smsdvb_read_ucblocks, -+ -+ .init = smsdvb_init, -+ .sleep = smsdvb_sleep, -+}; -+ -+static int smsdvb_hotplug(struct smscore_device_t *coredev, -+ struct device *device, int arrival) -+{ -+ struct smsclient_params_t params; -+ struct smsdvb_client_t *client; -+ int rc; -+ -+ /* device removal handled by onremove callback */ -+ if (!arrival) -+ return 0; -+ client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL); -+ if (!client) { -+ sms_err("kmalloc() failed"); -+ return -ENOMEM; -+ } -+ -+ /* register dvb adapter */ -+ rc = dvb_register_adapter(&client->adapter, -+ sms_get_board( -+ smscore_get_board_id(coredev))->name, -+ THIS_MODULE, device, adapter_nr); -+ if (rc < 0) { -+ sms_err("dvb_register_adapter() failed %d", rc); -+ goto adapter_error; -+ } -+ -+ /* init dvb demux */ -+ client->demux.dmx.capabilities = DMX_TS_FILTERING; -+ client->demux.filternum = 32; /* todo: nova ??? */ -+ client->demux.feednum = 32; -+ client->demux.start_feed = smsdvb_start_feed; -+ client->demux.stop_feed = smsdvb_stop_feed; -+ -+ rc = dvb_dmx_init(&client->demux); -+ if (rc < 0) { -+ sms_err("dvb_dmx_init failed %d", rc); -+ goto dvbdmx_error; -+ } -+ -+ /* init dmxdev */ -+ client->dmxdev.filternum = 32; -+ client->dmxdev.demux = &client->demux.dmx; -+ client->dmxdev.capabilities = 0; -+ -+ rc = dvb_dmxdev_init(&client->dmxdev, &client->adapter); -+ if (rc < 0) { -+ sms_err("dvb_dmxdev_init failed %d", rc); -+ goto dmxdev_error; -+ } -+ -+ /* init and register frontend */ -+ memcpy(&client->frontend.ops, &smsdvb_fe_ops, -+ sizeof(struct dvb_frontend_ops)); -+ -+ switch (smscore_get_device_mode(coredev)) { -+ case DEVICE_MODE_DVBT: -+ case DEVICE_MODE_DVBT_BDA: -+ client->frontend.ops.delsys[0] = SYS_DVBT; -+ break; -+ case DEVICE_MODE_ISDBT: -+ case DEVICE_MODE_ISDBT_BDA: -+ client->frontend.ops.delsys[0] = SYS_ISDBT; -+ break; -+ } -+ -+ rc = dvb_register_frontend(&client->adapter, &client->frontend); -+ if (rc < 0) { -+ sms_err("frontend registration failed %d", rc); -+ goto frontend_error; -+ } -+ -+ params.initial_id = 1; -+ params.data_type = MSG_SMS_DVBT_BDA_DATA; -+ params.onresponse_handler = smsdvb_onresponse; -+ params.onremove_handler = smsdvb_onremove; -+ params.context = client; -+ -+ rc = smscore_register_client(coredev, ¶ms, &client->smsclient); -+ if (rc < 0) { -+ sms_err("smscore_register_client() failed %d", rc); -+ goto client_error; -+ } -+ -+ client->coredev = coredev; -+ -+ init_completion(&client->tune_done); -+ -+ kmutex_lock(&g_smsdvb_clientslock); -+ -+ list_add(&client->entry, &g_smsdvb_clients); -+ -+ kmutex_unlock(&g_smsdvb_clientslock); -+ -+ client->event_fe_state = -1; -+ client->event_unc_state = -1; -+ sms_board_dvb3_event(client, DVB3_EVENT_HOTPLUG); -+ -+ sms_info("success"); -+ sms_board_setup(coredev); -+ -+ return 0; -+ -+client_error: -+ dvb_unregister_frontend(&client->frontend); -+ -+frontend_error: -+ dvb_dmxdev_release(&client->dmxdev); -+ -+dmxdev_error: -+ dvb_dmx_release(&client->demux); -+ -+dvbdmx_error: -+ dvb_unregister_adapter(&client->adapter); -+ -+adapter_error: -+ kfree(client); -+ return rc; -+} -+ -+static int __init smsdvb_module_init(void) -+{ -+ int rc; -+ -+ INIT_LIST_HEAD(&g_smsdvb_clients); -+ kmutex_init(&g_smsdvb_clientslock); -+ -+ rc = smscore_register_hotplug(smsdvb_hotplug); -+ -+ sms_debug(""); -+ -+ return rc; -+} -+ -+static void __exit smsdvb_module_exit(void) -+{ -+ smscore_unregister_hotplug(smsdvb_hotplug); -+ -+ kmutex_lock(&g_smsdvb_clientslock); -+ -+ while (!list_empty(&g_smsdvb_clients)) -+ smsdvb_unregister_client( -+ (struct smsdvb_client_t *) g_smsdvb_clients.next); -+ -+ kmutex_unlock(&g_smsdvb_clientslock); -+} -+ -+module_init(smsdvb_module_init); -+module_exit(smsdvb_module_exit); -+ -+MODULE_DESCRIPTION("SMS DVB subsystem adaptation module"); -+MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); -+MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c -new file mode 100644 -index 0000000..e2657c2 ---- /dev/null -+++ b/drivers/media/common/siano/smsendian.c -@@ -0,0 +1,103 @@ -+/**************************************************************** -+ -+ Siano Mobile Silicon, Inc. -+ MDTV receiver kernel modules. -+ Copyright (C) 2006-2009, Uri Shkolnik -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ ****************************************************************/ -+ -+#include -+#include -+ -+#include "smsendian.h" -+#include "smscoreapi.h" -+ -+void smsendian_handle_tx_message(void *buffer) -+{ -+#ifdef __BIG_ENDIAN -+ struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer; -+ int i; -+ int msgWords; -+ -+ switch (msg->xMsgHeader.msgType) { -+ case MSG_SMS_DATA_DOWNLOAD_REQ: -+ { -+ msg->msgData[0] = le32_to_cpu(msg->msgData[0]); -+ break; -+ } -+ -+ default: -+ msgWords = (msg->xMsgHeader.msgLength - -+ sizeof(struct SmsMsgHdr_ST))/4; -+ -+ for (i = 0; i < msgWords; i++) -+ msg->msgData[i] = le32_to_cpu(msg->msgData[i]); -+ -+ break; -+ } -+#endif /* __BIG_ENDIAN */ -+} -+EXPORT_SYMBOL_GPL(smsendian_handle_tx_message); -+ -+void smsendian_handle_rx_message(void *buffer) -+{ -+#ifdef __BIG_ENDIAN -+ struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer; -+ int i; -+ int msgWords; -+ -+ switch (msg->xMsgHeader.msgType) { -+ case MSG_SMS_GET_VERSION_EX_RES: -+ { -+ struct SmsVersionRes_ST *ver = -+ (struct SmsVersionRes_ST *) msg; -+ ver->ChipModel = le16_to_cpu(ver->ChipModel); -+ break; -+ } -+ -+ case MSG_SMS_DVBT_BDA_DATA: -+ case MSG_SMS_DAB_CHANNEL: -+ case MSG_SMS_DATA_MSG: -+ { -+ break; -+ } -+ -+ default: -+ { -+ msgWords = (msg->xMsgHeader.msgLength - -+ sizeof(struct SmsMsgHdr_ST))/4; -+ -+ for (i = 0; i < msgWords; i++) -+ msg->msgData[i] = le32_to_cpu(msg->msgData[i]); -+ -+ break; -+ } -+ } -+#endif /* __BIG_ENDIAN */ -+} -+EXPORT_SYMBOL_GPL(smsendian_handle_rx_message); -+ -+void smsendian_handle_message_header(void *msg) -+{ -+#ifdef __BIG_ENDIAN -+ struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)msg; -+ -+ phdr->msgType = le16_to_cpu(phdr->msgType); -+ phdr->msgLength = le16_to_cpu(phdr->msgLength); -+ phdr->msgFlags = le16_to_cpu(phdr->msgFlags); -+#endif /* __BIG_ENDIAN */ -+} -+EXPORT_SYMBOL_GPL(smsendian_handle_message_header); -diff --git a/drivers/media/common/siano/smsendian.h b/drivers/media/common/siano/smsendian.h -new file mode 100644 -index 0000000..1624d6f ---- /dev/null -+++ b/drivers/media/common/siano/smsendian.h -@@ -0,0 +1,32 @@ -+/**************************************************************** -+ -+Siano Mobile Silicon, Inc. -+MDTV receiver kernel modules. -+Copyright (C) 2006-2009, Uri Shkolnik -+ -+This program is free software: you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation, either version 2 of the License, or -+(at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program. If not, see . -+ -+****************************************************************/ -+ -+#ifndef __SMS_ENDIAN_H__ -+#define __SMS_ENDIAN_H__ -+ -+#include -+ -+extern void smsendian_handle_tx_message(void *buffer); -+extern void smsendian_handle_rx_message(void *buffer); -+extern void smsendian_handle_message_header(void *msg); -+ -+#endif /* __SMS_ENDIAN_H__ */ -+ -diff --git a/drivers/media/common/siano/smsir.c b/drivers/media/common/siano/smsir.c -new file mode 100644 -index 0000000..b8c5cad ---- /dev/null -+++ b/drivers/media/common/siano/smsir.c -@@ -0,0 +1,114 @@ -+/**************************************************************** -+ -+ Siano Mobile Silicon, Inc. -+ MDTV receiver kernel modules. -+ Copyright (C) 2006-2009, Uri Shkolnik -+ -+ Copyright (c) 2010 - Mauro Carvalho Chehab -+ - Ported the driver to use rc-core -+ - IR raw event decoding is now done at rc-core -+ - Code almost re-written -+ -+ This program is free software: you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation, either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ ****************************************************************/ -+ -+ -+#include -+#include -+ -+#include "smscoreapi.h" -+#include "smsir.h" -+#include "sms-cards.h" -+ -+#define MODULE_NAME "smsmdtv" -+ -+void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len) -+{ -+ int i; -+ const s32 *samples = (const void *)buf; -+ -+ for (i = 0; i < len >> 2; i++) { -+ DEFINE_IR_RAW_EVENT(ev); -+ -+ ev.duration = abs(samples[i]) * 1000; /* Convert to ns */ -+ ev.pulse = (samples[i] > 0) ? false : true; -+ -+ ir_raw_event_store(coredev->ir.dev, &ev); -+ } -+ ir_raw_event_handle(coredev->ir.dev); -+} -+ -+int sms_ir_init(struct smscore_device_t *coredev) -+{ -+ int err; -+ int board_id = smscore_get_board_id(coredev); -+ struct rc_dev *dev; -+ -+ sms_log("Allocating rc device"); -+ dev = rc_allocate_device(); -+ if (!dev) { -+ sms_err("Not enough memory"); -+ return -ENOMEM; -+ } -+ -+ coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ -+ coredev->ir.timeout = IR_DEFAULT_TIMEOUT; -+ sms_log("IR port %d, timeout %d ms", -+ coredev->ir.controller, coredev->ir.timeout); -+ -+ snprintf(coredev->ir.name, sizeof(coredev->ir.name), -+ "SMS IR (%s)", sms_get_board(board_id)->name); -+ -+ strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys)); -+ strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys)); -+ -+ dev->input_name = coredev->ir.name; -+ dev->input_phys = coredev->ir.phys; -+ dev->dev.parent = coredev->device; -+ -+#if 0 -+ /* TODO: properly initialize the parameters bellow */ -+ dev->input_id.bustype = BUS_USB; -+ dev->input_id.version = 1; -+ dev->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); -+ dev->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); -+#endif -+ -+ dev->priv = coredev; -+ dev->driver_type = RC_DRIVER_IR_RAW; -+ dev->allowed_protos = RC_BIT_ALL; -+ dev->map_name = sms_get_board(board_id)->rc_codes; -+ dev->driver_name = MODULE_NAME; -+ -+ sms_log("Input device (IR) %s is set for key events", dev->input_name); -+ -+ err = rc_register_device(dev); -+ if (err < 0) { -+ sms_err("Failed to register device"); -+ rc_free_device(dev); -+ return err; -+ } -+ -+ coredev->ir.dev = dev; -+ return 0; -+} -+ -+void sms_ir_exit(struct smscore_device_t *coredev) -+{ -+ if (coredev->ir.dev) -+ rc_unregister_device(coredev->ir.dev); -+ -+ sms_log(""); -+} -diff --git a/drivers/media/common/siano/smsir.h b/drivers/media/common/siano/smsir.h -new file mode 100644 -index 0000000..69b59b9 ---- /dev/null -+++ b/drivers/media/common/siano/smsir.h -@@ -0,0 +1,64 @@ -+/**************************************************************** -+ -+Siano Mobile Silicon, Inc. -+MDTV receiver kernel modules. -+Copyright (C) 2006-2009, Uri Shkolnik -+ -+ Copyright (c) 2010 - Mauro Carvalho Chehab -+ - Ported the driver to use rc-core -+ - IR raw event decoding is now done at rc-core -+ - Code almost re-written -+ -+This program is free software: you can redistribute it and/or modify -+it under the terms of the GNU General Public License as published by -+the Free Software Foundation, either version 2 of the License, or -+(at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+but WITHOUT ANY WARRANTY; without even the implied warranty of -+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this program. If not, see . -+ -+****************************************************************/ -+ -+#ifndef __SMS_IR_H__ -+#define __SMS_IR_H__ -+ -+#include -+#include -+ -+#define IR_DEFAULT_TIMEOUT 100 -+ -+struct smscore_device_t; -+ -+struct ir_t { -+ struct rc_dev *dev; -+ char name[40]; -+ char phys[32]; -+ -+ char *rc_codes; -+ u64 protocol; -+ -+ u32 timeout; -+ u32 controller; -+}; -+ -+#ifdef CONFIG_SMS_SIANO_RC -+int sms_ir_init(struct smscore_device_t *coredev); -+void sms_ir_exit(struct smscore_device_t *coredev); -+void sms_ir_event(struct smscore_device_t *coredev, -+ const char *buf, int len); -+#else -+inline static int sms_ir_init(struct smscore_device_t *coredev) { -+ return 0; -+} -+inline static void sms_ir_exit(struct smscore_device_t *coredev) {}; -+inline static void sms_ir_event(struct smscore_device_t *coredev, -+ const char *buf, int len) {}; -+#endif -+ -+#endif /* __SMS_IR_H__ */ -+ -diff --git a/drivers/media/common/tuners/Kconfig b/drivers/media/common/tuners/Kconfig -deleted file mode 100644 -index 4a6d5ce..0000000 ---- a/drivers/media/common/tuners/Kconfig -+++ /dev/null -@@ -1,214 +0,0 @@ --config MEDIA_ATTACH -- bool "Load and attach frontend and tuner driver modules as needed" -- depends on VIDEO_MEDIA -- depends on MODULES -- help -- Remove the static dependency of DVB card drivers on all -- frontend modules for all possible card variants. Instead, -- allow the card drivers to only load the frontend modules -- they require. -- -- Also, tuner module will automatically load a tuner driver -- when needed, for analog mode. -- -- This saves several KBytes of memory. -- -- Note: You will need module-init-tools v3.2 or later for this feature. -- -- If unsure say Y. -- --config MEDIA_TUNER -- tristate -- default VIDEO_MEDIA && I2C -- depends on VIDEO_MEDIA && I2C -- select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE && EXPERIMENTAL -- select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE -- select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE -- --config MEDIA_TUNER_CUSTOMISE -- bool "Customize analog and hybrid tuner modules to build" -- depends on MEDIA_TUNER -- default y if EXPERT -- help -- This allows the user to deselect tuner drivers unnecessary -- for their hardware from the build. Use this option with care -- as deselecting tuner drivers which are in fact necessary will -- result in V4L/DVB devices which cannot be tuned due to lack of -- driver support -- -- If unsure say N. -- --menu "Customize TV tuners" -- visible if MEDIA_TUNER_CUSTOMISE -- --config MEDIA_TUNER_SIMPLE -- tristate "Simple tuner support" -- depends on VIDEO_MEDIA && I2C -- select MEDIA_TUNER_TDA9887 -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for various simple tuners. -- --config MEDIA_TUNER_TDA8290 -- tristate "TDA 8290/8295 + 8275(a)/18271 tuner combo" -- depends on VIDEO_MEDIA && I2C -- select MEDIA_TUNER_TDA827X -- select MEDIA_TUNER_TDA18271 -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for Philips TDA8290+8275(a) tuner. -- --config MEDIA_TUNER_TDA827X -- tristate "Philips TDA827X silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A DVB-T silicon tuner module. Say Y when you want to support this tuner. -- --config MEDIA_TUNER_TDA18271 -- tristate "NXP TDA18271 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A silicon tuner module. Say Y when you want to support this tuner. -- --config MEDIA_TUNER_TDA9887 -- tristate "TDA 9885/6/7 analog IF demodulator" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for Philips TDA9885/6/7 -- analog IF demodulator. -- --config MEDIA_TUNER_TEA5761 -- tristate "TEA 5761 radio tuner (EXPERIMENTAL)" -- depends on VIDEO_MEDIA && I2C -- depends on EXPERIMENTAL -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for the Philips TEA5761 radio tuner. -- --config MEDIA_TUNER_TEA5767 -- tristate "TEA 5767 radio tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for the Philips TEA5767 radio tuner. -- --config MEDIA_TUNER_MT20XX -- tristate "Microtune 2032 / 2050 tuners" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for the MT2032 / MT2050 tuner. -- --config MEDIA_TUNER_MT2060 -- tristate "Microtune MT2060 silicon IF tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon IF tuner MT2060 from Microtune. -- --config MEDIA_TUNER_MT2063 -- tristate "Microtune MT2063 silicon IF tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon IF tuner MT2063 from Microtune. -- --config MEDIA_TUNER_MT2266 -- tristate "Microtune MT2266 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon baseband tuner MT2266 from Microtune. -- --config MEDIA_TUNER_MT2131 -- tristate "Microtune MT2131 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon baseband tuner MT2131 from Microtune. -- --config MEDIA_TUNER_QT1010 -- tristate "Quantek QT1010 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner QT1010 from Quantek. -- --config MEDIA_TUNER_XC2028 -- tristate "XCeive xc2028/xc3028 tuners" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to include support for the xc2028/xc3028 tuners. -- --config MEDIA_TUNER_XC5000 -- tristate "Xceive XC5000 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner XC5000 from Xceive. -- This device is only used inside a SiP called together with a -- demodulator for now. -- --config MEDIA_TUNER_XC4000 -- tristate "Xceive XC4000 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner XC4000 from Xceive. -- This device is only used inside a SiP called together with a -- demodulator for now. -- --config MEDIA_TUNER_MXL5005S -- tristate "MaxLinear MSL5005S silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner MXL5005S from MaxLinear. -- --config MEDIA_TUNER_MXL5007T -- tristate "MaxLinear MxL5007T silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner MxL5007T from MaxLinear. -- --config MEDIA_TUNER_MC44S803 -- tristate "Freescale MC44S803 Low Power CMOS Broadband tuners" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- Say Y here to support the Freescale MC44S803 based tuners -- --config MEDIA_TUNER_MAX2165 -- tristate "Maxim MAX2165 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- A driver for the silicon tuner MAX2165 from Maxim. -- --config MEDIA_TUNER_TDA18218 -- tristate "NXP TDA18218 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- NXP TDA18218 silicon tuner driver. -- --config MEDIA_TUNER_TDA18212 -- tristate "NXP TDA18212 silicon tuner" -- depends on VIDEO_MEDIA && I2C -- default m if MEDIA_TUNER_CUSTOMISE -- help -- NXP TDA18212 silicon tuner driver. -- --endmenu -diff --git a/drivers/media/common/tuners/Makefile b/drivers/media/common/tuners/Makefile -deleted file mode 100644 -index 8295854..0000000 ---- a/drivers/media/common/tuners/Makefile -+++ /dev/null -@@ -1,33 +0,0 @@ --# --# Makefile for common V4L/DVB tuners --# -- --tda18271-objs := tda18271-maps.o tda18271-common.o tda18271-fe.o -- --obj-$(CONFIG_MEDIA_TUNER_XC2028) += tuner-xc2028.o --obj-$(CONFIG_MEDIA_TUNER_SIMPLE) += tuner-simple.o --# tuner-types will be merged into tuner-simple, in the future --obj-$(CONFIG_MEDIA_TUNER_SIMPLE) += tuner-types.o --obj-$(CONFIG_MEDIA_TUNER_MT20XX) += mt20xx.o --obj-$(CONFIG_MEDIA_TUNER_TDA8290) += tda8290.o --obj-$(CONFIG_MEDIA_TUNER_TEA5767) += tea5767.o --obj-$(CONFIG_MEDIA_TUNER_TEA5761) += tea5761.o --obj-$(CONFIG_MEDIA_TUNER_TDA9887) += tda9887.o --obj-$(CONFIG_MEDIA_TUNER_TDA827X) += tda827x.o --obj-$(CONFIG_MEDIA_TUNER_TDA18271) += tda18271.o --obj-$(CONFIG_MEDIA_TUNER_XC5000) += xc5000.o --obj-$(CONFIG_MEDIA_TUNER_XC4000) += xc4000.o --obj-$(CONFIG_MEDIA_TUNER_MT2060) += mt2060.o --obj-$(CONFIG_MEDIA_TUNER_MT2063) += mt2063.o --obj-$(CONFIG_MEDIA_TUNER_MT2266) += mt2266.o --obj-$(CONFIG_MEDIA_TUNER_QT1010) += qt1010.o --obj-$(CONFIG_MEDIA_TUNER_MT2131) += mt2131.o --obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o --obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o --obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o --obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o --obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o --obj-$(CONFIG_MEDIA_TUNER_TDA18212) += tda18212.o -- --ccflags-y += -Idrivers/media/dvb/dvb-core --ccflags-y += -Idrivers/media/dvb/frontends -diff --git a/drivers/media/common/tuners/max2165.c b/drivers/media/common/tuners/max2165.c -deleted file mode 100644 -index cb2c98f..0000000 ---- a/drivers/media/common/tuners/max2165.c -+++ /dev/null -@@ -1,430 +0,0 @@ --/* -- * Driver for Maxim MAX2165 silicon tuner -- * -- * Copyright (c) 2009 David T. L. Wong -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -- */ -- --#include --#include --#include --#include --#include --#include --#include -- --#include "dvb_frontend.h" -- --#include "max2165.h" --#include "max2165_priv.h" --#include "tuner-i2c.h" -- --#define dprintk(args...) \ -- do { \ -- if (debug) \ -- printk(KERN_DEBUG "max2165: " args); \ -- } while (0) -- --static int debug; --module_param(debug, int, 0644); --MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); -- --static int max2165_write_reg(struct max2165_priv *priv, u8 reg, u8 data) --{ -- int ret; -- u8 buf[] = { reg, data }; -- struct i2c_msg msg = { .flags = 0, .buf = buf, .len = 2 }; -- -- msg.addr = priv->config->i2c_address; -- -- if (debug >= 2) -- dprintk("%s: reg=0x%02X, data=0x%02X\n", __func__, reg, data); -- -- ret = i2c_transfer(priv->i2c, &msg, 1); -- -- if (ret != 1) -- dprintk("%s: error reg=0x%x, data=0x%x, ret=%i\n", -- __func__, reg, data, ret); -- -- return (ret != 1) ? -EIO : 0; --} -- --static int max2165_read_reg(struct max2165_priv *priv, u8 reg, u8 *p_data) --{ -- int ret; -- u8 dev_addr = priv->config->i2c_address; -- -- u8 b0[] = { reg }; -- u8 b1[] = { 0 }; -- struct i2c_msg msg[] = { -- { .addr = dev_addr, .flags = 0, .buf = b0, .len = 1 }, -- { .addr = dev_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 }, -- }; -- -- ret = i2c_transfer(priv->i2c, msg, 2); -- if (ret != 2) { -- dprintk("%s: error reg=0x%x, ret=%i\n", __func__, reg, ret); -- return -EIO; -- } -- -- *p_data = b1[0]; -- if (debug >= 2) -- dprintk("%s: reg=0x%02X, data=0x%02X\n", -- __func__, reg, b1[0]); -- return 0; --} -- --static int max2165_mask_write_reg(struct max2165_priv *priv, u8 reg, -- u8 mask, u8 data) --{ -- int ret; -- u8 v; -- -- data &= mask; -- ret = max2165_read_reg(priv, reg, &v); -- if (ret != 0) -- return ret; -- v &= ~mask; -- v |= data; -- ret = max2165_write_reg(priv, reg, v); -- -- return ret; --} -- --static int max2165_read_rom_table(struct max2165_priv *priv) --{ -- u8 dat[3]; -- int i; -- -- for (i = 0; i < 3; i++) { -- max2165_write_reg(priv, REG_ROM_TABLE_ADDR, i + 1); -- max2165_read_reg(priv, REG_ROM_TABLE_DATA, &dat[i]); -- } -- -- priv->tf_ntch_low_cfg = dat[0] >> 4; -- priv->tf_ntch_hi_cfg = dat[0] & 0x0F; -- priv->tf_balun_low_ref = dat[1] & 0x0F; -- priv->tf_balun_hi_ref = dat[1] >> 4; -- priv->bb_filter_7mhz_cfg = dat[2] & 0x0F; -- priv->bb_filter_8mhz_cfg = dat[2] >> 4; -- -- dprintk("tf_ntch_low_cfg = 0x%X\n", priv->tf_ntch_low_cfg); -- dprintk("tf_ntch_hi_cfg = 0x%X\n", priv->tf_ntch_hi_cfg); -- dprintk("tf_balun_low_ref = 0x%X\n", priv->tf_balun_low_ref); -- dprintk("tf_balun_hi_ref = 0x%X\n", priv->tf_balun_hi_ref); -- dprintk("bb_filter_7mhz_cfg = 0x%X\n", priv->bb_filter_7mhz_cfg); -- dprintk("bb_filter_8mhz_cfg = 0x%X\n", priv->bb_filter_8mhz_cfg); -- -- return 0; --} -- --static int max2165_set_osc(struct max2165_priv *priv, u8 osc /*MHz*/) --{ -- u8 v; -- -- v = (osc / 2); -- if (v == 2) -- v = 0x7; -- else -- v -= 8; -- -- max2165_mask_write_reg(priv, REG_PLL_CFG, 0x07, v); -- -- return 0; --} -- --static int max2165_set_bandwidth(struct max2165_priv *priv, u32 bw) --{ -- u8 val; -- -- if (bw == 8000000) -- val = priv->bb_filter_8mhz_cfg; -- else -- val = priv->bb_filter_7mhz_cfg; -- -- max2165_mask_write_reg(priv, REG_BASEBAND_CTRL, 0xF0, val << 4); -- -- return 0; --} -- --int fixpt_div32(u32 dividend, u32 divisor, u32 *quotient, u32 *fraction) --{ -- u32 remainder; -- u32 q, f = 0; -- int i; -- -- if (0 == divisor) -- return -1; -- -- q = dividend / divisor; -- remainder = dividend - q * divisor; -- -- for (i = 0; i < 31; i++) { -- remainder <<= 1; -- if (remainder >= divisor) { -- f += 1; -- remainder -= divisor; -- } -- f <<= 1; -- } -- -- *quotient = q; -- *fraction = f; -- -- return 0; --} -- --static int max2165_set_rf(struct max2165_priv *priv, u32 freq) --{ -- u8 tf; -- u8 tf_ntch; -- u32 t; -- u32 quotient, fraction; -- -- /* Set PLL divider according to RF frequency */ -- fixpt_div32(freq / 1000, priv->config->osc_clk * 1000, -- "ient, &fraction); -- -- /* 20-bit fraction */ -- fraction >>= 12; -- -- max2165_write_reg(priv, REG_NDIV_INT, quotient); -- max2165_mask_write_reg(priv, REG_NDIV_FRAC2, 0x0F, fraction >> 16); -- max2165_write_reg(priv, REG_NDIV_FRAC1, fraction >> 8); -- max2165_write_reg(priv, REG_NDIV_FRAC0, fraction); -- -- /* Norch Filter */ -- tf_ntch = (freq < 725000000) ? -- priv->tf_ntch_low_cfg : priv->tf_ntch_hi_cfg; -- -- /* Tracking filter balun */ -- t = priv->tf_balun_low_ref; -- t += (priv->tf_balun_hi_ref - priv->tf_balun_low_ref) -- * (freq / 1000 - 470000) / (780000 - 470000); -- -- tf = t; -- dprintk("tf = %X\n", tf); -- tf |= tf_ntch << 4; -- -- max2165_write_reg(priv, REG_TRACK_FILTER, tf); -- -- return 0; --} -- --static void max2165_debug_status(struct max2165_priv *priv) --{ -- u8 status, autotune; -- u8 auto_vco_success, auto_vco_active; -- u8 pll_locked; -- u8 dc_offset_low, dc_offset_hi; -- u8 signal_lv_over_threshold; -- u8 vco, vco_sub_band, adc; -- -- max2165_read_reg(priv, REG_STATUS, &status); -- max2165_read_reg(priv, REG_AUTOTUNE, &autotune); -- -- auto_vco_success = (status >> 6) & 0x01; -- auto_vco_active = (status >> 5) & 0x01; -- pll_locked = (status >> 4) & 0x01; -- dc_offset_low = (status >> 3) & 0x01; -- dc_offset_hi = (status >> 2) & 0x01; -- signal_lv_over_threshold = status & 0x01; -- -- vco = autotune >> 6; -- vco_sub_band = (autotune >> 3) & 0x7; -- adc = autotune & 0x7; -- -- dprintk("auto VCO active: %d, auto VCO success: %d\n", -- auto_vco_active, auto_vco_success); -- dprintk("PLL locked: %d\n", pll_locked); -- dprintk("DC offset low: %d, DC offset high: %d\n", -- dc_offset_low, dc_offset_hi); -- dprintk("Signal lvl over threshold: %d\n", signal_lv_over_threshold); -- dprintk("VCO: %d, VCO Sub-band: %d, ADC: %d\n", vco, vco_sub_band, adc); --} -- --static int max2165_set_params(struct dvb_frontend *fe) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -- int ret; -- -- switch (c->bandwidth_hz) { -- case 7000000: -- case 8000000: -- priv->frequency = c->frequency; -- break; -- default: -- printk(KERN_INFO "MAX2165: bandwidth %d Hz not supported.\n", -- c->bandwidth_hz); -- return -EINVAL; -- } -- -- dprintk("%s() frequency=%d\n", __func__, c->frequency); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- max2165_set_bandwidth(priv, c->bandwidth_hz); -- ret = max2165_set_rf(priv, priv->frequency); -- mdelay(50); -- max2165_debug_status(priv); -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- if (ret != 0) -- return -EREMOTEIO; -- -- return 0; --} -- --static int max2165_get_frequency(struct dvb_frontend *fe, u32 *freq) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- dprintk("%s()\n", __func__); -- *freq = priv->frequency; -- return 0; --} -- --static int max2165_get_bandwidth(struct dvb_frontend *fe, u32 *bw) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- dprintk("%s()\n", __func__); -- -- *bw = priv->bandwidth; -- return 0; --} -- --static int max2165_get_status(struct dvb_frontend *fe, u32 *status) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- u16 lock_status = 0; -- -- dprintk("%s()\n", __func__); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- -- max2165_debug_status(priv); -- *status = lock_status; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- return 0; --} -- --static int max2165_sleep(struct dvb_frontend *fe) --{ -- dprintk("%s()\n", __func__); -- return 0; --} -- --static int max2165_init(struct dvb_frontend *fe) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- dprintk("%s()\n", __func__); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- -- /* Setup initial values */ -- /* Fractional Mode on */ -- max2165_write_reg(priv, REG_NDIV_FRAC2, 0x18); -- /* LNA on */ -- max2165_write_reg(priv, REG_LNA, 0x01); -- max2165_write_reg(priv, REG_PLL_CFG, 0x7A); -- max2165_write_reg(priv, REG_TEST, 0x08); -- max2165_write_reg(priv, REG_SHUTDOWN, 0x40); -- max2165_write_reg(priv, REG_VCO_CTRL, 0x84); -- max2165_write_reg(priv, REG_BASEBAND_CTRL, 0xC3); -- max2165_write_reg(priv, REG_DC_OFFSET_CTRL, 0x75); -- max2165_write_reg(priv, REG_DC_OFFSET_DAC, 0x00); -- max2165_write_reg(priv, REG_ROM_TABLE_ADDR, 0x00); -- -- max2165_set_osc(priv, priv->config->osc_clk); -- -- max2165_read_rom_table(priv); -- -- max2165_set_bandwidth(priv, 8000000); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- return 0; --} -- --static int max2165_release(struct dvb_frontend *fe) --{ -- struct max2165_priv *priv = fe->tuner_priv; -- dprintk("%s()\n", __func__); -- -- kfree(priv); -- fe->tuner_priv = NULL; -- -- return 0; --} -- --static const struct dvb_tuner_ops max2165_tuner_ops = { -- .info = { -- .name = "Maxim MAX2165", -- .frequency_min = 470000000, -- .frequency_max = 780000000, -- .frequency_step = 50000, -- }, -- -- .release = max2165_release, -- .init = max2165_init, -- .sleep = max2165_sleep, -- -- .set_params = max2165_set_params, -- .set_analog_params = NULL, -- .get_frequency = max2165_get_frequency, -- .get_bandwidth = max2165_get_bandwidth, -- .get_status = max2165_get_status --}; -- --struct dvb_frontend *max2165_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, -- struct max2165_config *cfg) --{ -- struct max2165_priv *priv = NULL; -- -- dprintk("%s(%d-%04x)\n", __func__, -- i2c ? i2c_adapter_id(i2c) : -1, -- cfg ? cfg->i2c_address : -1); -- -- priv = kzalloc(sizeof(struct max2165_priv), GFP_KERNEL); -- if (priv == NULL) -- return NULL; -- -- memcpy(&fe->ops.tuner_ops, &max2165_tuner_ops, -- sizeof(struct dvb_tuner_ops)); -- -- priv->config = cfg; -- priv->i2c = i2c; -- fe->tuner_priv = priv; -- -- max2165_init(fe); -- max2165_debug_status(priv); -- -- return fe; --} --EXPORT_SYMBOL(max2165_attach); -- --MODULE_AUTHOR("David T. L. Wong "); --MODULE_DESCRIPTION("Maxim MAX2165 silicon tuner driver"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/tuners/max2165.h b/drivers/media/common/tuners/max2165.h -deleted file mode 100644 -index c063c36..0000000 ---- a/drivers/media/common/tuners/max2165.h -+++ /dev/null -@@ -1,48 +0,0 @@ --/* -- * Driver for Maxim MAX2165 silicon tuner -- * -- * Copyright (c) 2009 David T. L. Wong -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -- */ -- --#ifndef __MAX2165_H__ --#define __MAX2165_H__ -- --struct dvb_frontend; --struct i2c_adapter; -- --struct max2165_config { -- u8 i2c_address; -- u8 osc_clk; /* in MHz, selectable values: 4,16,18,20,22,24,26,28 */ --}; -- --#if defined(CONFIG_MEDIA_TUNER_MAX2165) || \ -- (defined(CONFIG_MEDIA_TUNER_MAX2165_MODULE) && defined(MODULE)) --extern struct dvb_frontend *max2165_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, -- struct max2165_config *cfg); --#else --static inline struct dvb_frontend *max2165_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, -- struct max2165_config *cfg) --{ -- printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); -- return NULL; --} --#endif -- --#endif -diff --git a/drivers/media/common/tuners/max2165_priv.h b/drivers/media/common/tuners/max2165_priv.h -deleted file mode 100644 -index 91bbe02..0000000 ---- a/drivers/media/common/tuners/max2165_priv.h -+++ /dev/null -@@ -1,60 +0,0 @@ --/* -- * Driver for Maxim MAX2165 silicon tuner -- * -- * Copyright (c) 2009 David T. L. Wong -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -- */ -- --#ifndef __MAX2165_PRIV_H__ --#define __MAX2165_PRIV_H__ -- --#define REG_NDIV_INT 0x00 --#define REG_NDIV_FRAC2 0x01 --#define REG_NDIV_FRAC1 0x02 --#define REG_NDIV_FRAC0 0x03 --#define REG_TRACK_FILTER 0x04 --#define REG_LNA 0x05 --#define REG_PLL_CFG 0x06 --#define REG_TEST 0x07 --#define REG_SHUTDOWN 0x08 --#define REG_VCO_CTRL 0x09 --#define REG_BASEBAND_CTRL 0x0A --#define REG_DC_OFFSET_CTRL 0x0B --#define REG_DC_OFFSET_DAC 0x0C --#define REG_ROM_TABLE_ADDR 0x0D -- --/* Read Only Registers */ --#define REG_ROM_TABLE_DATA 0x10 --#define REG_STATUS 0x11 --#define REG_AUTOTUNE 0x12 -- --struct max2165_priv { -- struct max2165_config *config; -- struct i2c_adapter *i2c; -- -- u32 frequency; -- u32 bandwidth; -- -- u8 tf_ntch_low_cfg; -- u8 tf_ntch_hi_cfg; -- u8 tf_balun_low_ref; -- u8 tf_balun_hi_ref; -- u8 bb_filter_7mhz_cfg; -- u8 bb_filter_8mhz_cfg; --}; -- --#endif -diff --git a/drivers/media/common/tuners/mc44s803.c b/drivers/media/common/tuners/mc44s803.c -deleted file mode 100644 -index 5ddce7e..0000000 ---- a/drivers/media/common/tuners/mc44s803.c -+++ /dev/null -@@ -1,372 +0,0 @@ --/* -- * Driver for Freescale MC44S803 Low Power CMOS Broadband Tuner -- * -- * Copyright (c) 2009 Jochen Friedrich -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --#include --#include --#include --#include --#include -- --#include "dvb_frontend.h" -- --#include "mc44s803.h" --#include "mc44s803_priv.h" -- --#define mc_printk(level, format, arg...) \ -- printk(level "mc44s803: " format , ## arg) -- --/* Writes a single register */ --static int mc44s803_writereg(struct mc44s803_priv *priv, u32 val) --{ -- u8 buf[3]; -- struct i2c_msg msg = { -- .addr = priv->cfg->i2c_address, .flags = 0, .buf = buf, .len = 3 -- }; -- -- buf[0] = (val & 0xff0000) >> 16; -- buf[1] = (val & 0xff00) >> 8; -- buf[2] = (val & 0xff); -- -- if (i2c_transfer(priv->i2c, &msg, 1) != 1) { -- mc_printk(KERN_WARNING, "I2C write failed\n"); -- return -EREMOTEIO; -- } -- return 0; --} -- --/* Reads a single register */ --static int mc44s803_readreg(struct mc44s803_priv *priv, u8 reg, u32 *val) --{ -- u32 wval; -- u8 buf[3]; -- int ret; -- struct i2c_msg msg[] = { -- { .addr = priv->cfg->i2c_address, .flags = I2C_M_RD, -- .buf = buf, .len = 3 }, -- }; -- -- wval = MC44S803_REG_SM(MC44S803_REG_DATAREG, MC44S803_ADDR) | -- MC44S803_REG_SM(reg, MC44S803_D); -- -- ret = mc44s803_writereg(priv, wval); -- if (ret) -- return ret; -- -- if (i2c_transfer(priv->i2c, msg, 1) != 1) { -- mc_printk(KERN_WARNING, "I2C read failed\n"); -- return -EREMOTEIO; -- } -- -- *val = (buf[0] << 16) | (buf[1] << 8) | buf[2]; -- -- return 0; --} -- --static int mc44s803_release(struct dvb_frontend *fe) --{ -- struct mc44s803_priv *priv = fe->tuner_priv; -- -- fe->tuner_priv = NULL; -- kfree(priv); -- -- return 0; --} -- --static int mc44s803_init(struct dvb_frontend *fe) --{ -- struct mc44s803_priv *priv = fe->tuner_priv; -- u32 val; -- int err; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- --/* Reset chip */ -- val = MC44S803_REG_SM(MC44S803_REG_RESET, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_RS); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_RESET, MC44S803_ADDR); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- --/* Power Up and Start Osc */ -- -- val = MC44S803_REG_SM(MC44S803_REG_REFOSC, MC44S803_ADDR) | -- MC44S803_REG_SM(0xC0, MC44S803_REFOSC) | -- MC44S803_REG_SM(1, MC44S803_OSCSEL); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_POWER, MC44S803_ADDR) | -- MC44S803_REG_SM(0x200, MC44S803_POWER); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- msleep(10); -- -- val = MC44S803_REG_SM(MC44S803_REG_REFOSC, MC44S803_ADDR) | -- MC44S803_REG_SM(0x40, MC44S803_REFOSC) | -- MC44S803_REG_SM(1, MC44S803_OSCSEL); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- msleep(20); -- --/* Setup Mixer */ -- -- val = MC44S803_REG_SM(MC44S803_REG_MIXER, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_TRI_STATE) | -- MC44S803_REG_SM(0x7F, MC44S803_MIXER_RES); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- --/* Setup Cirquit Adjust */ -- -- val = MC44S803_REG_SM(MC44S803_REG_CIRCADJ, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_G1) | -- MC44S803_REG_SM(1, MC44S803_G3) | -- MC44S803_REG_SM(0x3, MC44S803_CIRCADJ_RES) | -- MC44S803_REG_SM(1, MC44S803_G6) | -- MC44S803_REG_SM(priv->cfg->dig_out, MC44S803_S1) | -- MC44S803_REG_SM(0x3, MC44S803_LP) | -- MC44S803_REG_SM(1, MC44S803_CLRF) | -- MC44S803_REG_SM(1, MC44S803_CLIF); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_CIRCADJ, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_G1) | -- MC44S803_REG_SM(1, MC44S803_G3) | -- MC44S803_REG_SM(0x3, MC44S803_CIRCADJ_RES) | -- MC44S803_REG_SM(1, MC44S803_G6) | -- MC44S803_REG_SM(priv->cfg->dig_out, MC44S803_S1) | -- MC44S803_REG_SM(0x3, MC44S803_LP); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- --/* Setup Digtune */ -- -- val = MC44S803_REG_SM(MC44S803_REG_DIGTUNE, MC44S803_ADDR) | -- MC44S803_REG_SM(3, MC44S803_XOD); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- --/* Setup AGC */ -- -- val = MC44S803_REG_SM(MC44S803_REG_LNAAGC, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_AT1) | -- MC44S803_REG_SM(1, MC44S803_AT2) | -- MC44S803_REG_SM(1, MC44S803_AGC_AN_DIG) | -- MC44S803_REG_SM(1, MC44S803_AGC_READ_EN) | -- MC44S803_REG_SM(1, MC44S803_LNA0); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- return 0; -- --exit: -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- mc_printk(KERN_WARNING, "I/O Error\n"); -- return err; --} -- --static int mc44s803_set_params(struct dvb_frontend *fe) --{ -- struct mc44s803_priv *priv = fe->tuner_priv; -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -- u32 r1, r2, n1, n2, lo1, lo2, freq, val; -- int err; -- -- priv->frequency = c->frequency; -- -- r1 = MC44S803_OSC / 1000000; -- r2 = MC44S803_OSC / 100000; -- -- n1 = (c->frequency + MC44S803_IF1 + 500000) / 1000000; -- freq = MC44S803_OSC / r1 * n1; -- lo1 = ((60 * n1) + (r1 / 2)) / r1; -- freq = freq - c->frequency; -- -- n2 = (freq - MC44S803_IF2 + 50000) / 100000; -- lo2 = ((60 * n2) + (r2 / 2)) / r2; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- -- val = MC44S803_REG_SM(MC44S803_REG_REFDIV, MC44S803_ADDR) | -- MC44S803_REG_SM(r1-1, MC44S803_R1) | -- MC44S803_REG_SM(r2-1, MC44S803_R2) | -- MC44S803_REG_SM(1, MC44S803_REFBUF_EN); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_LO1, MC44S803_ADDR) | -- MC44S803_REG_SM(n1-2, MC44S803_LO1); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_LO2, MC44S803_ADDR) | -- MC44S803_REG_SM(n2-2, MC44S803_LO2); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_DIGTUNE, MC44S803_ADDR) | -- MC44S803_REG_SM(1, MC44S803_DA) | -- MC44S803_REG_SM(lo1, MC44S803_LO_REF) | -- MC44S803_REG_SM(1, MC44S803_AT); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- val = MC44S803_REG_SM(MC44S803_REG_DIGTUNE, MC44S803_ADDR) | -- MC44S803_REG_SM(2, MC44S803_DA) | -- MC44S803_REG_SM(lo2, MC44S803_LO_REF) | -- MC44S803_REG_SM(1, MC44S803_AT); -- -- err = mc44s803_writereg(priv, val); -- if (err) -- goto exit; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- return 0; -- --exit: -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- mc_printk(KERN_WARNING, "I/O Error\n"); -- return err; --} -- --static int mc44s803_get_frequency(struct dvb_frontend *fe, u32 *frequency) --{ -- struct mc44s803_priv *priv = fe->tuner_priv; -- *frequency = priv->frequency; -- return 0; --} -- --static const struct dvb_tuner_ops mc44s803_tuner_ops = { -- .info = { -- .name = "Freescale MC44S803", -- .frequency_min = 48000000, -- .frequency_max = 1000000000, -- .frequency_step = 100000, -- }, -- -- .release = mc44s803_release, -- .init = mc44s803_init, -- .set_params = mc44s803_set_params, -- .get_frequency = mc44s803_get_frequency --}; -- --/* This functions tries to identify a MC44S803 tuner by reading the ID -- register. This is hasty. */ --struct dvb_frontend *mc44s803_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, struct mc44s803_config *cfg) --{ -- struct mc44s803_priv *priv; -- u32 reg; -- u8 id; -- int ret; -- -- reg = 0; -- -- priv = kzalloc(sizeof(struct mc44s803_priv), GFP_KERNEL); -- if (priv == NULL) -- return NULL; -- -- priv->cfg = cfg; -- priv->i2c = i2c; -- priv->fe = fe; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ -- -- ret = mc44s803_readreg(priv, MC44S803_REG_ID, ®); -- if (ret) -- goto error; -- -- id = MC44S803_REG_MS(reg, MC44S803_ID); -- -- if (id != 0x14) { -- mc_printk(KERN_ERR, "unsupported ID " -- "(%x should be 0x14)\n", id); -- goto error; -- } -- -- mc_printk(KERN_INFO, "successfully identified (ID = %x)\n", id); -- memcpy(&fe->ops.tuner_ops, &mc44s803_tuner_ops, -- sizeof(struct dvb_tuner_ops)); -- -- fe->tuner_priv = priv; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- return fe; -- --error: -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- kfree(priv); -- return NULL; --} --EXPORT_SYMBOL(mc44s803_attach); -- --MODULE_AUTHOR("Jochen Friedrich"); --MODULE_DESCRIPTION("Freescale MC44S803 silicon tuner driver"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/tuners/mc44s803.h b/drivers/media/common/tuners/mc44s803.h -deleted file mode 100644 -index 34f3892..0000000 ---- a/drivers/media/common/tuners/mc44s803.h -+++ /dev/null -@@ -1,46 +0,0 @@ --/* -- * Driver for Freescale MC44S803 Low Power CMOS Broadband Tuner -- * -- * Copyright (c) 2009 Jochen Friedrich -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --#ifndef MC44S803_H --#define MC44S803_H -- --struct dvb_frontend; --struct i2c_adapter; -- --struct mc44s803_config { -- u8 i2c_address; -- u8 dig_out; --}; -- --#if defined(CONFIG_MEDIA_TUNER_MC44S803) || \ -- (defined(CONFIG_MEDIA_TUNER_MC44S803_MODULE) && defined(MODULE)) --extern struct dvb_frontend *mc44s803_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, struct mc44s803_config *cfg); --#else --static inline struct dvb_frontend *mc44s803_attach(struct dvb_frontend *fe, -- struct i2c_adapter *i2c, struct mc44s803_config *cfg) --{ -- printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); -- return NULL; --} --#endif /* CONFIG_MEDIA_TUNER_MC44S803 */ -- --#endif -diff --git a/drivers/media/common/tuners/mc44s803_priv.h b/drivers/media/common/tuners/mc44s803_priv.h -deleted file mode 100644 -index 14a9278..0000000 ---- a/drivers/media/common/tuners/mc44s803_priv.h -+++ /dev/null -@@ -1,208 +0,0 @@ --/* -- * Driver for Freescale MC44S803 Low Power CMOS Broadband Tuner -- * -- * Copyright (c) 2009 Jochen Friedrich -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --#ifndef MC44S803_PRIV_H --#define MC44S803_PRIV_H -- --/* This driver is based on the information available in the datasheet -- http://www.freescale.com/files/rf_if/doc/data_sheet/MC44S803.pdf -- -- SPI or I2C Address : 0xc0-0xc6 -- -- Reg.No | Function -- ------------------------------------------- -- 00 | Power Down -- 01 | Reference Oszillator -- 02 | Reference Dividers -- 03 | Mixer and Reference Buffer -- 04 | Reset/Serial Out -- 05 | LO 1 -- 06 | LO 2 -- 07 | Circuit Adjust -- 08 | Test -- 09 | Digital Tune -- 0A | LNA AGC -- 0B | Data Register Address -- 0C | Regulator Test -- 0D | VCO Test -- 0E | LNA Gain/Input Power -- 0F | ID Bits -- --*/ -- --#define MC44S803_OSC 26000000 /* 26 MHz */ --#define MC44S803_IF1 1086000000 /* 1086 MHz */ --#define MC44S803_IF2 36125000 /* 36.125 MHz */ -- --#define MC44S803_REG_POWER 0 --#define MC44S803_REG_REFOSC 1 --#define MC44S803_REG_REFDIV 2 --#define MC44S803_REG_MIXER 3 --#define MC44S803_REG_RESET 4 --#define MC44S803_REG_LO1 5 --#define MC44S803_REG_LO2 6 --#define MC44S803_REG_CIRCADJ 7 --#define MC44S803_REG_TEST 8 --#define MC44S803_REG_DIGTUNE 9 --#define MC44S803_REG_LNAAGC 0x0A --#define MC44S803_REG_DATAREG 0x0B --#define MC44S803_REG_REGTEST 0x0C --#define MC44S803_REG_VCOTEST 0x0D --#define MC44S803_REG_LNAGAIN 0x0E --#define MC44S803_REG_ID 0x0F -- --/* Register definitions */ --#define MC44S803_ADDR 0x0F --#define MC44S803_ADDR_S 0 --/* REG_POWER */ --#define MC44S803_POWER 0xFFFFF0 --#define MC44S803_POWER_S 4 --/* REG_REFOSC */ --#define MC44S803_REFOSC 0x1FF0 --#define MC44S803_REFOSC_S 4 --#define MC44S803_OSCSEL 0x2000 --#define MC44S803_OSCSEL_S 13 --/* REG_REFDIV */ --#define MC44S803_R2 0x1FF0 --#define MC44S803_R2_S 4 --#define MC44S803_REFBUF_EN 0x2000 --#define MC44S803_REFBUF_EN_S 13 --#define MC44S803_R1 0x7C000 --#define MC44S803_R1_S 14 --/* REG_MIXER */ --#define MC44S803_R3 0x70 --#define MC44S803_R3_S 4 --#define MC44S803_MUX3 0x80 --#define MC44S803_MUX3_S 7 --#define MC44S803_MUX4 0x100 --#define MC44S803_MUX4_S 8 --#define MC44S803_OSC_SCR 0x200 --#define MC44S803_OSC_SCR_S 9 --#define MC44S803_TRI_STATE 0x400 --#define MC44S803_TRI_STATE_S 10 --#define MC44S803_BUF_GAIN 0x800 --#define MC44S803_BUF_GAIN_S 11 --#define MC44S803_BUF_IO 0x1000 --#define MC44S803_BUF_IO_S 12 --#define MC44S803_MIXER_RES 0xFE000 --#define MC44S803_MIXER_RES_S 13 --/* REG_RESET */ --#define MC44S803_RS 0x10 --#define MC44S803_RS_S 4 --#define MC44S803_SO 0x20 --#define MC44S803_SO_S 5 --/* REG_LO1 */ --#define MC44S803_LO1 0xFFF0 --#define MC44S803_LO1_S 4 --/* REG_LO2 */ --#define MC44S803_LO2 0x7FFF0 --#define MC44S803_LO2_S 4 --/* REG_CIRCADJ */ --#define MC44S803_G1 0x20 --#define MC44S803_G1_S 5 --#define MC44S803_G3 0x80 --#define MC44S803_G3_S 7 --#define MC44S803_CIRCADJ_RES 0x300 --#define MC44S803_CIRCADJ_RES_S 8 --#define MC44S803_G6 0x400 --#define MC44S803_G6_S 10 --#define MC44S803_G7 0x800 --#define MC44S803_G7_S 11 --#define MC44S803_S1 0x1000 --#define MC44S803_S1_S 12 --#define MC44S803_LP 0x7E000 --#define MC44S803_LP_S 13 --#define MC44S803_CLRF 0x80000 --#define MC44S803_CLRF_S 19 --#define MC44S803_CLIF 0x100000 --#define MC44S803_CLIF_S 20 --/* REG_TEST */ --/* REG_DIGTUNE */ --#define MC44S803_DA 0xF0 --#define MC44S803_DA_S 4 --#define MC44S803_XOD 0x300 --#define MC44S803_XOD_S 8 --#define MC44S803_RST 0x10000 --#define MC44S803_RST_S 16 --#define MC44S803_LO_REF 0x1FFF00 --#define MC44S803_LO_REF_S 8 --#define MC44S803_AT 0x200000 --#define MC44S803_AT_S 21 --#define MC44S803_MT 0x400000 --#define MC44S803_MT_S 22 --/* REG_LNAAGC */ --#define MC44S803_G 0x3F0 --#define MC44S803_G_S 4 --#define MC44S803_AT1 0x400 --#define MC44S803_AT1_S 10 --#define MC44S803_AT2 0x800 --#define MC44S803_AT2_S 11 --#define MC44S803_HL_GR_EN 0x8000 --#define MC44S803_HL_GR_EN_S 15 --#define MC44S803_AGC_AN_DIG 0x10000 --#define MC44S803_AGC_AN_DIG_S 16 --#define MC44S803_ATTEN_EN 0x20000 --#define MC44S803_ATTEN_EN_S 17 --#define MC44S803_AGC_READ_EN 0x40000 --#define MC44S803_AGC_READ_EN_S 18 --#define MC44S803_LNA0 0x80000 --#define MC44S803_LNA0_S 19 --#define MC44S803_AGC_SEL 0x100000 --#define MC44S803_AGC_SEL_S 20 --#define MC44S803_AT0 0x200000 --#define MC44S803_AT0_S 21 --#define MC44S803_B 0xC00000 --#define MC44S803_B_S 22 --/* REG_DATAREG */ --#define MC44S803_D 0xF0 --#define MC44S803_D_S 4 --/* REG_REGTEST */ --/* REG_VCOTEST */ --/* REG_LNAGAIN */ --#define MC44S803_IF_PWR 0x700 --#define MC44S803_IF_PWR_S 8 --#define MC44S803_RF_PWR 0x3800 --#define MC44S803_RF_PWR_S 11 --#define MC44S803_LNA_GAIN 0xFC000 --#define MC44S803_LNA_GAIN_S 14 --/* REG_ID */ --#define MC44S803_ID 0x3E00 --#define MC44S803_ID_S 9 -- --/* Some macros to read/write fields */ -- --/* First shift, then mask */ --#define MC44S803_REG_SM(_val, _reg) \ -- (((_val) << _reg##_S) & (_reg)) -- --/* First mask, then shift */ --#define MC44S803_REG_MS(_val, _reg) \ -- (((_val) & (_reg)) >> _reg##_S) -- --struct mc44s803_priv { -- struct mc44s803_config *cfg; -- struct i2c_adapter *i2c; -- struct dvb_frontend *fe; -- -- u32 frequency; --}; -- --#endif -diff --git a/drivers/media/common/tuners/mt2060.c b/drivers/media/common/tuners/mt2060.c -deleted file mode 100644 -index 13381de..0000000 ---- a/drivers/media/common/tuners/mt2060.c -+++ /dev/null -@@ -1,403 +0,0 @@ --/* -- * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner" -- * -- * Copyright (c) 2006 Olivier DANET -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --/* In that file, frequencies are expressed in kiloHertz to avoid 32 bits overflows */ -- --#include --#include --#include --#include --#include -- --#include "dvb_frontend.h" -- --#include "mt2060.h" --#include "mt2060_priv.h" -- --static int debug; --module_param(debug, int, 0644); --MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); -- --#define dprintk(args...) do { if (debug) {printk(KERN_DEBUG "MT2060: " args); printk("\n"); }} while (0) -- --// Reads a single register --static int mt2060_readreg(struct mt2060_priv *priv, u8 reg, u8 *val) --{ -- struct i2c_msg msg[2] = { -- { .addr = priv->cfg->i2c_address, .flags = 0, .buf = ®, .len = 1 }, -- { .addr = priv->cfg->i2c_address, .flags = I2C_M_RD, .buf = val, .len = 1 }, -- }; -- -- if (i2c_transfer(priv->i2c, msg, 2) != 2) { -- printk(KERN_WARNING "mt2060 I2C read failed\n"); -- return -EREMOTEIO; -- } -- return 0; --} -- --// Writes a single register --static int mt2060_writereg(struct mt2060_priv *priv, u8 reg, u8 val) --{ -- u8 buf[2] = { reg, val }; -- struct i2c_msg msg = { -- .addr = priv->cfg->i2c_address, .flags = 0, .buf = buf, .len = 2 -- }; -- -- if (i2c_transfer(priv->i2c, &msg, 1) != 1) { -- printk(KERN_WARNING "mt2060 I2C write failed\n"); -- return -EREMOTEIO; -- } -- return 0; --} -- --// Writes a set of consecutive registers --static int mt2060_writeregs(struct mt2060_priv *priv,u8 *buf, u8 len) --{ -- struct i2c_msg msg = { -- .addr = priv->cfg->i2c_address, .flags = 0, .buf = buf, .len = len -- }; -- if (i2c_transfer(priv->i2c, &msg, 1) != 1) { -- printk(KERN_WARNING "mt2060 I2C write failed (len=%i)\n",(int)len); -- return -EREMOTEIO; -- } -- return 0; --} -- --// Initialisation sequences --// LNABAND=3, NUM1=0x3C, DIV1=0x74, NUM2=0x1080, DIV2=0x49 --static u8 mt2060_config1[] = { -- REG_LO1C1, -- 0x3F, 0x74, 0x00, 0x08, 0x93 --}; -- --// FMCG=2, GP2=0, GP1=0 --static u8 mt2060_config2[] = { -- REG_MISC_CTRL, -- 0x20, 0x1E, 0x30, 0xff, 0x80, 0xff, 0x00, 0x2c, 0x42 --}; -- --// VGAG=3, V1CSE=1 -- --#ifdef MT2060_SPURCHECK --/* The function below calculates the frequency offset between the output frequency if2 -- and the closer cross modulation subcarrier between lo1 and lo2 up to the tenth harmonic */ --static int mt2060_spurcalc(u32 lo1,u32 lo2,u32 if2) --{ -- int I,J; -- int dia,diamin,diff; -- diamin=1000000; -- for (I = 1; I < 10; I++) { -- J = ((2*I*lo1)/lo2+1)/2; -- diff = I*(int)lo1-J*(int)lo2; -- if (diff < 0) diff=-diff; -- dia = (diff-(int)if2); -- if (dia < 0) dia=-dia; -- if (diamin > dia) diamin=dia; -- } -- return diamin; --} -- --#define BANDWIDTH 4000 // kHz -- --/* Calculates the frequency offset to add to avoid spurs. Returns 0 if no offset is needed */ --static int mt2060_spurcheck(u32 lo1,u32 lo2,u32 if2) --{ -- u32 Spur,Sp1,Sp2; -- int I,J; -- I=0; -- J=1000; -- -- Spur=mt2060_spurcalc(lo1,lo2,if2); -- if (Spur < BANDWIDTH) { -- /* Potential spurs detected */ -- dprintk("Spurs before : f_lo1: %d f_lo2: %d (kHz)", -- (int)lo1,(int)lo2); -- I=1000; -- Sp1 = mt2060_spurcalc(lo1+I,lo2+I,if2); -- Sp2 = mt2060_spurcalc(lo1-I,lo2-I,if2); -- -- if (Sp1 < Sp2) { -- J=-J; I=-I; Spur=Sp2; -- } else -- Spur=Sp1; -- -- while (Spur < BANDWIDTH) { -- I += J; -- Spur = mt2060_spurcalc(lo1+I,lo2+I,if2); -- } -- dprintk("Spurs after : f_lo1: %d f_lo2: %d (kHz)", -- (int)(lo1+I),(int)(lo2+I)); -- } -- return I; --} --#endif -- --#define IF2 36150 // IF2 frequency = 36.150 MHz --#define FREF 16000 // Quartz oscillator 16 MHz -- --static int mt2060_set_params(struct dvb_frontend *fe) --{ -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -- struct mt2060_priv *priv; -- int ret=0; -- int i=0; -- u32 freq; -- u8 lnaband; -- u32 f_lo1,f_lo2; -- u32 div1,num1,div2,num2; -- u8 b[8]; -- u32 if1; -- -- priv = fe->tuner_priv; -- -- if1 = priv->if1_freq; -- b[0] = REG_LO1B1; -- b[1] = 0xFF; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ -- -- mt2060_writeregs(priv,b,2); -- -- freq = c->frequency / 1000; /* Hz -> kHz */ -- -- f_lo1 = freq + if1 * 1000; -- f_lo1 = (f_lo1 / 250) * 250; -- f_lo2 = f_lo1 - freq - IF2; -- // From the Comtech datasheet, the step used is 50kHz. The tuner chip could be more precise -- f_lo2 = ((f_lo2 + 25) / 50) * 50; -- priv->frequency = (f_lo1 - f_lo2 - IF2) * 1000, -- --#ifdef MT2060_SPURCHECK -- // LO-related spurs detection and correction -- num1 = mt2060_spurcheck(f_lo1,f_lo2,IF2); -- f_lo1 += num1; -- f_lo2 += num1; --#endif -- //Frequency LO1 = 16MHz * (DIV1 + NUM1/64 ) -- num1 = f_lo1 / (FREF / 64); -- div1 = num1 / 64; -- num1 &= 0x3f; -- -- // Frequency LO2 = 16MHz * (DIV2 + NUM2/8192 ) -- num2 = f_lo2 * 64 / (FREF / 128); -- div2 = num2 / 8192; -- num2 &= 0x1fff; -- -- if (freq <= 95000) lnaband = 0xB0; else -- if (freq <= 180000) lnaband = 0xA0; else -- if (freq <= 260000) lnaband = 0x90; else -- if (freq <= 335000) lnaband = 0x80; else -- if (freq <= 425000) lnaband = 0x70; else -- if (freq <= 480000) lnaband = 0x60; else -- if (freq <= 570000) lnaband = 0x50; else -- if (freq <= 645000) lnaband = 0x40; else -- if (freq <= 730000) lnaband = 0x30; else -- if (freq <= 810000) lnaband = 0x20; else lnaband = 0x10; -- -- b[0] = REG_LO1C1; -- b[1] = lnaband | ((num1 >>2) & 0x0F); -- b[2] = div1; -- b[3] = (num2 & 0x0F) | ((num1 & 3) << 4); -- b[4] = num2 >> 4; -- b[5] = ((num2 >>12) & 1) | (div2 << 1); -- -- dprintk("IF1: %dMHz",(int)if1); -- dprintk("PLL freq=%dkHz f_lo1=%dkHz f_lo2=%dkHz",(int)freq,(int)f_lo1,(int)f_lo2); -- dprintk("PLL div1=%d num1=%d div2=%d num2=%d",(int)div1,(int)num1,(int)div2,(int)num2); -- dprintk("PLL [1..5]: %2x %2x %2x %2x %2x",(int)b[1],(int)b[2],(int)b[3],(int)b[4],(int)b[5]); -- -- mt2060_writeregs(priv,b,6); -- -- //Waits for pll lock or timeout -- i = 0; -- do { -- mt2060_readreg(priv,REG_LO_STATUS,b); -- if ((b[0] & 0x88)==0x88) -- break; -- msleep(4); -- i++; -- } while (i<10); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- return ret; --} -- --static void mt2060_calibrate(struct mt2060_priv *priv) --{ -- u8 b = 0; -- int i = 0; -- -- if (mt2060_writeregs(priv,mt2060_config1,sizeof(mt2060_config1))) -- return; -- if (mt2060_writeregs(priv,mt2060_config2,sizeof(mt2060_config2))) -- return; -- -- /* initialize the clock output */ -- mt2060_writereg(priv, REG_VGAG, (priv->cfg->clock_out << 6) | 0x30); -- -- do { -- b |= (1 << 6); // FM1SS; -- mt2060_writereg(priv, REG_LO2C1,b); -- msleep(20); -- -- if (i == 0) { -- b |= (1 << 7); // FM1CA; -- mt2060_writereg(priv, REG_LO2C1,b); -- b &= ~(1 << 7); // FM1CA; -- msleep(20); -- } -- -- b &= ~(1 << 6); // FM1SS -- mt2060_writereg(priv, REG_LO2C1,b); -- -- msleep(20); -- i++; -- } while (i < 9); -- -- i = 0; -- while (i++ < 10 && mt2060_readreg(priv, REG_MISC_STAT, &b) == 0 && (b & (1 << 6)) == 0) -- msleep(20); -- -- if (i <= 10) { -- mt2060_readreg(priv, REG_FM_FREQ, &priv->fmfreq); // now find out, what is fmreq used for :) -- dprintk("calibration was successful: %d", (int)priv->fmfreq); -- } else -- dprintk("FMCAL timed out"); --} -- --static int mt2060_get_frequency(struct dvb_frontend *fe, u32 *frequency) --{ -- struct mt2060_priv *priv = fe->tuner_priv; -- *frequency = priv->frequency; -- return 0; --} -- --static int mt2060_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) --{ -- *frequency = IF2 * 1000; -- return 0; --} -- --static int mt2060_init(struct dvb_frontend *fe) --{ -- struct mt2060_priv *priv = fe->tuner_priv; -- int ret; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ -- -- ret = mt2060_writereg(priv, REG_VGAG, -- (priv->cfg->clock_out << 6) | 0x33); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- return ret; --} -- --static int mt2060_sleep(struct dvb_frontend *fe) --{ -- struct mt2060_priv *priv = fe->tuner_priv; -- int ret; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ -- -- ret = mt2060_writereg(priv, REG_VGAG, -- (priv->cfg->clock_out << 6) | 0x30); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- return ret; --} -- --static int mt2060_release(struct dvb_frontend *fe) --{ -- kfree(fe->tuner_priv); -- fe->tuner_priv = NULL; -- return 0; --} -- --static const struct dvb_tuner_ops mt2060_tuner_ops = { -- .info = { -- .name = "Microtune MT2060", -- .frequency_min = 48000000, -- .frequency_max = 860000000, -- .frequency_step = 50000, -- }, -- -- .release = mt2060_release, -- -- .init = mt2060_init, -- .sleep = mt2060_sleep, -- -- .set_params = mt2060_set_params, -- .get_frequency = mt2060_get_frequency, -- .get_if_frequency = mt2060_get_if_frequency, --}; -- --/* This functions tries to identify a MT2060 tuner by reading the PART/REV register. This is hasty. */ --struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1) --{ -- struct mt2060_priv *priv = NULL; -- u8 id = 0; -- -- priv = kzalloc(sizeof(struct mt2060_priv), GFP_KERNEL); -- if (priv == NULL) -- return NULL; -- -- priv->cfg = cfg; -- priv->i2c = i2c; -- priv->if1_freq = if1; -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); /* open i2c_gate */ -- -- if (mt2060_readreg(priv,REG_PART_REV,&id) != 0) { -- kfree(priv); -- return NULL; -- } -- -- if (id != PART_REV) { -- kfree(priv); -- return NULL; -- } -- printk(KERN_INFO "MT2060: successfully identified (IF1 = %d)\n", if1); -- memcpy(&fe->ops.tuner_ops, &mt2060_tuner_ops, sizeof(struct dvb_tuner_ops)); -- -- fe->tuner_priv = priv; -- -- mt2060_calibrate(priv); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); /* close i2c_gate */ -- -- return fe; --} --EXPORT_SYMBOL(mt2060_attach); -- --MODULE_AUTHOR("Olivier DANET"); --MODULE_DESCRIPTION("Microtune MT2060 silicon tuner driver"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/tuners/mt2060.h b/drivers/media/common/tuners/mt2060.h -deleted file mode 100644 -index cb60caf..0000000 ---- a/drivers/media/common/tuners/mt2060.h -+++ /dev/null -@@ -1,43 +0,0 @@ --/* -- * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner" -- * -- * Copyright (c) 2006 Olivier DANET -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --#ifndef MT2060_H --#define MT2060_H -- --struct dvb_frontend; --struct i2c_adapter; -- --struct mt2060_config { -- u8 i2c_address; -- u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */ --}; -- --#if defined(CONFIG_MEDIA_TUNER_MT2060) || (defined(CONFIG_MEDIA_TUNER_MT2060_MODULE) && defined(MODULE)) --extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1); --#else --static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1) --{ -- printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); -- return NULL; --} --#endif // CONFIG_MEDIA_TUNER_MT2060 -- --#endif -diff --git a/drivers/media/common/tuners/mt2060_priv.h b/drivers/media/common/tuners/mt2060_priv.h -deleted file mode 100644 -index 2b60de6..0000000 ---- a/drivers/media/common/tuners/mt2060_priv.h -+++ /dev/null -@@ -1,104 +0,0 @@ --/* -- * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner" -- * -- * Copyright (c) 2006 Olivier DANET -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation; either version 2 of the License, or -- * (at your option) any later version. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, write to the Free Software -- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.= -- */ -- --#ifndef MT2060_PRIV_H --#define MT2060_PRIV_H -- --// Uncomment the #define below to enable spurs checking. The results where quite unconvincing. --// #define MT2060_SPURCHECK -- --/* This driver is based on the information available in the datasheet of the -- "Comtech SDVBT-3K6M" tuner ( K1000737843.pdf ) which features the MT2060 register map : -- -- I2C Address : 0x60 -- -- Reg.No | B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0 | ( defaults ) -- -------------------------------------------------------------------------------- -- 00 | [ PART ] | [ REV ] | R = 0x63 -- 01 | [ LNABAND ] | [ NUM1(5:2) ] | RW = 0x3F -- 02 | [ DIV1 ] | RW = 0x74 -- 03 | FM1CA | FM1SS | [ NUM1(1:0) ] | [ NUM2(3:0) ] | RW = 0x00 -- 04 | NUM2(11:4) ] | RW = 0x08 -- 05 | [ DIV2 ] |NUM2(12)| RW = 0x93 -- 06 | L1LK | [ TAD1 ] | L2LK | [ TAD2 ] | R -- 07 | [ FMF ] | R -- 08 | ? | FMCAL | ? | ? | ? | ? | ? | TEMP | R -- 09 | 0 | 0 | [ FMGC ] | 0 | GP02 | GP01 | 0 | RW = 0x20 -- 0A | ?? -- 0B | 0 | 0 | 1 | 1 | 0 | 0 | [ VGAG ] | RW = 0x30 -- 0C | V1CSE | 1 | 1 | 1 | 1 | 1 | 1 | 1 | RW = 0xFF -- 0D | 1 | 0 | [ V1CS ] | RW = 0xB0 -- 0E | ?? -- 0F | ?? -- 10 | ?? -- 11 | [ LOTO ] | 0 | 0 | 1 | 0 | RW = 0x42 -- -- PART : Part code : 6 for MT2060 -- REV : Revision code : 3 for current revision -- LNABAND : Input frequency range : ( See code for details ) -- NUM1 / DIV1 / NUM2 / DIV2 : Frequencies programming ( See code for details ) -- FM1CA : Calibration Start Bit -- FM1SS : Calibration Single Step bit -- L1LK : LO1 Lock Detect -- TAD1 : Tune Line ADC ( ? ) -- L2LK : LO2 Lock Detect -- TAD2 : Tune Line ADC ( ? ) -- FMF : Estimated first IF Center frequency Offset ( ? ) -- FM1CAL : Calibration done bit -- TEMP : On chip temperature sensor -- FMCG : Mixer 1 Cap Gain ( ? ) -- GP01 / GP02 : Programmable digital outputs. Unconnected pins ? -- V1CSE : LO1 VCO Automatic Capacitor Select Enable ( ? ) -- V1CS : LO1 Capacitor Selection Value ( ? ) -- LOTO : LO Timeout ( ? ) -- VGAG : Tuner Output gain --*/ -- --#define I2C_ADDRESS 0x60 -- --#define REG_PART_REV 0 --#define REG_LO1C1 1 --#define REG_LO1C2 2 --#define REG_LO2C1 3 --#define REG_LO2C2 4 --#define REG_LO2C3 5 --#define REG_LO_STATUS 6 --#define REG_FM_FREQ 7 --#define REG_MISC_STAT 8 --#define REG_MISC_CTRL 9 --#define REG_RESERVED_A 0x0A --#define REG_VGAG 0x0B --#define REG_LO1B1 0x0C --#define REG_LO1B2 0x0D --#define REG_LOTO 0x11 -- --#define PART_REV 0x63 // The current driver works only with PART=6 and REV=3 chips -- --struct mt2060_priv { -- struct mt2060_config *cfg; -- struct i2c_adapter *i2c; -- -- u32 frequency; -- u16 if1_freq; -- u8 fmfreq; --}; -- --#endif -diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c -deleted file mode 100644 -index c89af3c..0000000 ---- a/drivers/media/common/tuners/mt2063.c -+++ /dev/null -@@ -1,2307 +0,0 @@ --/* -- * Driver for mt2063 Micronas tuner -- * -- * Copyright (c) 2011 Mauro Carvalho Chehab -- * -- * This driver came from a driver originally written by: -- * Henry Wang -- * Made publicly available by Terratec, at: -- * http://linux.terratec.de/files/TERRATEC_H7/20110323_TERRATEC_H7_Linux.tar.gz -- * The original driver's license is GPL, as declared with MODULE_LICENSE() -- * -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License as published by -- * the Free Software Foundation under version 2 of the License. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- */ -- --#include --#include --#include --#include --#include -- --#include "mt2063.h" -- --static unsigned int debug; --module_param(debug, int, 0644); --MODULE_PARM_DESC(debug, "Set Verbosity level"); -- --#define dprintk(level, fmt, arg...) do { \ --if (debug >= level) \ -- printk(KERN_DEBUG "mt2063 %s: " fmt, __func__, ## arg); \ --} while (0) -- -- --/* positive error codes used internally */ -- --/* Info: Unavoidable LO-related spur may be present in the output */ --#define MT2063_SPUR_PRESENT_ERR (0x00800000) -- --/* Info: Mask of bits used for # of LO-related spurs that were avoided during tuning */ --#define MT2063_SPUR_CNT_MASK (0x001f0000) --#define MT2063_SPUR_SHIFT (16) -- --/* Info: Upconverter frequency is out of range (may be reason for MT_UPC_UNLOCK) */ --#define MT2063_UPC_RANGE (0x04000000) -- --/* Info: Downconverter frequency is out of range (may be reason for MT_DPC_UNLOCK) */ --#define MT2063_DNC_RANGE (0x08000000) -- --/* -- * Constant defining the version of the following structure -- * and therefore the API for this code. -- * -- * When compiling the tuner driver, the preprocessor will -- * check against this version number to make sure that -- * it matches the version that the tuner driver knows about. -- */ -- --/* DECT Frequency Avoidance */ --#define MT2063_DECT_AVOID_US_FREQS 0x00000001 -- --#define MT2063_DECT_AVOID_EURO_FREQS 0x00000002 -- --#define MT2063_EXCLUDE_US_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_US_FREQS) != 0) -- --#define MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_EURO_FREQS) != 0) -- --enum MT2063_DECT_Avoid_Type { -- MT2063_NO_DECT_AVOIDANCE = 0, /* Do not create DECT exclusion zones. */ -- MT2063_AVOID_US_DECT = MT2063_DECT_AVOID_US_FREQS, /* Avoid US DECT frequencies. */ -- MT2063_AVOID_EURO_DECT = MT2063_DECT_AVOID_EURO_FREQS, /* Avoid European DECT frequencies. */ -- MT2063_AVOID_BOTH /* Avoid both regions. Not typically used. */ --}; -- --#define MT2063_MAX_ZONES 48 -- --struct MT2063_ExclZone_t { -- u32 min_; -- u32 max_; -- struct MT2063_ExclZone_t *next_; --}; -- --/* -- * Structure of data needed for Spur Avoidance -- */ --struct MT2063_AvoidSpursData_t { -- u32 f_ref; -- u32 f_in; -- u32 f_LO1; -- u32 f_if1_Center; -- u32 f_if1_Request; -- u32 f_if1_bw; -- u32 f_LO2; -- u32 f_out; -- u32 f_out_bw; -- u32 f_LO1_Step; -- u32 f_LO2_Step; -- u32 f_LO1_FracN_Avoid; -- u32 f_LO2_FracN_Avoid; -- u32 f_zif_bw; -- u32 f_min_LO_Separation; -- u32 maxH1; -- u32 maxH2; -- enum MT2063_DECT_Avoid_Type avoidDECT; -- u32 bSpurPresent; -- u32 bSpurAvoided; -- u32 nSpursFound; -- u32 nZones; -- struct MT2063_ExclZone_t *freeZones; -- struct MT2063_ExclZone_t *usedZones; -- struct MT2063_ExclZone_t MT2063_ExclZones[MT2063_MAX_ZONES]; --}; -- --/* -- * Parameter for function MT2063_SetPowerMask that specifies the power down -- * of various sections of the MT2063. -- */ --enum MT2063_Mask_Bits { -- MT2063_REG_SD = 0x0040, /* Shutdown regulator */ -- MT2063_SRO_SD = 0x0020, /* Shutdown SRO */ -- MT2063_AFC_SD = 0x0010, /* Shutdown AFC A/D */ -- MT2063_PD_SD = 0x0002, /* Enable power detector shutdown */ -- MT2063_PDADC_SD = 0x0001, /* Enable power detector A/D shutdown */ -- MT2063_VCO_SD = 0x8000, /* Enable VCO shutdown */ -- MT2063_LTX_SD = 0x4000, /* Enable LTX shutdown */ -- MT2063_LT1_SD = 0x2000, /* Enable LT1 shutdown */ -- MT2063_LNA_SD = 0x1000, /* Enable LNA shutdown */ -- MT2063_UPC_SD = 0x0800, /* Enable upconverter shutdown */ -- MT2063_DNC_SD = 0x0400, /* Enable downconverter shutdown */ -- MT2063_VGA_SD = 0x0200, /* Enable VGA shutdown */ -- MT2063_AMP_SD = 0x0100, /* Enable AMP shutdown */ -- MT2063_ALL_SD = 0xFF73, /* All shutdown bits for this tuner */ -- MT2063_NONE_SD = 0x0000 /* No shutdown bits */ --}; -- --/* -- * Possible values for MT2063_DNC_OUTPUT -- */ --enum MT2063_DNC_Output_Enable { -- MT2063_DNC_NONE = 0, -- MT2063_DNC_1, -- MT2063_DNC_2, -- MT2063_DNC_BOTH --}; -- --/* -- * Two-wire serial bus subaddresses of the tuner registers. -- * Also known as the tuner's register addresses. -- */ --enum MT2063_Register_Offsets { -- MT2063_REG_PART_REV = 0, /* 0x00: Part/Rev Code */ -- MT2063_REG_LO1CQ_1, /* 0x01: LO1C Queued Byte 1 */ -- MT2063_REG_LO1CQ_2, /* 0x02: LO1C Queued Byte 2 */ -- MT2063_REG_LO2CQ_1, /* 0x03: LO2C Queued Byte 1 */ -- MT2063_REG_LO2CQ_2, /* 0x04: LO2C Queued Byte 2 */ -- MT2063_REG_LO2CQ_3, /* 0x05: LO2C Queued Byte 3 */ -- MT2063_REG_RSVD_06, /* 0x06: Reserved */ -- MT2063_REG_LO_STATUS, /* 0x07: LO Status */ -- MT2063_REG_FIFFC, /* 0x08: FIFF Center */ -- MT2063_REG_CLEARTUNE, /* 0x09: ClearTune Filter */ -- MT2063_REG_ADC_OUT, /* 0x0A: ADC_OUT */ -- MT2063_REG_LO1C_1, /* 0x0B: LO1C Byte 1 */ -- MT2063_REG_LO1C_2, /* 0x0C: LO1C Byte 2 */ -- MT2063_REG_LO2C_1, /* 0x0D: LO2C Byte 1 */ -- MT2063_REG_LO2C_2, /* 0x0E: LO2C Byte 2 */ -- MT2063_REG_LO2C_3, /* 0x0F: LO2C Byte 3 */ -- MT2063_REG_RSVD_10, /* 0x10: Reserved */ -- MT2063_REG_PWR_1, /* 0x11: PWR Byte 1 */ -- MT2063_REG_PWR_2, /* 0x12: PWR Byte 2 */ -- MT2063_REG_TEMP_STATUS, /* 0x13: Temp Status */ -- MT2063_REG_XO_STATUS, /* 0x14: Crystal Status */ -- MT2063_REG_RF_STATUS, /* 0x15: RF Attn Status */ -- MT2063_REG_FIF_STATUS, /* 0x16: FIF Attn Status */ -- MT2063_REG_LNA_OV, /* 0x17: LNA Attn Override */ -- MT2063_REG_RF_OV, /* 0x18: RF Attn Override */ -- MT2063_REG_FIF_OV, /* 0x19: FIF Attn Override */ -- MT2063_REG_LNA_TGT, /* 0x1A: Reserved */ -- MT2063_REG_PD1_TGT, /* 0x1B: Pwr Det 1 Target */ -- MT2063_REG_PD2_TGT, /* 0x1C: Pwr Det 2 Target */ -- MT2063_REG_RSVD_1D, /* 0x1D: Reserved */ -- MT2063_REG_RSVD_1E, /* 0x1E: Reserved */ -- MT2063_REG_RSVD_1F, /* 0x1F: Reserved */ -- MT2063_REG_RSVD_20, /* 0x20: Reserved */ -- MT2063_REG_BYP_CTRL, /* 0x21: Bypass Control */ -- MT2063_REG_RSVD_22, /* 0x22: Reserved */ -- MT2063_REG_RSVD_23, /* 0x23: Reserved */ -- MT2063_REG_RSVD_24, /* 0x24: Reserved */ -- MT2063_REG_RSVD_25, /* 0x25: Reserved */ -- MT2063_REG_RSVD_26, /* 0x26: Reserved */ -- MT2063_REG_RSVD_27, /* 0x27: Reserved */ -- MT2063_REG_FIFF_CTRL, /* 0x28: FIFF Control */ -- MT2063_REG_FIFF_OFFSET, /* 0x29: FIFF Offset */ -- MT2063_REG_CTUNE_CTRL, /* 0x2A: Reserved */ -- MT2063_REG_CTUNE_OV, /* 0x2B: Reserved */ -- MT2063_REG_CTRL_2C, /* 0x2C: Reserved */ -- MT2063_REG_FIFF_CTRL2, /* 0x2D: Fiff Control */ -- MT2063_REG_RSVD_2E, /* 0x2E: Reserved */ -- MT2063_REG_DNC_GAIN, /* 0x2F: DNC Control */ -- MT2063_REG_VGA_GAIN, /* 0x30: VGA Gain Ctrl */ -- MT2063_REG_RSVD_31, /* 0x31: Reserved */ -- MT2063_REG_TEMP_SEL, /* 0x32: Temperature Selection */ -- MT2063_REG_RSVD_33, /* 0x33: Reserved */ -- MT2063_REG_RSVD_34, /* 0x34: Reserved */ -- MT2063_REG_RSVD_35, /* 0x35: Reserved */ -- MT2063_REG_RSVD_36, /* 0x36: Reserved */ -- MT2063_REG_RSVD_37, /* 0x37: Reserved */ -- MT2063_REG_RSVD_38, /* 0x38: Reserved */ -- MT2063_REG_RSVD_39, /* 0x39: Reserved */ -- MT2063_REG_RSVD_3A, /* 0x3A: Reserved */ -- MT2063_REG_RSVD_3B, /* 0x3B: Reserved */ -- MT2063_REG_RSVD_3C, /* 0x3C: Reserved */ -- MT2063_REG_END_REGS --}; -- --struct mt2063_state { -- struct i2c_adapter *i2c; -- -- bool init; -- -- const struct mt2063_config *config; -- struct dvb_tuner_ops ops; -- struct dvb_frontend *frontend; -- struct tuner_state status; -- -- u32 frequency; -- u32 srate; -- u32 bandwidth; -- u32 reference; -- -- u32 tuner_id; -- struct MT2063_AvoidSpursData_t AS_Data; -- u32 f_IF1_actual; -- u32 rcvr_mode; -- u32 ctfilt_sw; -- u32 CTFiltMax[31]; -- u32 num_regs; -- u8 reg[MT2063_REG_END_REGS]; --}; -- --/* -- * mt2063_write - Write data into the I2C bus -- */ --static u32 mt2063_write(struct mt2063_state *state, u8 reg, u8 *data, u32 len) --{ -- struct dvb_frontend *fe = state->frontend; -- int ret; -- u8 buf[60]; -- struct i2c_msg msg = { -- .addr = state->config->tuner_address, -- .flags = 0, -- .buf = buf, -- .len = len + 1 -- }; -- -- dprintk(2, "\n"); -- -- msg.buf[0] = reg; -- memcpy(msg.buf + 1, data, len); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- ret = i2c_transfer(state->i2c, &msg, 1); -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- if (ret < 0) -- printk(KERN_ERR "%s error ret=%d\n", __func__, ret); -- -- return ret; --} -- --/* -- * mt2063_write - Write register data into the I2C bus, caching the value -- */ --static u32 mt2063_setreg(struct mt2063_state *state, u8 reg, u8 val) --{ -- u32 status; -- -- dprintk(2, "\n"); -- -- if (reg >= MT2063_REG_END_REGS) -- return -ERANGE; -- -- status = mt2063_write(state, reg, &val, 1); -- if (status < 0) -- return status; -- -- state->reg[reg] = val; -- -- return 0; --} -- --/* -- * mt2063_read - Read data from the I2C bus -- */ --static u32 mt2063_read(struct mt2063_state *state, -- u8 subAddress, u8 *pData, u32 cnt) --{ -- u32 status = 0; /* Status to be returned */ -- struct dvb_frontend *fe = state->frontend; -- u32 i = 0; -- -- dprintk(2, "addr 0x%02x, cnt %d\n", subAddress, cnt); -- -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 1); -- -- for (i = 0; i < cnt; i++) { -- u8 b0[] = { subAddress + i }; -- struct i2c_msg msg[] = { -- { -- .addr = state->config->tuner_address, -- .flags = 0, -- .buf = b0, -- .len = 1 -- }, { -- .addr = state->config->tuner_address, -- .flags = I2C_M_RD, -- .buf = pData + i, -- .len = 1 -- } -- }; -- -- status = i2c_transfer(state->i2c, msg, 2); -- dprintk(2, "addr 0x%02x, ret = %d, val = 0x%02x\n", -- subAddress + i, status, *(pData + i)); -- if (status < 0) -- break; -- } -- if (fe->ops.i2c_gate_ctrl) -- fe->ops.i2c_gate_ctrl(fe, 0); -- -- if (status < 0) -- printk(KERN_ERR "Can't read from address 0x%02x,\n", -- subAddress + i); -- -- return status; --} -- --/* -- * FIXME: Is this really needed? -- */ --static int MT2063_Sleep(struct dvb_frontend *fe) --{ -- /* -- * ToDo: Add code here to implement a OS blocking -- */ -- msleep(10); -- -- return 0; --} -- --/* -- * Microtune spur avoidance -- */ -- --/* Implement ceiling, floor functions. */ --#define ceil(n, d) (((n) < 0) ? (-((-(n))/(d))) : (n)/(d) + ((n)%(d) != 0)) --#define floor(n, d) (((n) < 0) ? (-((-(n))/(d))) - ((n)%(d) != 0) : (n)/(d)) -- --struct MT2063_FIFZone_t { -- s32 min_; -- s32 max_; --}; -- --static struct MT2063_ExclZone_t *InsertNode(struct MT2063_AvoidSpursData_t -- *pAS_Info, -- struct MT2063_ExclZone_t *pPrevNode) --{ -- struct MT2063_ExclZone_t *pNode; -- -- dprintk(2, "\n"); -- -- /* Check for a node in the free list */ -- if (pAS_Info->freeZones != NULL) { -- /* Use one from the free list */ -- pNode = pAS_Info->freeZones; -- pAS_Info->freeZones = pNode->next_; -- } else { -- /* Grab a node from the array */ -- pNode = &pAS_Info->MT2063_ExclZones[pAS_Info->nZones]; -- } -- -- if (pPrevNode != NULL) { -- pNode->next_ = pPrevNode->next_; -- pPrevNode->next_ = pNode; -- } else { /* insert at the beginning of the list */ -- -- pNode->next_ = pAS_Info->usedZones; -- pAS_Info->usedZones = pNode; -- } -- -- pAS_Info->nZones++; -- return pNode; --} -- --static struct MT2063_ExclZone_t *RemoveNode(struct MT2063_AvoidSpursData_t -- *pAS_Info, -- struct MT2063_ExclZone_t *pPrevNode, -- struct MT2063_ExclZone_t -- *pNodeToRemove) --{ -- struct MT2063_ExclZone_t *pNext = pNodeToRemove->next_; -- -- dprintk(2, "\n"); -- -- /* Make previous node point to the subsequent node */ -- if (pPrevNode != NULL) -- pPrevNode->next_ = pNext; -- -- /* Add pNodeToRemove to the beginning of the freeZones */ -- pNodeToRemove->next_ = pAS_Info->freeZones; -- pAS_Info->freeZones = pNodeToRemove; -- -- /* Decrement node count */ -- pAS_Info->nZones--; -- -- return pNext; --} -- --/* -- * MT_AddExclZone() -- * -- * Add (and merge) an exclusion zone into the list. -- * If the range (f_min, f_max) is totally outside the -- * 1st IF BW, ignore the entry. -- * If the range (f_min, f_max) is negative, ignore the entry. -- */ --static void MT2063_AddExclZone(struct MT2063_AvoidSpursData_t *pAS_Info, -- u32 f_min, u32 f_max) --{ -- struct MT2063_ExclZone_t *pNode = pAS_Info->usedZones; -- struct MT2063_ExclZone_t *pPrev = NULL; -- struct MT2063_ExclZone_t *pNext = NULL; -- -- dprintk(2, "\n"); -- -- /* Check to see if this overlaps the 1st IF filter */ -- if ((f_max > (pAS_Info->f_if1_Center - (pAS_Info->f_if1_bw / 2))) -- && (f_min < (pAS_Info->f_if1_Center + (pAS_Info->f_if1_bw / 2))) -- && (f_min < f_max)) { -- /* -- * 1 2 3 4 5 6 -- * -- * New entry: |---| |--| |--| |-| |---| |--| -- * or or or or or -- * Existing: |--| |--| |--| |---| |-| |--| -- */ -- -- /* Check for our place in the list */ -- while ((pNode != NULL) && (pNode->max_ < f_min)) { -- pPrev = pNode; -- pNode = pNode->next_; -- } -- -- if ((pNode != NULL) && (pNode->min_ < f_max)) { -- /* Combine me with pNode */ -- if (f_min < pNode->min_) -- pNode->min_ = f_min; -- if (f_max > pNode->max_) -- pNode->max_ = f_max; -- } else { -- pNode = InsertNode(pAS_Info, pPrev); -- pNode->min_ = f_min; -- pNode->max_ = f_max; -- } -- -- /* Look for merging possibilities */ -- pNext = pNode->next_; -- while ((pNext != NULL) && (pNext->min_ < pNode->max_)) { -- if (pNext->max_ > pNode->max_) -- pNode->max_ = pNext->max_; -- /* Remove pNext, return ptr to pNext->next */ -- pNext = RemoveNode(pAS_Info, pNode, pNext); -- } -- } --} -- --/* -- * Reset all exclusion zones. -- * Add zones to protect the PLL FracN regions near zero -- */ --static void MT2063_ResetExclZones(struct MT2063_AvoidSpursData_t *pAS_Info) --{ -- u32 center; -- -- dprintk(2, "\n"); -- -- pAS_Info->nZones = 0; /* this clears the used list */ -- pAS_Info->usedZones = NULL; /* reset ptr */ -- pAS_Info->freeZones = NULL; /* reset ptr */ -- -- center = -- pAS_Info->f_ref * -- ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw / 2 + -- pAS_Info->f_in) / pAS_Info->f_ref) - pAS_Info->f_in; -- while (center < -- pAS_Info->f_if1_Center + pAS_Info->f_if1_bw / 2 + -- pAS_Info->f_LO1_FracN_Avoid) { -- /* Exclude LO1 FracN */ -- MT2063_AddExclZone(pAS_Info, -- center - pAS_Info->f_LO1_FracN_Avoid, -- center - 1); -- MT2063_AddExclZone(pAS_Info, center + 1, -- center + pAS_Info->f_LO1_FracN_Avoid); -- center += pAS_Info->f_ref; -- } -- -- center = -- pAS_Info->f_ref * -- ((pAS_Info->f_if1_Center - pAS_Info->f_if1_bw / 2 - -- pAS_Info->f_out) / pAS_Info->f_ref) + pAS_Info->f_out; -- while (center < -- pAS_Info->f_if1_Center + pAS_Info->f_if1_bw / 2 + -- pAS_Info->f_LO2_FracN_Avoid) { -- /* Exclude LO2 FracN */ -- MT2063_AddExclZone(pAS_Info, -- center - pAS_Info->f_LO2_FracN_Avoid, -- center - 1); -- MT2063_AddExclZone(pAS_Info, center + 1, -- center + pAS_Info->f_LO2_FracN_Avoid); -- center += pAS_Info->f_ref; -- } -- -- if (MT2063_EXCLUDE_US_DECT_FREQUENCIES(pAS_Info->avoidDECT)) { -- /* Exclude LO1 values that conflict with DECT channels */ -- MT2063_AddExclZone(pAS_Info, 1920836000 - pAS_Info->f_in, 1922236000 - pAS_Info->f_in); /* Ctr = 1921.536 */ -- MT2063_AddExclZone(pAS_Info, 1922564000 - pAS_Info->f_in, 1923964000 - pAS_Info->f_in); /* Ctr = 1923.264 */ -- MT2063_AddExclZone(pAS_Info, 1924292000 - pAS_Info->f_in, 1925692000 - pAS_Info->f_in); /* Ctr = 1924.992 */ -- MT2063_AddExclZone(pAS_Info, 1926020000 - pAS_Info->f_in, 1927420000 - pAS_Info->f_in); /* Ctr = 1926.720 */ -- MT2063_AddExclZone(pAS_Info, 1927748000 - pAS_Info->f_in, 1929148000 - pAS_Info->f_in); /* Ctr = 1928.448 */ -- } -- -- if (MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(pAS_Info->avoidDECT)) { -- MT2063_AddExclZone(pAS_Info, 1896644000 - pAS_Info->f_in, 1898044000 - pAS_Info->f_in); /* Ctr = 1897.344 */ -- MT2063_AddExclZone(pAS_Info, 1894916000 - pAS_Info->f_in, 1896316000 - pAS_Info->f_in); /* Ctr = 1895.616 */ -- MT2063_AddExclZone(pAS_Info, 1893188000 - pAS_Info->f_in, 1894588000 - pAS_Info->f_in); /* Ctr = 1893.888 */ -- MT2063_AddExclZone(pAS_Info, 1891460000 - pAS_Info->f_in, 1892860000 - pAS_Info->f_in); /* Ctr = 1892.16 */ -- MT2063_AddExclZone(pAS_Info, 1889732000 - pAS_Info->f_in, 1891132000 - pAS_Info->f_in); /* Ctr = 1890.432 */ -- MT2063_AddExclZone(pAS_Info, 1888004000 - pAS_Info->f_in, 1889404000 - pAS_Info->f_in); /* Ctr = 1888.704 */ -- MT2063_AddExclZone(pAS_Info, 1886276000 - pAS_Info->f_in, 1887676000 - pAS_Info->f_in); /* Ctr = 1886.976 */ -- MT2063_AddExclZone(pAS_Info, 1884548000 - pAS_Info->f_in, 1885948000 - pAS_Info->f_in); /* Ctr = 1885.248 */ -- MT2063_AddExclZone(pAS_Info, 1882820000 - pAS_Info->f_in, 1884220000 - pAS_Info->f_in); /* Ctr = 1883.52 */ -- MT2063_AddExclZone(pAS_Info, 1881092000 - pAS_Info->f_in, 1882492000 - pAS_Info->f_in); /* Ctr = 1881.792 */ -- } --} -- --/* -- * MT_ChooseFirstIF - Choose the best available 1st IF -- * If f_Desired is not excluded, choose that first. -- * Otherwise, return the value closest to f_Center that is -- * not excluded -- */ --static u32 MT2063_ChooseFirstIF(struct MT2063_AvoidSpursData_t *pAS_Info) --{ -- /* -- * Update "f_Desired" to be the nearest "combinational-multiple" of -- * "f_LO1_Step". -- * The resulting number, F_LO1 must be a multiple of f_LO1_Step. -- * And F_LO1 is the arithmetic sum of f_in + f_Center. -- * Neither f_in, nor f_Center must be a multiple of f_LO1_Step. -- * However, the sum must be. -- */ -- const u32 f_Desired = -- pAS_Info->f_LO1_Step * -- ((pAS_Info->f_if1_Request + pAS_Info->f_in + -- pAS_Info->f_LO1_Step / 2) / pAS_Info->f_LO1_Step) - -- pAS_Info->f_in; -- const u32 f_Step = -- (pAS_Info->f_LO1_Step > -- pAS_Info->f_LO2_Step) ? pAS_Info->f_LO1_Step : pAS_Info-> -- f_LO2_Step; -- u32 f_Center; -- s32 i; -- s32 j = 0; -- u32 bDesiredExcluded = 0; -- u32 bZeroExcluded = 0; -- s32 tmpMin, tmpMax; -- s32 bestDiff; -- struct MT2063_ExclZone_t *pNode = pAS_Info->usedZones; -- struct MT2063_FIFZone_t zones[MT2063_MAX_ZONES]; -- -- dprintk(2, "\n"); -- -- if (pAS_Info->nZones == 0) -- return f_Desired; -- -- /* -- * f_Center needs to be an integer multiple of f_Step away -- * from f_Desired -- */ -- if (pAS_Info->f_if1_Center > f_Desired) -- f_Center = -- f_Desired + -- f_Step * -- ((pAS_Info->f_if1_Center - f_Desired + -- f_Step / 2) / f_Step); -- else -- f_Center = -- f_Desired - -- f_Step * -- ((f_Desired - pAS_Info->f_if1_Center + -- f_Step / 2) / f_Step); -- -- /* -- * Take MT_ExclZones, center around f_Center and change the -- * resolution to f_Step -- */ -- while (pNode != NULL) { -- /* floor function */ -- tmpMin = -- floor((s32) (pNode->min_ - f_Center), (s32) f_Step); -- -- /* ceil function */ -- tmpMax = -- ceil((s32) (pNode->max_ - f_Center), (s32) f_Step); -- -- if ((pNode->min_ < f_Desired) && (pNode->max_ > f_Desired)) -- bDesiredExcluded = 1; -- -- if ((tmpMin < 0) && (tmpMax > 0)) -- bZeroExcluded = 1; -- -- /* See if this zone overlaps the previous */ -- if ((j > 0) && (tmpMin < zones[j - 1].max_)) -- zones[j - 1].max_ = tmpMax; -- else { -- /* Add new zone */ -- zones[j].min_ = tmpMin; -- zones[j].max_ = tmpMax; -- j++; -- } -- pNode = pNode->next_; -- } -- -- /* -- * If the desired is okay, return with it -- */ -- if (bDesiredExcluded == 0) -- return f_Desired; -- -- /* -- * If the desired is excluded and the center is okay, return with it -- */ -- if (bZeroExcluded == 0) -- return f_Center; -- -- /* Find the value closest to 0 (f_Center) */ -- bestDiff = zones[0].min_; -- for (i = 0; i < j; i++) { -- if (abs(zones[i].min_) < abs(bestDiff)) -- bestDiff = zones[i].min_; -- if (abs(zones[i].max_) < abs(bestDiff)) -- bestDiff = zones[i].max_; -- } -- -- if (bestDiff < 0) -- return f_Center - ((u32) (-bestDiff) * f_Step); -- -- return f_Center + (bestDiff * f_Step); --} -- --/** -- * gcd() - Uses Euclid's algorithm -- * -- * @u, @v: Unsigned values whose GCD is desired. -- * -- * Returns THE greatest common divisor of u and v, if either value is 0, -- * the other value is returned as the result. -- */ --static u32 MT2063_gcd(u32 u, u32 v) --{ -- u32 r; -- -- while (v != 0) { -- r = u % v; -- u = v; -- v = r; -- } -- -- return u; --} -- --/** -- * IsSpurInBand() - Checks to see if a spur will be present within the IF's -- * bandwidth. (fIFOut +/- fIFBW, -fIFOut +/- fIFBW) -- * -- * ma mb mc md -- * <--+-+-+-------------------+-------------------+-+-+--> -- * | ^ 0 ^ | -- * ^ b=-fIFOut+fIFBW/2 -b=+fIFOut-fIFBW/2 ^ -- * a=-fIFOut-fIFBW/2 -a=+fIFOut+fIFBW/2 -- * -- * Note that some equations are doubled to prevent round-off -- * problems when calculating fIFBW/2 -- * -- * @pAS_Info: Avoid Spurs information block -- * @fm: If spur, amount f_IF1 has to move negative -- * @fp: If spur, amount f_IF1 has to move positive -- * -- * Returns 1 if an LO spur would be present, otherwise 0. -- */ --static u32 IsSpurInBand(struct MT2063_AvoidSpursData_t *pAS_Info, -- u32 *fm, u32 * fp) --{ -- /* -- ** Calculate LO frequency settings. -- */ -- u32 n, n0; -- const u32 f_LO1 = pAS_Info->f_LO1; -- const u32 f_LO2 = pAS_Info->f_LO2; -- const u32 d = pAS_Info->f_out + pAS_Info->f_out_bw / 2; -- const u32 c = d - pAS_Info->f_out_bw; -- const u32 f = pAS_Info->f_zif_bw / 2; -- const u32 f_Scale = (f_LO1 / (UINT_MAX / 2 / pAS_Info->maxH1)) + 1; -- s32 f_nsLO1, f_nsLO2; -- s32 f_Spur; -- u32 ma, mb, mc, md, me, mf; -- u32 lo_gcd, gd_Scale, gc_Scale, gf_Scale, hgds, hgfs, hgcs; -- -- dprintk(2, "\n"); -- -- *fm = 0; -- -- /* -- ** For each edge (d, c & f), calculate a scale, based on the gcd -- ** of f_LO1, f_LO2 and the edge value. Use the larger of this -- ** gcd-based scale factor or f_Scale. -- */ -- lo_gcd = MT2063_gcd(f_LO1, f_LO2); -- gd_Scale = max((u32) MT2063_gcd(lo_gcd, d), f_Scale); -- hgds = gd_Scale / 2; -- gc_Scale = max((u32) MT2063_gcd(lo_gcd, c), f_Scale); -- hgcs = gc_Scale / 2; -- gf_Scale = max((u32) MT2063_gcd(lo_gcd, f), f_Scale); -- hgfs = gf_Scale / 2; -- -- n0 = DIV_ROUND_UP(f_LO2 - d, f_LO1 - f_LO2); -- -- /* Check out all multiples of LO1 from n0 to m_maxLOSpurHarmonic */ -- for (n = n0; n <= pAS_Info->maxH1; ++n) { -- md = (n * ((f_LO1 + hgds) / gd_Scale) - -- ((d + hgds) / gd_Scale)) / ((f_LO2 + hgds) / gd_Scale); -- -- /* If # fLO2 harmonics > m_maxLOSpurHarmonic, then no spurs present */ -- if (md >= pAS_Info->maxH1) -- break; -- -- ma = (n * ((f_LO1 + hgds) / gd_Scale) + -- ((d + hgds) / gd_Scale)) / ((f_LO2 + hgds) / gd_Scale); -- -- /* If no spurs between +/- (f_out + f_IFBW/2), then try next harmonic */ -- if (md == ma) -- continue; -- -- mc = (n * ((f_LO1 + hgcs) / gc_Scale) - -- ((c + hgcs) / gc_Scale)) / ((f_LO2 + hgcs) / gc_Scale); -- if (mc != md) { -- f_nsLO1 = (s32) (n * (f_LO1 / gc_Scale)); -- f_nsLO2 = (s32) (mc * (f_LO2 / gc_Scale)); -- f_Spur = -- (gc_Scale * (f_nsLO1 - f_nsLO2)) + -- n * (f_LO1 % gc_Scale) - mc * (f_LO2 % gc_Scale); -- -- *fp = ((f_Spur - (s32) c) / (mc - n)) + 1; -- *fm = (((s32) d - f_Spur) / (mc - n)) + 1; -- return 1; -- } -- -- /* Location of Zero-IF-spur to be checked */ -- me = (n * ((f_LO1 + hgfs) / gf_Scale) + -- ((f + hgfs) / gf_Scale)) / ((f_LO2 + hgfs) / gf_Scale); -- mf = (n * ((f_LO1 + hgfs) / gf_Scale) - -- ((f + hgfs) / gf_Scale)) / ((f_LO2 + hgfs) / gf_Scale); -- if (me != mf) { -- f_nsLO1 = n * (f_LO1 / gf_Scale); -- f_nsLO2 = me * (f_LO2 / gf_Scale); -- f_Spur = -- (gf_Scale * (f_nsLO1 - f_nsLO2)) + -- n * (f_LO1 % gf_Scale) - me * (f_LO2 % gf_Scale); -- -- *fp = ((f_Spur + (s32) f) / (me - n)) + 1; -- *fm = (((s32) f - f_Spur) / (me - n)) + 1; -- return 1; -- } -- -- mb = (n * ((f_LO1 + hgcs) / gc_Scale) + -- ((c + hgcs) / gc_Scale)) / ((f_LO2 + hgcs) / gc_Scale); -- if (ma != mb) { -- f_nsLO1 = n * (f_LO1 / gc_Scale); -- f_nsLO2 = ma * (f_LO2 / gc_Scale); -- f_Spur = -- (gc_Scale * (f_nsLO1 - f_nsLO2)) + -- n * (f_LO1 % gc_Scale) - ma * (f_LO2 % gc_Scale); -- -- *fp = (((s32) d + f_Spur) / (ma - n)) + 1; -- *fm = (-(f_Spur + (s32) c) / (ma - n)) + 1; -- return 1; -- } -- } -- -- /* No spurs found */ -- return 0; --} -- --/* -- * MT_AvoidSpurs() - Main entry point to avoid spurs. -- * Checks for existing spurs in present LO1, LO2 freqs -- * and if present, chooses spur-free LO1, LO2 combination -- * that tunes the same input/output frequencies. -- */ --static u32 MT2063_AvoidSpurs(struct MT2063_AvoidSpursData_t *pAS_Info) --{ -- u32 status = 0; -- u32 fm, fp; /* restricted range on LO's */ -- pAS_Info->bSpurAvoided = 0; -- pAS_Info->nSpursFound = 0; -- -- dprintk(2, "\n"); -- -- if (pAS_Info->maxH1 == 0) -- return 0; -- -- /* -- * Avoid LO Generated Spurs -- * -- * Make sure that have no LO-related spurs within the IF output -- * bandwidth. -- * -- * If there is an LO spur in this band, start at the current IF1 frequency -- * and work out until we find a spur-free frequency or run up against the -- * 1st IF SAW band edge. Use temporary copies of fLO1 and fLO2 so that they -- * will be unchanged if a spur-free setting is not found. -- */ -- pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp); -- if (pAS_Info->bSpurPresent) { -- u32 zfIF1 = pAS_Info->f_LO1 - pAS_Info->f_in; /* current attempt at a 1st IF */ -- u32 zfLO1 = pAS_Info->f_LO1; /* current attempt at an LO1 freq */ -- u32 zfLO2 = pAS_Info->f_LO2; /* current attempt at an LO2 freq */ -- u32 delta_IF1; -- u32 new_IF1; -- -- /* -- ** Spur was found, attempt to find a spur-free 1st IF -- */ -- do { -- pAS_Info->nSpursFound++; -- -- /* Raise f_IF1_upper, if needed */ -- MT2063_AddExclZone(pAS_Info, zfIF1 - fm, zfIF1 + fp); -- -- /* Choose next IF1 that is closest to f_IF1_CENTER */ -- new_IF1 = MT2063_ChooseFirstIF(pAS_Info); -- -- if (new_IF1 > zfIF1) { -- pAS_Info->f_LO1 += (new_IF1 - zfIF1); -- pAS_Info->f_LO2 += (new_IF1 - zfIF1); -- } else { -- pAS_Info->f_LO1 -= (zfIF1 - new_IF1); -- pAS_Info->f_LO2 -= (zfIF1 - new_IF1); -- } -- zfIF1 = new_IF1; -- -- if (zfIF1 > pAS_Info->f_if1_Center) -- delta_IF1 = zfIF1 - pAS_Info->f_if1_Center; -- else -- delta_IF1 = pAS_Info->f_if1_Center - zfIF1; -- -- pAS_Info->bSpurPresent = IsSpurInBand(pAS_Info, &fm, &fp); -- /* -- * Continue while the new 1st IF is still within the 1st IF bandwidth -- * and there is a spur in the band (again) -- */ -- } while ((2 * delta_IF1 + pAS_Info->f_out_bw <= pAS_Info->f_if1_bw) && pAS_Info->bSpurPresent); -- -- /* -- * Use the LO-spur free values found. If the search went all -- * the way to the 1st IF band edge and always found spurs, just -- * leave the original choice. It's as "good" as any other. -- */ -- if (pAS_Info->bSpurPresent == 1) { -- status |= MT2063_SPUR_PRESENT_ERR; -- pAS_Info->f_LO1 = zfLO1; -- pAS_Info->f_LO2 = zfLO2; -- } else -- pAS_Info->bSpurAvoided = 1; -- } -- -- status |= -- ((pAS_Info-> -- nSpursFound << MT2063_SPUR_SHIFT) & MT2063_SPUR_CNT_MASK); -- -- return status; --} -- --/* -- * Constants used by the tuning algorithm -- */ --#define MT2063_REF_FREQ (16000000UL) /* Reference oscillator Frequency (in Hz) */ --#define MT2063_IF1_BW (22000000UL) /* The IF1 filter bandwidth (in Hz) */ --#define MT2063_TUNE_STEP_SIZE (50000UL) /* Tune in steps of 50 kHz */ --#define MT2063_SPUR_STEP_HZ (250000UL) /* Step size (in Hz) to move IF1 when avoiding spurs */ --#define MT2063_ZIF_BW (2000000UL) /* Zero-IF spur-free bandwidth (in Hz) */ --#define MT2063_MAX_HARMONICS_1 (15UL) /* Highest intra-tuner LO Spur Harmonic to be avoided */ --#define MT2063_MAX_HARMONICS_2 (5UL) /* Highest inter-tuner LO Spur Harmonic to be avoided */ --#define MT2063_MIN_LO_SEP (1000000UL) /* Minimum inter-tuner LO frequency separation */ --#define MT2063_LO1_FRACN_AVOID (0UL) /* LO1 FracN numerator avoid region (in Hz) */ --#define MT2063_LO2_FRACN_AVOID (199999UL) /* LO2 FracN numerator avoid region (in Hz) */ --#define MT2063_MIN_FIN_FREQ (44000000UL) /* Minimum input frequency (in Hz) */ --#define MT2063_MAX_FIN_FREQ (1100000000UL) /* Maximum input frequency (in Hz) */ --#define MT2063_MIN_FOUT_FREQ (36000000UL) /* Minimum output frequency (in Hz) */ --#define MT2063_MAX_FOUT_FREQ (57000000UL) /* Maximum output frequency (in Hz) */ --#define MT2063_MIN_DNC_FREQ (1293000000UL) /* Minimum LO2 frequency (in Hz) */ --#define MT2063_MAX_DNC_FREQ (1614000000UL) /* Maximum LO2 frequency (in Hz) */ --#define MT2063_MIN_UPC_FREQ (1396000000UL) /* Minimum LO1 frequency (in Hz) */ --#define MT2063_MAX_UPC_FREQ (2750000000UL) /* Maximum LO1 frequency (in Hz) */ -- --/* -- * Define the supported Part/Rev codes for the MT2063 -- */ --#define MT2063_B0 (0x9B) --#define MT2063_B1 (0x9C) --#define MT2063_B2 (0x9D) --#define MT2063_B3 (0x9E) -- --/** -- * mt2063_lockStatus - Checks to see if LO1 and LO2 are locked -- * -- * @state: struct mt2063_state pointer -- * -- * This function returns 0, if no lock, 1 if locked and a value < 1 if error -- */ --static unsigned int mt2063_lockStatus(struct mt2063_state *state) --{ -- const u32 nMaxWait = 100; /* wait a maximum of 100 msec */ -- const u32 nPollRate = 2; /* poll status bits every 2 ms */ -- const u32 nMaxLoops = nMaxWait / nPollRate; -- const u8 LO1LK = 0x80; -- u8 LO2LK = 0x08; -- u32 status; -- u32 nDelays = 0; -- -- dprintk(2, "\n"); -- -- /* LO2 Lock bit was in a different place for B0 version */ -- if (state->tuner_id == MT2063_B0) -- LO2LK = 0x40; -- -- do { -- status = mt2063_read(state, MT2063_REG_LO_STATUS, -- &state->reg[MT2063_REG_LO_STATUS], 1); -- -- if (status < 0) -- return status; -- -- if ((state->reg[MT2063_REG_LO_STATUS] & (LO1LK | LO2LK)) == -- (LO1LK | LO2LK)) { -- return TUNER_STATUS_LOCKED | TUNER_STATUS_STEREO; -- } -- msleep(nPollRate); /* Wait between retries */ -- } while (++nDelays < nMaxLoops); -- -- /* -- * Got no lock or partial lock -- */ -- return 0; --} -- --/* -- * Constants for setting receiver modes. -- * (6 modes defined at this time, enumerated by mt2063_delivery_sys) -- * (DNC1GC & DNC2GC are the values, which are used, when the specific -- * DNC Output is selected, the other is always off) -- * -- * enum mt2063_delivery_sys -- * -------------+---------------------------------------------- -- * Mode 0 : | MT2063_CABLE_QAM -- * Mode 1 : | MT2063_CABLE_ANALOG -- * Mode 2 : | MT2063_OFFAIR_COFDM -- * Mode 3 : | MT2063_OFFAIR_COFDM_SAWLESS -- * Mode 4 : | MT2063_OFFAIR_ANALOG -- * Mode 5 : | MT2063_OFFAIR_8VSB -- * --------------+---------------------------------------------- -- * -- * |<---------- Mode -------------->| -- * Reg Field | 0 | 1 | 2 | 3 | 4 | 5 | -- * ------------+-----+-----+-----+-----+-----+-----+ -- * RFAGCen | OFF | OFF | OFF | OFF | OFF | OFF -- * LNARin | 0 | 0 | 3 | 3 | 3 | 3 -- * FIFFQen | 1 | 1 | 1 | 1 | 1 | 1 -- * FIFFq | 0 | 0 | 0 | 0 | 0 | 0 -- * DNC1gc | 0 | 0 | 0 | 0 | 0 | 0 -- * DNC2gc | 0 | 0 | 0 | 0 | 0 | 0 -- * GCU Auto | 1 | 1 | 1 | 1 | 1 | 1 -- * LNA max Atn | 31 | 31 | 31 | 31 | 31 | 31 -- * LNA Target | 44 | 43 | 43 | 43 | 43 | 43 -- * ign RF Ovl | 0 | 0 | 0 | 0 | 0 | 0 -- * RF max Atn | 31 | 31 | 31 | 31 | 31 | 31 -- * PD1 Target | 36 | 36 | 38 | 38 | 36 | 38 -- * ign FIF Ovl | 0 | 0 | 0 | 0 | 0 | 0 -- * FIF max Atn | 5 | 5 | 5 | 5 | 5 | 5 -- * PD2 Target | 40 | 33 | 42 | 42 | 33 | 42 -- */ -- --enum mt2063_delivery_sys { -- MT2063_CABLE_QAM = 0, -- MT2063_CABLE_ANALOG, -- MT2063_OFFAIR_COFDM, -- MT2063_OFFAIR_COFDM_SAWLESS, -- MT2063_OFFAIR_ANALOG, -- MT2063_OFFAIR_8VSB, -- MT2063_NUM_RCVR_MODES --}; -- --static const char *mt2063_mode_name[] = { -- [MT2063_CABLE_QAM] = "digital cable", -- [MT2063_CABLE_ANALOG] = "analog cable", -- [MT2063_OFFAIR_COFDM] = "digital offair", -- [MT2063_OFFAIR_COFDM_SAWLESS] = "digital offair without SAW", -- [MT2063_OFFAIR_ANALOG] = "analog offair", -- [MT2063_OFFAIR_8VSB] = "analog offair 8vsb", --}; -- --static const u8 RFAGCEN[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 LNARIN[] = { 0, 0, 3, 3, 3, 3 }; --static const u8 FIFFQEN[] = { 1, 1, 1, 1, 1, 1 }; --static const u8 FIFFQ[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 DNC1GC[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 DNC2GC[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 ACLNAMAX[] = { 31, 31, 31, 31, 31, 31 }; --static const u8 LNATGT[] = { 44, 43, 43, 43, 43, 43 }; --static const u8 RFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 ACRFMAX[] = { 31, 31, 31, 31, 31, 31 }; --static const u8 PD1TGT[] = { 36, 36, 38, 38, 36, 38 }; --static const u8 FIFOVDIS[] = { 0, 0, 0, 0, 0, 0 }; --static const u8 ACFIFMAX[] = { 29, 29, 29, 29, 29, 29 }; --static const u8 PD2TGT[] = { 40, 33, 38, 42, 30, 38 }; -- --/* -- * mt2063_set_dnc_output_enable() -- */ --static u32 mt2063_get_dnc_output_enable(struct mt2063_state *state, -- enum MT2063_DNC_Output_Enable *pValue) --{ -- dprintk(2, "\n"); -- -- if ((state->reg[MT2063_REG_DNC_GAIN] & 0x03) == 0x03) { /* if DNC1 is off */ -- if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ -- *pValue = MT2063_DNC_NONE; -- else -- *pValue = MT2063_DNC_2; -- } else { /* DNC1 is on */ -- if ((state->reg[MT2063_REG_VGA_GAIN] & 0x03) == 0x03) /* if DNC2 is off */ -- *pValue = MT2063_DNC_1; -- else -- *pValue = MT2063_DNC_BOTH; -- } -- return 0; --} -- --/* -- * mt2063_set_dnc_output_enable() -- */ --static u32 mt2063_set_dnc_output_enable(struct mt2063_state *state, -- enum MT2063_DNC_Output_Enable nValue) --{ -- u32 status = 0; /* Status to be returned */ -- u8 val = 0; -- -- dprintk(2, "\n"); -- -- /* selects, which DNC output is used */ -- switch (nValue) { -- case MT2063_DNC_NONE: -- val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | 0x03; /* Set DNC1GC=3 */ -- if (state->reg[MT2063_REG_DNC_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_DNC_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | 0x03; /* Set DNC2GC=3 */ -- if (state->reg[MT2063_REG_VGA_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_VGA_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_RSVD_20] & ~0x40); /* Set PD2MUX=0 */ -- if (state->reg[MT2063_REG_RSVD_20] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_RSVD_20, -- val); -- -- break; -- case MT2063_DNC_1: -- val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | (DNC1GC[state->rcvr_mode] & 0x03); /* Set DNC1GC=x */ -- if (state->reg[MT2063_REG_DNC_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_DNC_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | 0x03; /* Set DNC2GC=3 */ -- if (state->reg[MT2063_REG_VGA_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_VGA_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_RSVD_20] & ~0x40); /* Set PD2MUX=0 */ -- if (state->reg[MT2063_REG_RSVD_20] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_RSVD_20, -- val); -- -- break; -- case MT2063_DNC_2: -- val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | 0x03; /* Set DNC1GC=3 */ -- if (state->reg[MT2063_REG_DNC_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_DNC_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | (DNC2GC[state->rcvr_mode] & 0x03); /* Set DNC2GC=x */ -- if (state->reg[MT2063_REG_VGA_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_VGA_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_RSVD_20] | 0x40); /* Set PD2MUX=1 */ -- if (state->reg[MT2063_REG_RSVD_20] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_RSVD_20, -- val); -- -- break; -- case MT2063_DNC_BOTH: -- val = (state->reg[MT2063_REG_DNC_GAIN] & 0xFC) | (DNC1GC[state->rcvr_mode] & 0x03); /* Set DNC1GC=x */ -- if (state->reg[MT2063_REG_DNC_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_DNC_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_VGA_GAIN] & 0xFC) | (DNC2GC[state->rcvr_mode] & 0x03); /* Set DNC2GC=x */ -- if (state->reg[MT2063_REG_VGA_GAIN] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_VGA_GAIN, -- val); -- -- val = (state->reg[MT2063_REG_RSVD_20] | 0x40); /* Set PD2MUX=1 */ -- if (state->reg[MT2063_REG_RSVD_20] != -- val) -- status |= -- mt2063_setreg(state, -- MT2063_REG_RSVD_20, -- val); -- -- break; -- default: -- break; -- } -- -- return status; --} -- --/* -- * MT2063_SetReceiverMode() - Set the MT2063 receiver mode, according with -- * the selected enum mt2063_delivery_sys type. -- * -- * (DNC1GC & DNC2GC are the values, which are used, when the specific -- * DNC Output is selected, the other is always off) -- * -- * @state: ptr to mt2063_state structure -- * @Mode: desired reciever delivery system -- * -- * Note: Register cache must be valid for it to work -- */ -- --static u32 MT2063_SetReceiverMode(struct mt2063_state *state, -- enum mt2063_delivery_sys Mode) --{ -- u32 status = 0; /* Status to be returned */ -- u8 val; -- u32 longval; -- -- dprintk(2, "\n"); -- -- if (Mode >= MT2063_NUM_RCVR_MODES) -- status = -ERANGE; -- -- /* RFAGCen */ -- if (status >= 0) { -- val = -- (state-> -- reg[MT2063_REG_PD1_TGT] & (u8) ~0x40) | (RFAGCEN[Mode] -- ? 0x40 : -- 0x00); -- if (state->reg[MT2063_REG_PD1_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); -- } -- -- /* LNARin */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_CTRL_2C] & (u8) ~0x03) | -- (LNARIN[Mode] & 0x03); -- if (state->reg[MT2063_REG_CTRL_2C] != val) -- status |= mt2063_setreg(state, MT2063_REG_CTRL_2C, val); -- } -- -- /* FIFFQEN and FIFFQ */ -- if (status >= 0) { -- val = -- (state-> -- reg[MT2063_REG_FIFF_CTRL2] & (u8) ~0xF0) | -- (FIFFQEN[Mode] << 7) | (FIFFQ[Mode] << 4); -- if (state->reg[MT2063_REG_FIFF_CTRL2] != val) { -- status |= -- mt2063_setreg(state, MT2063_REG_FIFF_CTRL2, val); -- /* trigger FIFF calibration, needed after changing FIFFQ */ -- val = -- (state->reg[MT2063_REG_FIFF_CTRL] | (u8) 0x01); -- status |= -- mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); -- val = -- (state-> -- reg[MT2063_REG_FIFF_CTRL] & (u8) ~0x01); -- status |= -- mt2063_setreg(state, MT2063_REG_FIFF_CTRL, val); -- } -- } -- -- /* DNC1GC & DNC2GC */ -- status |= mt2063_get_dnc_output_enable(state, &longval); -- status |= mt2063_set_dnc_output_enable(state, longval); -- -- /* acLNAmax */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_LNA_OV] & (u8) ~0x1F) | -- (ACLNAMAX[Mode] & 0x1F); -- if (state->reg[MT2063_REG_LNA_OV] != val) -- status |= mt2063_setreg(state, MT2063_REG_LNA_OV, val); -- } -- -- /* LNATGT */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x3F) | -- (LNATGT[Mode] & 0x3F); -- if (state->reg[MT2063_REG_LNA_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); -- } -- -- /* ACRF */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_RF_OV] & (u8) ~0x1F) | -- (ACRFMAX[Mode] & 0x1F); -- if (state->reg[MT2063_REG_RF_OV] != val) -- status |= mt2063_setreg(state, MT2063_REG_RF_OV, val); -- } -- -- /* PD1TGT */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x3F) | -- (PD1TGT[Mode] & 0x3F); -- if (state->reg[MT2063_REG_PD1_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); -- } -- -- /* FIFATN */ -- if (status >= 0) { -- u8 val = ACFIFMAX[Mode]; -- if (state->reg[MT2063_REG_PART_REV] != MT2063_B3 && val > 5) -- val = 5; -- val = (state->reg[MT2063_REG_FIF_OV] & (u8) ~0x1F) | -- (val & 0x1F); -- if (state->reg[MT2063_REG_FIF_OV] != val) -- status |= mt2063_setreg(state, MT2063_REG_FIF_OV, val); -- } -- -- /* PD2TGT */ -- if (status >= 0) { -- u8 val = (state->reg[MT2063_REG_PD2_TGT] & (u8) ~0x3F) | -- (PD2TGT[Mode] & 0x3F); -- if (state->reg[MT2063_REG_PD2_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_PD2_TGT, val); -- } -- -- /* Ignore ATN Overload */ -- if (status >= 0) { -- val = (state->reg[MT2063_REG_LNA_TGT] & (u8) ~0x80) | -- (RFOVDIS[Mode] ? 0x80 : 0x00); -- if (state->reg[MT2063_REG_LNA_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_LNA_TGT, val); -- } -- -- /* Ignore FIF Overload */ -- if (status >= 0) { -- val = (state->reg[MT2063_REG_PD1_TGT] & (u8) ~0x80) | -- (FIFOVDIS[Mode] ? 0x80 : 0x00); -- if (state->reg[MT2063_REG_PD1_TGT] != val) -- status |= mt2063_setreg(state, MT2063_REG_PD1_TGT, val); -- } -- -- if (status >= 0) { -- state->rcvr_mode = Mode; -- dprintk(1, "mt2063 mode changed to %s\n", -- mt2063_mode_name[state->rcvr_mode]); -- } -- -- return status; --} -- --/* -- * MT2063_ClearPowerMaskBits () - Clears the power-down mask bits for various -- * sections of the MT2063 -- * -- * @Bits: Mask bits to be cleared. -- * -- * See definition of MT2063_Mask_Bits type for description -- * of each of the power bits. -- */ --static u32 MT2063_ClearPowerMaskBits(struct mt2063_state *state, -- enum MT2063_Mask_Bits Bits) --{ -- u32 status = 0; -- -- dprintk(2, "\n"); -- Bits = (enum MT2063_Mask_Bits)(Bits & MT2063_ALL_SD); /* Only valid bits for this tuner */ -- if ((Bits & 0xFF00) != 0) { -- state->reg[MT2063_REG_PWR_2] &= ~(u8) (Bits >> 8); -- status |= -- mt2063_write(state, -- MT2063_REG_PWR_2, -- &state->reg[MT2063_REG_PWR_2], 1); -- } -- if ((Bits & 0xFF) != 0) { -- state->reg[MT2063_REG_PWR_1] &= ~(u8) (Bits & 0xFF); -- status |= -- mt2063_write(state, -- MT2063_REG_PWR_1, -- &state->reg[MT2063_REG_PWR_1], 1); -- } -- -- return status; --} -- --/* -- * MT2063_SoftwareShutdown() - Enables or disables software shutdown function. -- * When Shutdown is 1, any section whose power -- * mask is set will be shutdown. -- */ --static u32 MT2063_SoftwareShutdown(struct mt2063_state *state, u8 Shutdown) --{ -- u32 status; -- -- dprintk(2, "\n"); -- if (Shutdown == 1) -- state->reg[MT2063_REG_PWR_1] |= 0x04; -- else -- state->reg[MT2063_REG_PWR_1] &= ~0x04; -- -- status = mt2063_write(state, -- MT2063_REG_PWR_1, -- &state->reg[MT2063_REG_PWR_1], 1); -- -- if (Shutdown != 1) { -- state->reg[MT2063_REG_BYP_CTRL] = -- (state->reg[MT2063_REG_BYP_CTRL] & 0x9F) | 0x40; -- status |= -- mt2063_write(state, -- MT2063_REG_BYP_CTRL, -- &state->reg[MT2063_REG_BYP_CTRL], -- 1); -- state->reg[MT2063_REG_BYP_CTRL] = -- (state->reg[MT2063_REG_BYP_CTRL] & 0x9F); -- status |= -- mt2063_write(state, -- MT2063_REG_BYP_CTRL, -- &state->reg[MT2063_REG_BYP_CTRL], -- 1); -- } -- -- return status; --} -- --static u32 MT2063_Round_fLO(u32 f_LO, u32 f_LO_Step, u32 f_ref) --{ -- return f_ref * (f_LO / f_ref) -- + f_LO_Step * (((f_LO % f_ref) + (f_LO_Step / 2)) / f_LO_Step); --} -- --/** -- * fLO_FractionalTerm() - Calculates the portion contributed by FracN / denom. -- * This function preserves maximum precision without -- * risk of overflow. It accurately calculates -- * f_ref * num / denom to within 1 HZ with fixed math. -- * -- * @num : Fractional portion of the multiplier -- * @denom: denominator portion of the ratio -- * @f_Ref: SRO frequency. -- * -- * This calculation handles f_ref as two separate 14-bit fields. -- * Therefore, a maximum value of 2^28-1 may safely be used for f_ref. -- * This is the genesis of the magic number "14" and the magic mask value of -- * 0x03FFF. -- * -- * This routine successfully handles denom values up to and including 2^18. -- * Returns: f_ref * num / denom -- */ --static u32 MT2063_fLO_FractionalTerm(u32 f_ref, u32 num, u32 denom) --{ -- u32 t1 = (f_ref >> 14) * num; -- u32 term1 = t1 / denom; -- u32 loss = t1 % denom; -- u32 term2 = -- (((f_ref & 0x00003FFF) * num + (loss << 14)) + (denom / 2)) / denom; -- return (term1 << 14) + term2; --} -- --/* -- * CalcLO1Mult()- Calculates Integer divider value and the numerator -- * value for a FracN PLL. -- * -- * This function assumes that the f_LO and f_Ref are -- * evenly divisible by f_LO_Step. -- * -- * @Div: OUTPUT: Whole number portion of the multiplier -- * @FracN: OUTPUT: Fractional portion of the multiplier -- * @f_LO: desired LO frequency. -- * @f_LO_Step: Minimum step size for the LO (in Hz). -- * @f_Ref: SRO frequency. -- * @f_Avoid: Range of PLL frequencies to avoid near integer multiples -- * of f_Ref (in Hz). -- * -- * Returns: Recalculated LO frequency. -- */ --static u32 MT2063_CalcLO1Mult(u32 *Div, -- u32 *FracN, -- u32 f_LO, -- u32 f_LO_Step, u32 f_Ref) --{ -- /* Calculate the whole number portion of the divider */ -- *Div = f_LO / f_Ref; -- -- /* Calculate the numerator value (round to nearest f_LO_Step) */ -- *FracN = -- (64 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) + -- (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step); -- -- return (f_Ref * (*Div)) + MT2063_fLO_FractionalTerm(f_Ref, *FracN, 64); --} -- --/** -- * CalcLO2Mult() - Calculates Integer divider value and the numerator -- * value for a FracN PLL. -- * -- * This function assumes that the f_LO and f_Ref are -- * evenly divisible by f_LO_Step. -- * -- * @Div: OUTPUT: Whole number portion of the multiplier -- * @FracN: OUTPUT: Fractional portion of the multiplier -- * @f_LO: desired LO frequency. -- * @f_LO_Step: Minimum step size for the LO (in Hz). -- * @f_Ref: SRO frequency. -- * @f_Avoid: Range of PLL frequencies to avoid near -- * integer multiples of f_Ref (in Hz). -- * -- * Returns: Recalculated LO frequency. -- */ --static u32 MT2063_CalcLO2Mult(u32 *Div, -- u32 *FracN, -- u32 f_LO, -- u32 f_LO_Step, u32 f_Ref) --{ -- /* Calculate the whole number portion of the divider */ -- *Div = f_LO / f_Ref; -- -- /* Calculate the numerator value (round to nearest f_LO_Step) */ -- *FracN = -- (8191 * (((f_LO % f_Ref) + (f_LO_Step / 2)) / f_LO_Step) + -- (f_Ref / f_LO_Step / 2)) / (f_Ref / f_LO_Step); -- -- return (f_Ref * (*Div)) + MT2063_fLO_FractionalTerm(f_Ref, *FracN, -- 8191); --} -- --/* -- * FindClearTuneFilter() - Calculate the corrrect ClearTune filter to be -- * used for a given input frequency. -- * -- * @state: ptr to tuner data structure -- * @f_in: RF input center frequency (in Hz). -- * -- * Returns: ClearTune filter number (0-31) -- */ --static u32 FindClearTuneFilter(struct mt2063_state *state, u32 f_in) --{ -- u32 RFBand; -- u32 idx; /* index loop */ -- -- /* -- ** Find RF Band setting -- */ -- RFBand = 31; /* def when f_in > all */ -- for (idx = 0; idx < 31; ++idx) { -- if (state->CTFiltMax[idx] >= f_in) { -- RFBand = idx; -- break; -- } -- } -- return RFBand; --} -- --/* -- * MT2063_Tune() - Change the tuner's tuned frequency to RFin. -- */ --static u32 MT2063_Tune(struct mt2063_state *state, u32 f_in) --{ /* RF input center frequency */ -- -- u32 status = 0; -- u32 LO1; /* 1st LO register value */ -- u32 Num1; /* Numerator for LO1 reg. value */ -- u32 f_IF1; /* 1st IF requested */ -- u32 LO2; /* 2nd LO register value */ -- u32 Num2; /* Numerator for LO2 reg. value */ -- u32 ofLO1, ofLO2; /* last time's LO frequencies */ -- u8 fiffc = 0x80; /* FIFF center freq from tuner */ -- u32 fiffof; /* Offset from FIFF center freq */ -- const u8 LO1LK = 0x80; /* Mask for LO1 Lock bit */ -- u8 LO2LK = 0x08; /* Mask for LO2 Lock bit */ -- u8 val; -- u32 RFBand; -- -- dprintk(2, "\n"); -- /* Check the input and output frequency ranges */ -- if ((f_in < MT2063_MIN_FIN_FREQ) || (f_in > MT2063_MAX_FIN_FREQ)) -- return -EINVAL; -- -- if ((state->AS_Data.f_out < MT2063_MIN_FOUT_FREQ) -- || (state->AS_Data.f_out > MT2063_MAX_FOUT_FREQ)) -- return -EINVAL; -- -- /* -- * Save original LO1 and LO2 register values -- */ -- ofLO1 = state->AS_Data.f_LO1; -- ofLO2 = state->AS_Data.f_LO2; -- -- /* -- * Find and set RF Band setting -- */ -- if (state->ctfilt_sw == 1) { -- val = (state->reg[MT2063_REG_CTUNE_CTRL] | 0x08); -- if (state->reg[MT2063_REG_CTUNE_CTRL] != val) { -- status |= -- mt2063_setreg(state, MT2063_REG_CTUNE_CTRL, val); -- } -- val = state->reg[MT2063_REG_CTUNE_OV]; -- RFBand = FindClearTuneFilter(state, f_in); -- state->reg[MT2063_REG_CTUNE_OV] = -- (u8) ((state->reg[MT2063_REG_CTUNE_OV] & ~0x1F) -- | RFBand); -- if (state->reg[MT2063_REG_CTUNE_OV] != val) { -- status |= -- mt2063_setreg(state, MT2063_REG_CTUNE_OV, val); -- } -- } -- -- /* -- * Read the FIFF Center Frequency from the tuner -- */ -- if (status >= 0) { -- status |= -- mt2063_read(state, -- MT2063_REG_FIFFC, -- &state->reg[MT2063_REG_FIFFC], 1); -- fiffc = state->reg[MT2063_REG_FIFFC]; -- } -- /* -- * Assign in the requested values -- */ -- state->AS_Data.f_in = f_in; -- /* Request a 1st IF such that LO1 is on a step size */ -- state->AS_Data.f_if1_Request = -- MT2063_Round_fLO(state->AS_Data.f_if1_Request + f_in, -- state->AS_Data.f_LO1_Step, -- state->AS_Data.f_ref) - f_in; -- -- /* -- * Calculate frequency settings. f_IF1_FREQ + f_in is the -- * desired LO1 frequency -- */ -- MT2063_ResetExclZones(&state->AS_Data); -- -- f_IF1 = MT2063_ChooseFirstIF(&state->AS_Data); -- -- state->AS_Data.f_LO1 = -- MT2063_Round_fLO(f_IF1 + f_in, state->AS_Data.f_LO1_Step, -- state->AS_Data.f_ref); -- -- state->AS_Data.f_LO2 = -- MT2063_Round_fLO(state->AS_Data.f_LO1 - state->AS_Data.f_out - f_in, -- state->AS_Data.f_LO2_Step, state->AS_Data.f_ref); -- -- /* -- * Check for any LO spurs in the output bandwidth and adjust -- * the LO settings to avoid them if needed -- */ -- status |= MT2063_AvoidSpurs(&state->AS_Data); -- /* -- * MT_AvoidSpurs spurs may have changed the LO1 & LO2 values. -- * Recalculate the LO frequencies and the values to be placed -- * in the tuning registers. -- */ -- state->AS_Data.f_LO1 = -- MT2063_CalcLO1Mult(&LO1, &Num1, state->AS_Data.f_LO1, -- state->AS_Data.f_LO1_Step, state->AS_Data.f_ref); -- state->AS_Data.f_LO2 = -- MT2063_Round_fLO(state->AS_Data.f_LO1 - state->AS_Data.f_out - f_in, -- state->AS_Data.f_LO2_Step, state->AS_Data.f_ref); -- state->AS_Data.f_LO2 = -- MT2063_CalcLO2Mult(&LO2, &Num2, state->AS_Data.f_LO2, -- state->AS_Data.f_LO2_Step, state->AS_Data.f_ref); -- -- /* -- * Check the upconverter and downconverter frequency ranges -- */ -- if ((state->AS_Data.f_LO1 < MT2063_MIN_UPC_FREQ) -- || (state->AS_Data.f_LO1 > MT2063_MAX_UPC_FREQ)) -- status |= MT2063_UPC_RANGE; -- if ((state->AS_Data.f_LO2 < MT2063_MIN_DNC_FREQ) -- || (state->AS_Data.f_LO2 > MT2063_MAX_DNC_FREQ)) -- status |= MT2063_DNC_RANGE; -- /* LO2 Lock bit was in a different place for B0 version */ -- if (state->tuner_id == MT2063_B0) -- LO2LK = 0x40; -- -- /* -- * If we have the same LO frequencies and we're already locked, -- * then skip re-programming the LO registers. -- */ -- if ((ofLO1 != state->AS_Data.f_LO1) -- || (ofLO2 != state->AS_Data.f_LO2) -- || ((state->reg[MT2063_REG_LO_STATUS] & (LO1LK | LO2LK)) != -- (LO1LK | LO2LK))) { -- /* -- * Calculate the FIFFOF register value -- * -- * IF1_Actual -- * FIFFOF = ------------ - 8 * FIFFC - 4992 -- * f_ref/64 -- */ -- fiffof = -- (state->AS_Data.f_LO1 - -- f_in) / (state->AS_Data.f_ref / 64) - 8 * (u32) fiffc - -- 4992; -- if (fiffof > 0xFF) -- fiffof = 0xFF; -- -- /* -- * Place all of the calculated values into the local tuner -- * register fields. -- */ -- if (status >= 0) { -- state->reg[MT2063_REG_LO1CQ_1] = (u8) (LO1 & 0xFF); /* DIV1q */ -- state->reg[MT2063_REG_LO1CQ_2] = (u8) (Num1 & 0x3F); /* NUM1q */ -- state->reg[MT2063_REG_LO2CQ_1] = (u8) (((LO2 & 0x7F) << 1) /* DIV2q */ -- |(Num2 >> 12)); /* NUM2q (hi) */ -- state->reg[MT2063_REG_LO2CQ_2] = (u8) ((Num2 & 0x0FF0) >> 4); /* NUM2q (mid) */ -- state->reg[MT2063_REG_LO2CQ_3] = (u8) (0xE0 | (Num2 & 0x000F)); /* NUM2q (lo) */ -- -- /* -- * Now write out the computed register values -- * IMPORTANT: There is a required order for writing -- * (0x05 must follow all the others). -- */ -- status |= mt2063_write(state, MT2063_REG_LO1CQ_1, &state->reg[MT2063_REG_LO1CQ_1], 5); /* 0x01 - 0x05 */ -- if (state->tuner_id == MT2063_B0) { -- /* Re-write the one-shot bits to trigger the tune operation */ -- status |= mt2063_write(state, MT2063_REG_LO2CQ_3, &state->reg[MT2063_REG_LO2CQ_3], 1); /* 0x05 */ -- } -- /* Write out the FIFF offset only if it's changing */ -- if (state->reg[MT2063_REG_FIFF_OFFSET] != -- (u8) fiffof) { -- state->reg[MT2063_REG_FIFF_OFFSET] = -- (u8) fiffof; -- status |= -- mt2063_write(state, -- MT2063_REG_FIFF_OFFSET, -- &state-> -- reg[MT2063_REG_FIFF_OFFSET], -- 1); -- } -- } -- -- /* -- * Check for LO's locking -- */ -- -- if (status < 0) -- return status; -- -- status = mt2063_lockStatus(state); -- if (status < 0) -- return status; -- if (!status) -- return -EINVAL; /* Couldn't lock */ -- -- /* -- * If we locked OK, assign calculated data to mt2063_state structure -- */ -- state->f_IF1_actual = state->AS_Data.f_LO1 - f_in; -- } -- -- return status; --} -- --static const u8 MT2063B0_defaults[] = { -- /* Reg, Value */ -- 0x19, 0x05, -- 0x1B, 0x1D, -- 0x1C, 0x1F, -- 0x1D, 0x0F, -- 0x1E, 0x3F, -- 0x1F, 0x0F, -- 0x20, 0x3F, -- 0x22, 0x21, -- 0x23, 0x3F, -- 0x24, 0x20, -- 0x25, 0x3F, -- 0x27, 0xEE, -- 0x2C, 0x27, /* bit at 0x20 is cleared below */ -- 0x30, 0x03, -- 0x2C, 0x07, /* bit at 0x20 is cleared here */ -- 0x2D, 0x87, -- 0x2E, 0xAA, -- 0x28, 0xE1, /* Set the FIFCrst bit here */ -- 0x28, 0xE0, /* Clear the FIFCrst bit here */ -- 0x00 --}; -- --/* writing 0x05 0xf0 sw-resets all registers, so we write only needed changes */ --static const u8 MT2063B1_defaults[] = { -- /* Reg, Value */ -- 0x05, 0xF0, -- 0x11, 0x10, /* New Enable AFCsd */ -- 0x19, 0x05, -- 0x1A, 0x6C, -- 0x1B, 0x24, -- 0x1C, 0x28, -- 0x1D, 0x8F, -- 0x1E, 0x14, -- 0x1F, 0x8F, -- 0x20, 0x57, -- 0x22, 0x21, /* New - ver 1.03 */ -- 0x23, 0x3C, /* New - ver 1.10 */ -- 0x24, 0x20, /* New - ver 1.03 */ -- 0x2C, 0x24, /* bit at 0x20 is cleared below */ -- 0x2D, 0x87, /* FIFFQ=0 */ -- 0x2F, 0xF3, -- 0x30, 0x0C, /* New - ver 1.11 */ -- 0x31, 0x1B, /* New - ver 1.11 */ -- 0x2C, 0x04, /* bit at 0x20 is cleared here */ -- 0x28, 0xE1, /* Set the FIFCrst bit here */ -- 0x28, 0xE0, /* Clear the FIFCrst bit here */ -- 0x00 --}; -- --/* writing 0x05 0xf0 sw-resets all registers, so we write only needed changes */ --static const u8 MT2063B3_defaults[] = { -- /* Reg, Value */ -- 0x05, 0xF0, -- 0x19, 0x3D, -- 0x2C, 0x24, /* bit at 0x20 is cleared below */ -- 0x2C, 0x04, /* bit at 0x20 is cleared here */ -- 0x28, 0xE1, /* Set the FIFCrst bit here */ -- 0x28, 0xE0, /* Clear the FIFCrst bit here */ -- 0x00 --}; -- --static int mt2063_init(struct dvb_frontend *fe) --{ -- u32 status; -- struct mt2063_state *state = fe->tuner_priv; -- u8 all_resets = 0xF0; /* reset/load bits */ -- const u8 *def = NULL; -- char *step; -- u32 FCRUN; -- s32 maxReads; -- u32 fcu_osc; -- u32 i; -- -- dprintk(2, "\n"); -- -- state->rcvr_mode = MT2063_CABLE_QAM; -- -- /* Read the Part/Rev code from the tuner */ -- status = mt2063_read(state, MT2063_REG_PART_REV, -- &state->reg[MT2063_REG_PART_REV], 1); -- if (status < 0) { -- printk(KERN_ERR "Can't read mt2063 part ID\n"); -- return status; -- } -- -- /* Check the part/rev code */ -- switch (state->reg[MT2063_REG_PART_REV]) { -- case MT2063_B0: -- step = "B0"; -- break; -- case MT2063_B1: -- step = "B1"; -- break; -- case MT2063_B2: -- step = "B2"; -- break; -- case MT2063_B3: -- step = "B3"; -- break; -- default: -- printk(KERN_ERR "mt2063: Unknown mt2063 device ID (0x%02x)\n", -- state->reg[MT2063_REG_PART_REV]); -- return -ENODEV; /* Wrong tuner Part/Rev code */ -- } -- -- /* Check the 2nd byte of the Part/Rev code from the tuner */ -- status = mt2063_read(state, MT2063_REG_RSVD_3B, -- &state->reg[MT2063_REG_RSVD_3B], 1); -- -- /* b7 != 0 ==> NOT MT2063 */ -- if (status < 0 || ((state->reg[MT2063_REG_RSVD_3B] & 0x80) != 0x00)) { -- printk(KERN_ERR "mt2063: Unknown part ID (0x%02x%02x)\n", -- state->reg[MT2063_REG_PART_REV], -- state->reg[MT2063_REG_RSVD_3B]); -- return -ENODEV; /* Wrong tuner Part/Rev code */ -- } -- -- printk(KERN_INFO "mt2063: detected a mt2063 %s\n", step); -- -- /* Reset the tuner */ -- status = mt2063_write(state, MT2063_REG_LO2CQ_3, &all_resets, 1); -- if (status < 0) -- return status; -- -- /* change all of the default values that vary from the HW reset values */ -- /* def = (state->reg[PART_REV] == MT2063_B0) ? MT2063B0_defaults : MT2063B1_defaults; */ -- switch (state->reg[MT2063_REG_PART_REV]) { -- case MT2063_B3: -- def = MT2063B3_defaults; -- break; -- -- case MT2063_B1: -- def = MT2063B1_defaults; -- break; -- -- case MT2063_B0: -- def = MT2063B0_defaults; -- break; -- -- default: -- return -ENODEV; -- break; -- } -- -- while (status >= 0 && *def) { -- u8 reg = *def++; -- u8 val = *def++; -- status = mt2063_write(state, reg, &val, 1); -- } -- if (status < 0) -- return status; -- -- /* Wait for FIFF location to complete. */ -- FCRUN = 1; -- maxReads = 10; -- while (status >= 0 && (FCRUN != 0) && (maxReads-- > 0)) { -- msleep(2); -- status = mt2063_read(state, -- MT2063_REG_XO_STATUS, -- &state-> -- reg[MT2063_REG_XO_STATUS], 1); -- FCRUN = (state->reg[MT2063_REG_XO_STATUS] & 0x40) >> 6; -- } -- -- if (FCRUN != 0 || status < 0) -- return -ENODEV; -- -- status = mt2063_read(state, -- MT2063_REG_FIFFC, -- &state->reg[MT2063_REG_FIFFC], 1); -- if (status < 0) -- return status; -- -- /* Read back all the registers from the tuner */ -- status = mt2063_read(state, -- MT2063_REG_PART_REV, -- state->reg, MT2063_REG_END_REGS); -- if (status < 0) -- return status; -- -- /* Initialize the tuner state. */ -- state->tuner_id = state->reg[MT2063_REG_PART_REV]; -- state->AS_Data.f_ref = MT2063_REF_FREQ; -- state->AS_Data.f_if1_Center = (state->AS_Data.f_ref / 8) * -- ((u32) state->reg[MT2063_REG_FIFFC] + 640); -- state->AS_Data.f_if1_bw = MT2063_IF1_BW; -- state->AS_Data.f_out = 43750000UL; -- state->AS_Data.f_out_bw = 6750000UL; -- state->AS_Data.f_zif_bw = MT2063_ZIF_BW; -- state->AS_Data.f_LO1_Step = state->AS_Data.f_ref / 64; -- state->AS_Data.f_LO2_Step = MT2063_TUNE_STEP_SIZE; -- state->AS_Data.maxH1 = MT2063_MAX_HARMONICS_1; -- state->AS_Data.maxH2 = MT2063_MAX_HARMONICS_2; -- state->AS_Data.f_min_LO_Separation = MT2063_MIN_LO_SEP; -- state->AS_Data.f_if1_Request = state->AS_Data.f_if1_Center; -- state->AS_Data.f_LO1 = 2181000000UL; -- state->AS_Data.f_LO2 = 1486249786UL; -- state->f_IF1_actual = state->AS_Data.f_if1_Center; -- state->AS_Data.f_in = state->AS_Data.f_LO1 - state->f_IF1_actual; -- state->AS_Data.f_LO1_FracN_Avoid = MT2063_LO1_FRACN_AVOID; -- state->AS_Data.f_LO2_FracN_Avoid = MT2063_LO2_FRACN_AVOID; -- state->num_regs = MT2063_REG_END_REGS; -- state->AS_Data.avoidDECT = MT2063_AVOID_BOTH; -- state->ctfilt_sw = 0; -- -- state->CTFiltMax[0] = 69230000; -- state->CTFiltMax[1] = 105770000; -- state->CTFiltMax[2] = 140350000; -- state->CTFiltMax[3] = 177110000; -- state->CTFiltMax[4] = 212860000; -- state->CTFiltMax[5] = 241130000; -- state->CTFiltMax[6] = 274370000; -- state->CTFiltMax[7] = 309820000; -- state->CTFiltMax[8] = 342450000; -- state->CTFiltMax[9] = 378870000; -- state->CTFiltMax[10] = 416210000; -- state->CTFiltMax[11] = 456500000; -- state->CTFiltMax[12] = 495790000; -- state->CTFiltMax[13] = 534530000; -- state->CTFiltMax[14] = 572610000; -- state->CTFiltMax[15] = 598970000; -- state->CTFiltMax[16] = 635910000; -- state->CTFiltMax[17] = 672130000; -- state->CTFiltMax[18] = 714840000; -- state->CTFiltMax[19] = 739660000; -- state->CTFiltMax[20] = 770410000; -- state->CTFiltMax[21] = 814660000; -- state->CTFiltMax[22] = 846950000; -- state->CTFiltMax[23] = 867820000; -- state->CTFiltMax[24] = 915980000; -- state->CTFiltMax[25] = 947450000; -- state->CTFiltMax[26] = 983110000; -- state->CTFiltMax[27] = 1021630000; -- state->CTFiltMax[28] = 1061870000; -- state->CTFiltMax[29] = 1098330000; -- state->CTFiltMax[30] = 1138990000; -- -- /* -- ** Fetch the FCU osc value and use it and the fRef value to -- ** scale all of the Band Max values -- */ -- -- state->reg[MT2063_REG_CTUNE_CTRL] = 0x0A; -- status = mt2063_write(state, MT2063_REG_CTUNE_CTRL, -- &state->reg[MT2063_REG_CTUNE_CTRL], 1); -- if (status < 0) -- return status; -- -- /* Read the ClearTune filter calibration value */ -- status = mt2063_read(state, MT2063_REG_FIFFC, -- &state->reg[MT2063_REG_FIFFC], 1); -- if (status < 0) -- return status; -- -- fcu_osc = state->reg[MT2063_REG_FIFFC]; -- -- state->reg[MT2063_REG_CTUNE_CTRL] = 0x00; -- status = mt2063_write(state, MT2063_REG_CTUNE_CTRL, -- &state->reg[MT2063_REG_CTUNE_CTRL], 1); -- if (status < 0) -- return status; -- -- /* Adjust each of the values in the ClearTune filter cross-over table */ -- for (i = 0; i < 31; i++) -- state->CTFiltMax[i] = (state->CTFiltMax[i] / 768) * (fcu_osc + 640); -- -- status = MT2063_SoftwareShutdown(state, 1); -- if (status < 0) -- return status; -- status = MT2063_ClearPowerMaskBits(state, MT2063_ALL_SD); -- if (status < 0) -- return status; -- -- state->init = true; -- -- return 0; --} -- --static int mt2063_get_status(struct dvb_frontend *fe, u32 *tuner_status) --{ -- struct mt2063_state *state = fe->tuner_priv; -- int status; -- -- dprintk(2, "\n"); -- -- if (!state->init) -- return -ENODEV; -- -- *tuner_status = 0; -- status = mt2063_lockStatus(state); -- if (status < 0) -- return status; -- if (status) -- *tuner_status = TUNER_STATUS_LOCKED; -- -- dprintk(1, "Tuner status: %d", *tuner_status); -- -- return 0; --} -- --static int mt2063_release(struct dvb_frontend *fe) --{ -- struct mt2063_state *state = fe->tuner_priv; -- -- dprintk(2, "\n"); -- -- fe->tuner_priv = NULL; -- kfree(state); -- -- return 0; --} -- --static int mt2063_set_analog_params(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- struct mt2063_state *state = fe->tuner_priv; -- s32 pict_car; -- s32 pict2chanb_vsb; -- s32 ch_bw; -- s32 if_mid; -- s32 rcvr_mode; -- int status; -- -- dprintk(2, "\n"); -- -- if (!state->init) { -- status = mt2063_init(fe); -- if (status < 0) -- return status; -- } -- -- switch (params->mode) { -- case V4L2_TUNER_RADIO: -- pict_car = 38900000; -- ch_bw = 8000000; -- pict2chanb_vsb = -(ch_bw / 2); -- rcvr_mode = MT2063_OFFAIR_ANALOG; -- break; -- case V4L2_TUNER_ANALOG_TV: -- rcvr_mode = MT2063_CABLE_ANALOG; -- if (params->std & ~V4L2_STD_MN) { -- pict_car = 38900000; -- ch_bw = 6000000; -- pict2chanb_vsb = -1250000; -- } else if (params->std & V4L2_STD_PAL_G) { -- pict_car = 38900000; -- ch_bw = 7000000; -- pict2chanb_vsb = -1250000; -- } else { /* PAL/SECAM standards */ -- pict_car = 38900000; -- ch_bw = 8000000; -- pict2chanb_vsb = -1250000; -- } -- break; -- default: -- return -EINVAL; -- } -- if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2)); -- -- state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */ -- state->AS_Data.f_out = if_mid; -- state->AS_Data.f_out_bw = ch_bw + 750000; -- status = MT2063_SetReceiverMode(state, rcvr_mode); -- if (status < 0) -- return status; -- -- dprintk(1, "Tuning to frequency: %d, bandwidth %d, foffset %d\n", -- params->frequency, ch_bw, pict2chanb_vsb); -- -- status = MT2063_Tune(state, (params->frequency + (pict2chanb_vsb + (ch_bw / 2)))); -- if (status < 0) -- return status; -- -- state->frequency = params->frequency; -- return 0; --} -- --/* -- * As defined on EN 300 429, the DVB-C roll-off factor is 0.15. -- * So, the amount of the needed bandwith is given by: -- * Bw = Symbol_rate * (1 + 0.15) -- * As such, the maximum symbol rate supported by 6 MHz is given by: -- * max_symbol_rate = 6 MHz / 1.15 = 5217391 Bauds -- */ --#define MAX_SYMBOL_RATE_6MHz 5217391 -- --static int mt2063_set_params(struct dvb_frontend *fe) --{ -- struct dtv_frontend_properties *c = &fe->dtv_property_cache; -- struct mt2063_state *state = fe->tuner_priv; -- int status; -- s32 pict_car; -- s32 pict2chanb_vsb; -- s32 ch_bw; -- s32 if_mid; -- s32 rcvr_mode; -- -- if (!state->init) { -- status = mt2063_init(fe); -- if (status < 0) -- return status; -- } -- -- dprintk(2, "\n"); -- -- if (c->bandwidth_hz == 0) -- return -EINVAL; -- if (c->bandwidth_hz <= 6000000) -- ch_bw = 6000000; -- else if (c->bandwidth_hz <= 7000000) -- ch_bw = 7000000; -- else -- ch_bw = 8000000; -- -- switch (c->delivery_system) { -- case SYS_DVBT: -- rcvr_mode = MT2063_OFFAIR_COFDM; -- pict_car = 36125000; -- pict2chanb_vsb = -(ch_bw / 2); -- break; -- case SYS_DVBC_ANNEX_A: -- case SYS_DVBC_ANNEX_C: -- rcvr_mode = MT2063_CABLE_QAM; -- pict_car = 36125000; -- pict2chanb_vsb = -(ch_bw / 2); -- break; -- default: -- return -EINVAL; -- } -- if_mid = pict_car - (pict2chanb_vsb + (ch_bw / 2)); -- -- state->AS_Data.f_LO2_Step = 125000; /* FIXME: probably 5000 for FM */ -- state->AS_Data.f_out = if_mid; -- state->AS_Data.f_out_bw = ch_bw + 750000; -- status = MT2063_SetReceiverMode(state, rcvr_mode); -- if (status < 0) -- return status; -- -- dprintk(1, "Tuning to frequency: %d, bandwidth %d, foffset %d\n", -- c->frequency, ch_bw, pict2chanb_vsb); -- -- status = MT2063_Tune(state, (c->frequency + (pict2chanb_vsb + (ch_bw / 2)))); -- -- if (status < 0) -- return status; -- -- state->frequency = c->frequency; -- return 0; --} -- --static int mt2063_get_if_frequency(struct dvb_frontend *fe, u32 *freq) --{ -- struct mt2063_state *state = fe->tuner_priv; -- -- dprintk(2, "\n"); -- -- if (!state->init) -- return -ENODEV; -- -- *freq = state->AS_Data.f_out; -- -- dprintk(1, "IF frequency: %d\n", *freq); -- -- return 0; --} -- --static int mt2063_get_bandwidth(struct dvb_frontend *fe, u32 *bw) --{ -- struct mt2063_state *state = fe->tuner_priv; -- -- dprintk(2, "\n"); -- -- if (!state->init) -- return -ENODEV; -- -- *bw = state->AS_Data.f_out_bw - 750000; -- -- dprintk(1, "bandwidth: %d\n", *bw); -- -- return 0; --} -- --static struct dvb_tuner_ops mt2063_ops = { -- .info = { -- .name = "MT2063 Silicon Tuner", -- .frequency_min = 45000000, -- .frequency_max = 850000000, -- .frequency_step = 0, -- }, -- -- .init = mt2063_init, -- .sleep = MT2063_Sleep, -- .get_status = mt2063_get_status, -- .set_analog_params = mt2063_set_analog_params, -- .set_params = mt2063_set_params, -- .get_if_frequency = mt2063_get_if_frequency, -- .get_bandwidth = mt2063_get_bandwidth, -- .release = mt2063_release, --}; -- --struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, -- struct mt2063_config *config, -- struct i2c_adapter *i2c) --{ -- struct mt2063_state *state = NULL; -- -- dprintk(2, "\n"); -- -- state = kzalloc(sizeof(struct mt2063_state), GFP_KERNEL); -- if (state == NULL) -- goto error; -- -- state->config = config; -- state->i2c = i2c; -- state->frontend = fe; -- state->reference = config->refclock / 1000; /* kHz */ -- fe->tuner_priv = state; -- fe->ops.tuner_ops = mt2063_ops; -- -- printk(KERN_INFO "%s: Attaching MT2063\n", __func__); -- return fe; -- --error: -- kfree(state); -- return NULL; --} --EXPORT_SYMBOL_GPL(mt2063_attach); -- --/* -- * Ancillary routines visible outside mt2063 -- * FIXME: Remove them in favor of using standard tuner callbacks -- */ --unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) --{ -- struct mt2063_state *state = fe->tuner_priv; -- int err = 0; -- -- dprintk(2, "\n"); -- -- err = MT2063_SoftwareShutdown(state, 1); -- if (err < 0) -- printk(KERN_ERR "%s: Couldn't shutdown\n", __func__); -- -- return err; --} --EXPORT_SYMBOL_GPL(tuner_MT2063_SoftwareShutdown); -- --unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) --{ -- struct mt2063_state *state = fe->tuner_priv; -- int err = 0; -- -- dprintk(2, "\n"); -- -- err = MT2063_ClearPowerMaskBits(state, MT2063_ALL_SD); -- if (err < 0) -- printk(KERN_ERR "%s: Invalid parameter\n", __func__); -- -- return err; --} --EXPORT_SYMBOL_GPL(tuner_MT2063_ClearPowerMaskBits); -- --MODULE_AUTHOR("Mauro Carvalho Chehab "); --MODULE_DESCRIPTION("MT2063 Silicon tuner"); --MODULE_LICENSE("GPL"); -diff --git a/drivers/media/common/tuners/mt2063.h b/drivers/media/common/tuners/mt2063.h -deleted file mode 100644 -index 62d0e8e..0000000 ---- a/drivers/media/common/tuners/mt2063.h -+++ /dev/null -@@ -1,36 +0,0 @@ --#ifndef __MT2063_H__ --#define __MT2063_H__ -- --#include "dvb_frontend.h" -- --struct mt2063_config { -- u8 tuner_address; -- u32 refclock; --}; -- --#if defined(CONFIG_MEDIA_TUNER_MT2063) || (defined(CONFIG_MEDIA_TUNER_MT2063_MODULE) && defined(MODULE)) --struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, -- struct mt2063_config *config, -- struct i2c_adapter *i2c); -- --#else -- --static inline struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe, -- struct mt2063_config *config, -- struct i2c_adapter *i2c) --{ -- printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__); -- return NULL; --} -- --int mt2063_setTune(struct dvb_frontend *fe, u32 f_in, -- u32 bw_in, -- enum MTTune_atv_standard tv_type); -- --/* FIXME: Should use the standard DVB attachment interfaces */ --unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe); --unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe); -- --#endif /* CONFIG_DVB_MT2063 */ -- --#endif /* __MT2063_H__ */ -diff --git a/drivers/media/common/tuners/mt20xx.c b/drivers/media/common/tuners/mt20xx.c -deleted file mode 100644 -index 0e74e97..0000000 ---- a/drivers/media/common/tuners/mt20xx.c -+++ /dev/null -@@ -1,670 +0,0 @@ --/* -- * i2c tv tuner chip device driver -- * controls microtune tuners, mt2032 + mt2050 at the moment. -- * -- * This "mt20xx" module was split apart from the original "tuner" module. -- */ --#include --#include --#include --#include --#include "tuner-i2c.h" --#include "mt20xx.h" -- --static int debug; --module_param(debug, int, 0644); --MODULE_PARM_DESC(debug, "enable verbose debug messages"); -- --/* ---------------------------------------------------------------------- */ -- --static unsigned int optimize_vco = 1; --module_param(optimize_vco, int, 0644); -- --static unsigned int tv_antenna = 1; --module_param(tv_antenna, int, 0644); -- --static unsigned int radio_antenna; --module_param(radio_antenna, int, 0644); -- --/* ---------------------------------------------------------------------- */ -- --#define MT2032 0x04 --#define MT2030 0x06 --#define MT2040 0x07 --#define MT2050 0x42 -- --static char *microtune_part[] = { -- [ MT2030 ] = "MT2030", -- [ MT2032 ] = "MT2032", -- [ MT2040 ] = "MT2040", -- [ MT2050 ] = "MT2050", --}; -- --struct microtune_priv { -- struct tuner_i2c_props i2c_props; -- -- unsigned int xogc; -- //unsigned int radio_if2; -- -- u32 frequency; --}; -- --static int microtune_release(struct dvb_frontend *fe) --{ -- kfree(fe->tuner_priv); -- fe->tuner_priv = NULL; -- -- return 0; --} -- --static int microtune_get_frequency(struct dvb_frontend *fe, u32 *frequency) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- *frequency = priv->frequency; -- return 0; --} -- --// IsSpurInBand()? --static int mt2032_spurcheck(struct dvb_frontend *fe, -- int f1, int f2, int spectrum_from,int spectrum_to) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int n1=1,n2,f; -- -- f1=f1/1000; //scale to kHz to avoid 32bit overflows -- f2=f2/1000; -- spectrum_from/=1000; -- spectrum_to/=1000; -- -- tuner_dbg("spurcheck f1=%d f2=%d from=%d to=%d\n", -- f1,f2,spectrum_from,spectrum_to); -- -- do { -- n2=-n1; -- f=n1*(f1-f2); -- do { -- n2--; -- f=f-f2; -- tuner_dbg("spurtest n1=%d n2=%d ftest=%d\n",n1,n2,f); -- -- if( (f>spectrum_from) && (f(f2-spectrum_to)) || (n2>-5)); -- n1++; -- } while (n1<5); -- -- return 1; --} -- --static int mt2032_compute_freq(struct dvb_frontend *fe, -- unsigned int rfin, -- unsigned int if1, unsigned int if2, -- unsigned int spectrum_from, -- unsigned int spectrum_to, -- unsigned char *buf, -- int *ret_sel, -- unsigned int xogc) //all in Hz --{ -- struct microtune_priv *priv = fe->tuner_priv; -- unsigned int fref,lo1,lo1n,lo1a,s,sel,lo1freq, desired_lo1, -- desired_lo2,lo2,lo2n,lo2a,lo2num,lo2freq; -- -- fref= 5250 *1000; //5.25MHz -- desired_lo1=rfin+if1; -- -- lo1=(2*(desired_lo1/1000)+(fref/1000)) / (2*fref/1000); -- lo1n=lo1/8; -- lo1a=lo1-(lo1n*8); -- -- s=rfin/1000/1000+1090; -- -- if(optimize_vco) { -- if(s>1890) sel=0; -- else if(s>1720) sel=1; -- else if(s>1530) sel=2; -- else if(s>1370) sel=3; -- else sel=4; // >1090 -- } -- else { -- if(s>1790) sel=0; // <1958 -- else if(s>1617) sel=1; -- else if(s>1449) sel=2; -- else if(s>1291) sel=3; -- else sel=4; // >1090 -- } -- *ret_sel=sel; -- -- lo1freq=(lo1a+8*lo1n)*fref; -- -- tuner_dbg("mt2032: rfin=%d lo1=%d lo1n=%d lo1a=%d sel=%d, lo1freq=%d\n", -- rfin,lo1,lo1n,lo1a,sel,lo1freq); -- -- desired_lo2=lo1freq-rfin-if2; -- lo2=(desired_lo2)/fref; -- lo2n=lo2/8; -- lo2a=lo2-(lo2n*8); -- lo2num=((desired_lo2/1000)%(fref/1000))* 3780/(fref/1000); //scale to fit in 32bit arith -- lo2freq=(lo2a+8*lo2n)*fref + lo2num*(fref/1000)/3780*1000; -- -- tuner_dbg("mt2032: rfin=%d lo2=%d lo2n=%d lo2a=%d num=%d lo2freq=%d\n", -- rfin,lo2,lo2n,lo2a,lo2num,lo2freq); -- -- if (lo1a > 7 || lo1n < 17 || lo1n > 48 || lo2a > 7 || lo2n < 17 || -- lo2n > 30) { -- tuner_info("mt2032: frequency parameters out of range: %d %d %d %d\n", -- lo1a, lo1n, lo2a,lo2n); -- return(-1); -- } -- -- mt2032_spurcheck(fe, lo1freq, desired_lo2, spectrum_from, spectrum_to); -- // should recalculate lo1 (one step up/down) -- -- // set up MT2032 register map for transfer over i2c -- buf[0]=lo1n-1; -- buf[1]=lo1a | (sel<<4); -- buf[2]=0x86; // LOGC -- buf[3]=0x0f; //reserved -- buf[4]=0x1f; -- buf[5]=(lo2n-1) | (lo2a<<5); -- if(rfin >400*1000*1000) -- buf[6]=0xe4; -- else -- buf[6]=0xf4; // set PKEN per rev 1.2 -- buf[7]=8+xogc; -- buf[8]=0xc3; //reserved -- buf[9]=0x4e; //reserved -- buf[10]=0xec; //reserved -- buf[11]=(lo2num&0xff); -- buf[12]=(lo2num>>8) |0x80; // Lo2RST -- -- return 0; --} -- --static int mt2032_check_lo_lock(struct dvb_frontend *fe) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int try,lock=0; -- unsigned char buf[2]; -- -- for(try=0;try<10;try++) { -- buf[0]=0x0e; -- tuner_i2c_xfer_send(&priv->i2c_props,buf,1); -- tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); -- tuner_dbg("mt2032 Reg.E=0x%02x\n",buf[0]); -- lock=buf[0] &0x06; -- -- if (lock==6) -- break; -- -- tuner_dbg("mt2032: pll wait 1ms for lock (0x%2x)\n",buf[0]); -- udelay(1000); -- } -- return lock; --} -- --static int mt2032_optimize_vco(struct dvb_frontend *fe,int sel,int lock) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- unsigned char buf[2]; -- int tad1; -- -- buf[0]=0x0f; -- tuner_i2c_xfer_send(&priv->i2c_props,buf,1); -- tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); -- tuner_dbg("mt2032 Reg.F=0x%02x\n",buf[0]); -- tad1=buf[0]&0x07; -- -- if(tad1 ==0) return lock; -- if(tad1 ==1) return lock; -- -- if(tad1==2) { -- if(sel==0) -- return lock; -- else sel--; -- } -- else { -- if(sel<4) -- sel++; -- else -- return lock; -- } -- -- tuner_dbg("mt2032 optimize_vco: sel=%d\n",sel); -- -- buf[0]=0x0f; -- buf[1]=sel; -- tuner_i2c_xfer_send(&priv->i2c_props,buf,2); -- lock=mt2032_check_lo_lock(fe); -- return lock; --} -- -- --static void mt2032_set_if_freq(struct dvb_frontend *fe, unsigned int rfin, -- unsigned int if1, unsigned int if2, -- unsigned int from, unsigned int to) --{ -- unsigned char buf[21]; -- int lint_try,ret,sel,lock=0; -- struct microtune_priv *priv = fe->tuner_priv; -- -- tuner_dbg("mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n", -- rfin,if1,if2,from,to); -- -- buf[0]=0; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,1); -- tuner_i2c_xfer_recv(&priv->i2c_props,buf,21); -- -- buf[0]=0; -- ret=mt2032_compute_freq(fe,rfin,if1,if2,from,to,&buf[1],&sel,priv->xogc); -- if (ret<0) -- return; -- -- // send only the relevant registers per Rev. 1.2 -- buf[0]=0; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,4); -- buf[5]=5; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,4); -- buf[11]=11; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+11,3); -- if(ret!=3) -- tuner_warn("i2c i/o error: rc == %d (should be 3)\n",ret); -- -- // wait for PLLs to lock (per manual), retry LINT if not. -- for(lint_try=0; lint_try<2; lint_try++) { -- lock=mt2032_check_lo_lock(fe); -- -- if(optimize_vco) -- lock=mt2032_optimize_vco(fe,sel,lock); -- if(lock==6) break; -- -- tuner_dbg("mt2032: re-init PLLs by LINT\n"); -- buf[0]=7; -- buf[1]=0x80 +8+priv->xogc; // set LINT to re-init PLLs -- tuner_i2c_xfer_send(&priv->i2c_props,buf,2); -- mdelay(10); -- buf[1]=8+priv->xogc; -- tuner_i2c_xfer_send(&priv->i2c_props,buf,2); -- } -- -- if (lock!=6) -- tuner_warn("MT2032 Fatal Error: PLLs didn't lock.\n"); -- -- buf[0]=2; -- buf[1]=0x20; // LOGC for optimal phase noise -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,2); -- if (ret!=2) -- tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret); --} -- -- --static int mt2032_set_tv_freq(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- int if2,from,to; -- -- // signal bandwidth and picture carrier -- if (params->std & V4L2_STD_525_60) { -- // NTSC -- from = 40750*1000; -- to = 46750*1000; -- if2 = 45750*1000; -- } else { -- // PAL -- from = 32900*1000; -- to = 39900*1000; -- if2 = 38900*1000; -- } -- -- mt2032_set_if_freq(fe, params->frequency*62500, -- 1090*1000*1000, if2, from, to); -- -- return 0; --} -- --static int mt2032_set_radio_freq(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int if2; -- -- if (params->std & V4L2_STD_525_60) { -- tuner_dbg("pinnacle ntsc\n"); -- if2 = 41300 * 1000; -- } else { -- tuner_dbg("pinnacle pal\n"); -- if2 = 33300 * 1000; -- } -- -- // per Manual for FM tuning: first if center freq. 1085 MHz -- mt2032_set_if_freq(fe, params->frequency * 125 / 2, -- 1085*1000*1000,if2,if2,if2); -- -- return 0; --} -- --static int mt2032_set_params(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int ret = -EINVAL; -- -- switch (params->mode) { -- case V4L2_TUNER_RADIO: -- ret = mt2032_set_radio_freq(fe, params); -- priv->frequency = params->frequency * 125 / 2; -- break; -- case V4L2_TUNER_ANALOG_TV: -- case V4L2_TUNER_DIGITAL_TV: -- ret = mt2032_set_tv_freq(fe, params); -- priv->frequency = params->frequency * 62500; -- break; -- } -- -- return ret; --} -- --static struct dvb_tuner_ops mt2032_tuner_ops = { -- .set_analog_params = mt2032_set_params, -- .release = microtune_release, -- .get_frequency = microtune_get_frequency, --}; -- --// Initialization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001 --static int mt2032_init(struct dvb_frontend *fe) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- unsigned char buf[21]; -- int ret,xogc,xok=0; -- -- // Initialize Registers per spec. -- buf[1]=2; // Index to register 2 -- buf[2]=0xff; -- buf[3]=0x0f; -- buf[4]=0x1f; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+1,4); -- -- buf[5]=6; // Index register 6 -- buf[6]=0xe4; -- buf[7]=0x8f; -- buf[8]=0xc3; -- buf[9]=0x4e; -- buf[10]=0xec; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,6); -- -- buf[12]=13; // Index register 13 -- buf[13]=0x32; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2); -- -- // Adjust XOGC (register 7), wait for XOK -- xogc=7; -- do { -- tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); -- mdelay(10); -- buf[0]=0x0e; -- tuner_i2c_xfer_send(&priv->i2c_props,buf,1); -- tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); -- xok=buf[0]&0x01; -- tuner_dbg("mt2032: xok = 0x%02x\n",xok); -- if (xok == 1) break; -- -- xogc--; -- tuner_dbg("mt2032: xogc = 0x%02x\n",xogc&0x07); -- if (xogc == 3) { -- xogc=4; // min. 4 per spec -- break; -- } -- buf[0]=0x07; -- buf[1]=0x88 + xogc; -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,2); -- if (ret!=2) -- tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret); -- } while (xok != 1 ); -- priv->xogc=xogc; -- -- memcpy(&fe->ops.tuner_ops, &mt2032_tuner_ops, sizeof(struct dvb_tuner_ops)); -- -- return(1); --} -- --static void mt2050_set_antenna(struct dvb_frontend *fe, unsigned char antenna) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- unsigned char buf[2]; -- -- buf[0] = 6; -- buf[1] = antenna ? 0x11 : 0x10; -- tuner_i2c_xfer_send(&priv->i2c_props, buf, 2); -- tuner_dbg("mt2050: enabled antenna connector %d\n", antenna); --} -- --static void mt2050_set_if_freq(struct dvb_frontend *fe,unsigned int freq, unsigned int if2) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- unsigned int if1=1218*1000*1000; -- unsigned int f_lo1,f_lo2,lo1,lo2,f_lo1_modulo,f_lo2_modulo,num1,num2,div1a,div1b,div2a,div2b; -- int ret; -- unsigned char buf[6]; -- -- tuner_dbg("mt2050_set_if_freq freq=%d if1=%d if2=%d\n", -- freq,if1,if2); -- -- f_lo1=freq+if1; -- f_lo1=(f_lo1/1000000)*1000000; -- -- f_lo2=f_lo1-freq-if2; -- f_lo2=(f_lo2/50000)*50000; -- -- lo1=f_lo1/4000000; -- lo2=f_lo2/4000000; -- -- f_lo1_modulo= f_lo1-(lo1*4000000); -- f_lo2_modulo= f_lo2-(lo2*4000000); -- -- num1=4*f_lo1_modulo/4000000; -- num2=4096*(f_lo2_modulo/1000)/4000; -- -- // todo spurchecks -- -- div1a=(lo1/12)-1; -- div1b=lo1-(div1a+1)*12; -- -- div2a=(lo2/8)-1; -- div2b=lo2-(div2a+1)*8; -- -- if (debug > 1) { -- tuner_dbg("lo1 lo2 = %d %d\n", lo1, lo2); -- tuner_dbg("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n", -- num1,num2,div1a,div1b,div2a,div2b); -- } -- -- buf[0]=1; -- buf[1]= 4*div1b + num1; -- if(freq<275*1000*1000) buf[1] = buf[1]|0x80; -- -- buf[2]=div1a; -- buf[3]=32*div2b + num2/256; -- buf[4]=num2-(num2/256)*256; -- buf[5]=div2a; -- if(num2!=0) buf[5]=buf[5]|0x40; -- -- if (debug > 1) { -- int i; -- tuner_dbg("bufs is: "); -- for(i=0;i<6;i++) -- printk("%x ",buf[i]); -- printk("\n"); -- } -- -- ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,6); -- if (ret!=6) -- tuner_warn("i2c i/o error: rc == %d (should be 6)\n",ret); --} -- --static int mt2050_set_tv_freq(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- unsigned int if2; -- -- if (params->std & V4L2_STD_525_60) { -- // NTSC -- if2 = 45750*1000; -- } else { -- // PAL -- if2 = 38900*1000; -- } -- if (V4L2_TUNER_DIGITAL_TV == params->mode) { -- // DVB (pinnacle 300i) -- if2 = 36150*1000; -- } -- mt2050_set_if_freq(fe, params->frequency*62500, if2); -- mt2050_set_antenna(fe, tv_antenna); -- -- return 0; --} -- --static int mt2050_set_radio_freq(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int if2; -- -- if (params->std & V4L2_STD_525_60) { -- tuner_dbg("pinnacle ntsc\n"); -- if2 = 41300 * 1000; -- } else { -- tuner_dbg("pinnacle pal\n"); -- if2 = 33300 * 1000; -- } -- -- mt2050_set_if_freq(fe, params->frequency * 125 / 2, if2); -- mt2050_set_antenna(fe, radio_antenna); -- -- return 0; --} -- --static int mt2050_set_params(struct dvb_frontend *fe, -- struct analog_parameters *params) --{ -- struct microtune_priv *priv = fe->tuner_priv; -- int ret = -EINVAL; -- -- switch (params->mode) { -- case V4L2_TUNER_RADIO: -- ret = mt2050_set_radio_freq(fe, params); -- priv->frequency = params->frequency * 125 / 2; -- break; -- case V4L2_TUNER_ANALOG_TV: -- case V4L2_TUNER_DIGITAL_TV: -- ret = mt2050_set_tv_freq(fe, params); -- priv->frequency = params->frequency * 62500; -- break; -- } -- -- return ret; --} -- --static struct dvb_tuner_ops mt2050_tuner_ops = { -- .set_analog_params = mt2050_set_params, -- .release = microtune_release, -- .get_frequency = microtune_get_frequency, --}; -- --static int mt2050_init(struct dvb_frontend *fe) --{ -- struct