From 37434e0be62710ffd76760e13bd121e4d12cf2d0 Mon Sep 17 00:00:00 2001 From: Chuanzhi Wang Date: Thu, 26 Jul 2018 13:49:49 +0800 Subject: [PATCH] dvb: add configuration items to control dvb module compilation. [1\2] PD#169652: Kconfig: Add configuration items. Change-Id: If5d0a987bda435975fb3a6fa7be26ff8f7099e6f Signed-off-by: Chuanzhi Wang --- arch/arm64/configs/meson64_defconfig | 1 - drivers/amlogic/media/Kconfig | 33 +++++++++++++++++++++++++ drivers/media/dvb-core/dmxdev.c | 6 +++-- drivers/media/dvb-core/dvb_ca_en50221.c | 3 ++- drivers/media/dvb-core/dvb_frontend.c | 6 +++-- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/arch/arm64/configs/meson64_defconfig b/arch/arm64/configs/meson64_defconfig index a32ca70639be..3465b594c3a2 100644 --- a/arch/arm64/configs/meson64_defconfig +++ b/arch/arm64/configs/meson64_defconfig @@ -349,7 +349,6 @@ CONFIG_AMLOGIC_WDT_MESON_V3=y CONFIG_AMLOGIC_ESM=y CONFIG_AMLOGIC_WIFI=y CONFIG_AMLOGIC_BT_DEVICE=y -CONFIG_AMLOGIC_DVB_COMPAT=y CONFIG_AMLOGIC_PCIE=y CONFIG_AMLOGIC_IRBLASTER=y CONFIG_AMLOGIC_IIO=y diff --git a/drivers/amlogic/media/Kconfig b/drivers/amlogic/media/Kconfig index d476845f4331..bc316278ce43 100644 --- a/drivers/amlogic/media/Kconfig +++ b/drivers/amlogic/media/Kconfig @@ -1,3 +1,34 @@ +# +# Amlogic DVB configuration +# + +menu "Amlogic dvb configuration" + +config AMLOGIC_DVB + bool "Amlogic dvb support" + select DVB_CORE + select AMLOGIC_DVB_COMPAT + default y + help + This option is used only to control the + compilation of dvb related driver code, for + example hw_demux, it is enabled by default, + When it is turned on,it will automatically + select DVB_CORE and AMLOGIC_DVB_COMPAT. + +config AMLOGIC_DVB_COMPAT + bool "Compat amlogic dvb" + depends on AMLOGIC_DVB && DVB_CORE + default y + help + This option is used only to compatible with + amlogic dvb related code, for example dvb-core, + it is enabled by default,depending on + AMLOGIC_DVB and DVB_CORE. + +endmenu + + # # Amlogic multimedia configuration # @@ -66,3 +97,5 @@ source "drivers/amlogic/media/algorithm/Kconfig" endif source "drivers/amlogic/media/dtv_demod/Kconfig" endmenu + + diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index 7bda384d8af1..5cc568481ffa 100644 --- a/drivers/media/dvb-core/dmxdev.c +++ b/drivers/media/dvb-core/dmxdev.c @@ -1133,8 +1133,9 @@ static long dvb_demux_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long args) { unsigned long ret; - +#ifdef CONFIG_COMPAT args = (unsigned long)compat_ptr(args); +#endif ret = dvb_demux_ioctl(filp, cmd, args); return ret; } @@ -1223,8 +1224,9 @@ static long dvb_dvr_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long args) { unsigned long ret; - +#ifdef CONFIG_COMPAT args = (unsigned long)compat_ptr(args); +#endif ret = dvb_dvr_ioctl(filp, cmd, args); return ret; } diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c index 43bf20639c34..6a51227664c4 100644 --- a/drivers/media/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb-core/dvb_ca_en50221.c @@ -1688,8 +1688,9 @@ static long dvb_ca_en50221_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long args) { unsigned long ret; - +#ifdef CONFIG_COMPAT args = (unsigned long)compat_ptr(args); +#endif ret = dvb_ca_en50221_io_ioctl(filp, cmd, args); return ret; } diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 778927e992d1..aa34713b44a4 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2665,14 +2665,16 @@ static long dvb_frontend_compat_ioctl(struct file *filp, { unsigned long ret; struct dtv_properties tvps; - +#ifdef CONFIG_COMPAT args = (unsigned long)compat_ptr(args); - +#endif if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) { if (copy_from_user(&tvps, (void *)args, sizeof(struct dtv_properties))) return -EFAULT; +#ifdef CONFIG_COMPAT tvps.props = compat_ptr((unsigned long)tvps.props); +#endif if (copy_to_user((void *)args, (void *)&tvps, sizeof(struct dtv_properties))) return -EFAULT; -- 2.20.1