The patch number 9073 was added via Mauro Carvalho Chehab <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ From: Mauro Carvalho Chehab <[EMAIL PROTECTED]> merge: http://www.linuxtv.org/hg/~stoth/s2 Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]> --- linux/drivers/media/dvb/dm1105/Kconfig | 2 linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 21 ++ linux/drivers/media/dvb/dvb-usb/Kconfig | 1 linux/drivers/media/video/cx88/cx88-video.c | 5 linux/drivers/media/video/cx88/cx88.h | 1 linux/include/linux/dvb/frontend.h | 116 +++++++--------- linux/include/linux/dvb/version.h | 4 7 files changed, 80 insertions(+), 70 deletions(-) diff -r f054dabf8971 -r 4db9722caf4f linux/drivers/media/dvb/dm1105/Kconfig --- a/linux/drivers/media/dvb/dm1105/Kconfig Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/drivers/media/dvb/dm1105/Kconfig Wed Oct 01 13:13:56 2008 -0300 @@ -3,6 +3,8 @@ config DVB_DM1105 depends on DVB_CORE && PCI && I2C select DVB_PLL if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE + select DVB_STV0288 if !DVB_FE_CUSTOMISE + select DVB_STB6000 if !DVB_FE_CUSTOMISE select DVB_CX24116 if !DVB_FE_CUSTOMISE select DVB_SI21XX if !DVB_FE_CUSTOMISE help diff -r f054dabf8971 -r 4db9722caf4f linux/drivers/media/dvb/dvb-core/dvb_frontend.c --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Wed Oct 01 13:13:56 2008 -0300 @@ -45,6 +45,7 @@ #include "dvb_frontend.h" #include "dvbdev.h" #include "compat.h" +#include <linux/dvb/version.h> static int dvb_frontend_debug; static int dvb_shutdown_timeout; @@ -906,6 +907,11 @@ struct dtv_cmds_h dtv_cmds[] = { .set = 0, }, #endif + [DTV_API_VERSION] = { + .name = "DTV_API_VERSION", + .cmd = DTV_API_VERSION, + .set = 0, + }, }; void dtv_property_dump(struct dtv_property *tvp) @@ -1210,6 +1216,9 @@ int dtv_property_process_get(struct dvb_ case DTV_TONE: tvp->u.data = fe->dtv_property_cache.sectone; break; + case DTV_API_VERSION: + tvp->u.data = (DVB_API_VERSION << 8) | DVB_API_VERSION_MINOR; + break; default: r = -1; } @@ -1377,8 +1386,10 @@ static int dvb_frontend_ioctl_properties goto out; } - for (i = 0; i < tvps->num; i++) - err |= dtv_property_process_set(fe, tvp + i, inode, file); + for (i = 0; i < tvps->num; i++) { + (tvp + i)->result = dtv_property_process_set(fe, tvp + i, inode, file); + err |= (tvp + i)->result; + } if(fe->dtv_property_cache.state == DTV_TUNE) { printk("%s() Property cache is full, tuning\n", __FUNCTION__); @@ -1410,8 +1421,10 @@ static int dvb_frontend_ioctl_properties goto out; } - for (i = 0; i < tvps->num; i++) - err |= dtv_property_process_get(fe, tvp + i, inode, file); + for (i = 0; i < tvps->num; i++) { + (tvp + i)->result = dtv_property_process_get(fe, tvp + i, inode, file); + err |= (tvp + i)->result; + } if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct dtv_property))) { err = -EFAULT; diff -r f054dabf8971 -r 4db9722caf4f linux/drivers/media/dvb/dvb-usb/Kconfig --- a/linux/drivers/media/dvb/dvb-usb/Kconfig Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/drivers/media/dvb/dvb-usb/Kconfig Wed Oct 01 13:13:56 2008 -0300 @@ -254,6 +254,7 @@ config DVB_USB_DW2102 select DVB_PLL if !DVB_FE_CUSTOMISE select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_CX24116 if !DVB_FE_CUSTOMISE + select DVB_SI21XX if !DVB_FE_CUSTOMISE help Say Y here to support the DvbWorld DVB-S/S2 USB2.0 receivers and the TeVii S650. diff -r f054dabf8971 -r 4db9722caf4f linux/drivers/media/video/cx88/cx88-video.c --- a/linux/drivers/media/video/cx88/cx88-video.c Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/drivers/media/video/cx88/cx88-video.c Wed Oct 01 13:13:56 2008 -0300 @@ -1065,6 +1065,8 @@ static int video_open(struct inode *inod } unlock_kernel(); + atomic_inc(&core->users); + return 0; } @@ -1152,7 +1154,8 @@ static int video_release(struct inode *i file->private_data = NULL; kfree(fh); - cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); + if(atomic_dec_and_test(&dev->core->users)) + cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); return 0; } diff -r f054dabf8971 -r 4db9722caf4f linux/drivers/media/video/cx88/cx88.h --- a/linux/drivers/media/video/cx88/cx88.h Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/drivers/media/video/cx88/cx88.h Wed Oct 01 13:13:56 2008 -0300 @@ -353,6 +353,7 @@ struct cx88_core { struct mutex lock; /* various v4l controls */ u32 freq; + atomic_t users; /* cx88-video needs to access cx8802 for hybrid tuner pll access. */ struct cx8802_dev *dvbdev; diff -r f054dabf8971 -r 4db9722caf4f linux/include/linux/dvb/frontend.h --- a/linux/include/linux/dvb/frontend.h Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/include/linux/dvb/frontend.h Wed Oct 01 13:13:56 2008 -0300 @@ -246,71 +246,60 @@ struct dvb_frontend_event { struct dvb_frontend_parameters parameters; }; -/* TODO: Turn this into a series of defines, so future maintainers - * don't insert random new commands and break backwards - * binary compatability. - */ -typedef enum dtv_cmd_types { - DTV_UNDEFINED, - DTV_TUNE, - DTV_CLEAR, - - DTV_FREQUENCY, - DTV_MODULATION, - - /* XXX PB: I would like to have field which describes the - * bandwidth of a channel in Hz or kHz - maybe we can remove the - * DTV_BANDWIDTH now and put a compat layer */ - DTV_BANDWIDTH_HZ, - - DTV_INVERSION, - DTV_DISEQC_MASTER, - DTV_SYMBOL_RATE, - DTV_INNER_FEC, - DTV_VOLTAGE, - DTV_TONE, - DTV_PILOT, - DTV_ROLLOFF, - - DTV_DISEQC_SLAVE_REPLY, - - /* Basic enumeration set for querying unlimited capabilities */ - DTV_FE_CAPABILITY_COUNT, - DTV_FE_CAPABILITY, - - /* New commands are always appended */ - DTV_DELIVERY_SYSTEM, +/* S2API Commands */ +#define DTV_UNDEFINED 0 +#define DTV_TUNE 1 +#define DTV_CLEAR 2 +#define DTV_FREQUENCY 3 +#define DTV_MODULATION 4 +#define DTV_BANDWIDTH_HZ 5 +#define DTV_INVERSION 6 +#define DTV_DISEQC_MASTER 7 +#define DTV_SYMBOL_RATE 8 +#define DTV_INNER_FEC 9 +#define DTV_VOLTAGE 10 +#define DTV_TONE 11 +#define DTV_PILOT 12 +#define DTV_ROLLOFF 13 +#define DTV_DISEQC_SLAVE_REPLY 14 + +/* Basic enumeration set for querying unlimited capabilities */ +#define DTV_FE_CAPABILITY_COUNT 15 +#define DTV_FE_CAPABILITY 16 +#define DTV_DELIVERY_SYSTEM 17 + #if 0 - /* ISDB */ - /* maybe a dup of DTV_ISDB_SOUND_BROADCASTING_SUBCHANNEL_ID ??? */ - DTV_ISDB_SEGMENT_IDX, - DTV_ISDB_SEGMENT_WIDTH, /* 1, 3 or 13 ??? */ - - /* the central segment can be received independently or 1/3 seg in SB-mode */ - DTV_ISDB_PARTIAL_RECEPTION, - /* sound broadcasting is used 0 = 13segment, 1 = 1 or 3 see DTV_ISDB_PARTIAL_RECEPTION */ - DTV_ISDB_SOUND_BROADCASTING, - - /* only used in SB */ - /* determines the initial PRBS of the segment (to match with 13seg channel) */ - DTV_ISDB_SOUND_BROADCASTING_SUBCHANNEL_ID, - - DTV_ISDB_LAYERA_FEC, - DTV_ISDB_LAYERA_MODULATION, - DTV_ISDB_LAYERA_SEGMENT_WIDTH, - DTV_ISDB_LAYERA_TIME_INTERLEAVER, - - DTV_ISDB_LAYERB_FEC, - DTV_ISDB_LAYERB_MODULATION, - DTV_ISDB_LAYERB_SEGMENT_WIDTH, - DTV_ISDB_LAYERB_TIME_INTERLEAVING, - - DTV_ISDB_LAYERC_FEC, - DTV_ISDB_LAYERC_MODULATION, - DTV_ISDB_LAYERC_SEGMENT_WIDTH, - DTV_ISDB_LAYERC_TIME_INTERLEAVING, +/* ISDB */ +/* maybe a dup of DTV_ISDB_SOUND_BROADCASTING_SUBCHANNEL_ID ??? */ +#define DTV_ISDB_SEGMENT_IDX 18 +/* 1, 3 or 13 ??? */ +#define DTV_ISDB_SEGMENT_WIDTH 19 + +/* the central segment can be received independently or 1/3 seg in SB-mode */ +#define DTV_ISDB_PARTIAL_RECEPTION 20 +/* sound broadcasting is used 0 = 13segment, 1 = 1 or 3 see DTV_ISDB_PARTIAL_RECEPTION */ +#define DTV_ISDB_SOUND_BROADCASTING 21 + +/* only used in SB */ +/* determines the initial PRBS of the segment (to match with 13seg channel) */ +#define DTV_ISDB_SOUND_BROADCASTING_SUBCHANNEL_ID 22 + +#define DTV_ISDB_LAYERA_FEC 23 +#define DTV_ISDB_LAYERA_MODULATION 24 +#define DTV_ISDB_LAYERA_SEGMENT_WIDTH 25 +#define DTV_ISDB_LAYERA_TIME_INTERLEAVER 26 + +#define DTV_ISDB_LAYERB_FEC 27 +#define DTV_ISDB_LAYERB_MODULATION 28 +#define DTV_ISDB_LAYERB_SEGMENT_WIDTH 29 +#define DTV_ISDB_LAYERB_TIME_INTERLEAVING 30 + +#define DTV_ISDB_LAYERC_FEC 31 +#define DTV_ISDB_LAYERC_MODULATION 32 +#define DTV_ISDB_LAYERC_SEGMENT_WIDTH 33 +#define DTV_ISDB_LAYERC_TIME_INTERLEAVING 34 #endif -} dtv_cmd_types_t; +#define DTV_API_VERSION 35 typedef enum fe_pilot { PILOT_ON, @@ -366,6 +355,7 @@ struct dtv_property { void *reserved2; } buffer; } u; + int result; } __attribute__ ((packed)); /* No more than 16 properties during any given ioctl */ diff -r f054dabf8971 -r 4db9722caf4f linux/include/linux/dvb/version.h --- a/linux/include/linux/dvb/version.h Fri Sep 05 14:33:54 2008 -0300 +++ b/linux/include/linux/dvb/version.h Wed Oct 01 13:13:56 2008 -0300 @@ -23,7 +23,7 @@ #ifndef _DVBVERSION_H_ #define _DVBVERSION_H_ -#define DVB_API_VERSION 3 -#define DVB_API_VERSION_MINOR 2 +#define DVB_API_VERSION 5 +#define DVB_API_VERSION_MINOR 0 #endif /*_DVBVERSION_H_*/ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/4db9722caf4fd0cb4e3e7d53b1b5457f7c3bc9c1 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits