Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Frank Schäfer
Am 08.12.2012 23:04, schrieb Matthew Gyurgyik:
 On 12/08/2012 04:47 PM, Antti Palosaari wrote:
 On 12/08/2012 11:40 PM, Matthew Gyurgyik wrote:
 On 12/08/2012 12:49 PM, Frank Schäfer wrote:
 Am 08.12.2012 17:51, schrieb Matthew Gyurgyik:

 That shouldn't be necessary. I just noticed that there is a module
 parameter 'ir_debug'. ;)
 With ir_debug enabled, you should see messages

  em28xx_ir_handle_key: toggle: XX, count: XX, key XXYYZZ

 everytime you press a button. Once we know the key codes, we can
 set up
 a key map (if it doesn't exist yet).


 Maybe I'm doing something wrong but didn't have any luck :(

 [root@tux ~]# sudo rmmod em28xx_rc
 [root@tux ~]# sudo rmmod em28xx_dvb
 [root@tux ~]# sudo rmmod em28xx
 [root@tux ~]# modprobe em28xx_rc ir_debug=1

 I don't see any additional messages in dmesg.

 I verified the remote still works in windows (a stupidity check on my
 part)

 Maybe Kernel debugs are not enabled? em28xx driver is a little bit
 legacy in logging too as it uses own logging whilst nowadays dynamic
 logging is recommended.

 replace KERN_DEBUG as KERN_INFO inside em28xx-input.c and test. It will
 change driver to use Kernel normal log writings instead of current debug
 ones.

 regards
 Antti


 That unfortunately doesn't make any difference.

 I even tried adding a print statment before the debug line got called
 like this (line 97 added; em28xx-input.c):
  97 printk(KERN_INFO key %02x\n, b);
  98 i2cdprintk(key %02x\n, b);


The relevant line is

297dprintk(%s: toggle: %d, count: %d, key 0x%02x%02x\n, __func__,

Change it to

297printk(KERN_INFO %s: toggle: %d, count: %d, key
0x%02x%02x\n, __func__,

Also double-check that the IR module (em28xx_rc) is enabled / gets loaded.

Regards,
Frank


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Matthew Gyurgyik

On 12/09/2012 07:48 AM, Frank Schäfer wrote:

Am 08.12.2012 23:04, schrieb Matthew Gyurgyik:

On 12/08/2012 04:47 PM, Antti Palosaari wrote:

On 12/08/2012 11:40 PM, Matthew Gyurgyik wrote:

On 12/08/2012 12:49 PM, Frank Schäfer wrote:

Am 08.12.2012 17:51, schrieb Matthew Gyurgyik:

That shouldn't be necessary. I just noticed that there is a module
parameter 'ir_debug'. ;)
With ir_debug enabled, you should see messages

  em28xx_ir_handle_key: toggle: XX, count: XX, key XXYYZZ

everytime you press a button. Once we know the key codes, we can
set up
a key map (if it doesn't exist yet).



Maybe I'm doing something wrong but didn't have any luck :(


[root@tux ~]# sudo rmmod em28xx_rc
[root@tux ~]# sudo rmmod em28xx_dvb
[root@tux ~]# sudo rmmod em28xx
[root@tux ~]# modprobe em28xx_rc ir_debug=1


I don't see any additional messages in dmesg.

I verified the remote still works in windows (a stupidity check on my
part)


Maybe Kernel debugs are not enabled? em28xx driver is a little bit
legacy in logging too as it uses own logging whilst nowadays dynamic
logging is recommended.

replace KERN_DEBUG as KERN_INFO inside em28xx-input.c and test. It will
change driver to use Kernel normal log writings instead of current debug
ones.

regards
Antti



That unfortunately doesn't make any difference.

I even tried adding a print statment before the debug line got called
like this (line 97 added; em28xx-input.c):
  97 printk(KERN_INFO key %02x\n, b);
  98 i2cdprintk(key %02x\n, b);



The relevant line is

297dprintk(%s: toggle: %d, count: %d, key 0x%02x%02x\n, __func__,

Change it to

297printk(KERN_INFO %s: toggle: %d, count: %d, key
0x%02x%02x\n, __func__,

Also double-check that the IR module (em28xx_rc) is enabled / gets loaded.

Regards,
Frank



Sadly I'm still not getting anything.

[root@tux ~]# rmmod em28xx_rc 


[root@tux ~]# rmmod em28xx_dvb
[root@tux ~]# rmmod em28xx
[root@tux ~]# lsmod | grep em28xx
[root@tux ~]# modprobe em28xx_rc ir_debug=1

[root@tux ~]# lsmod | grep em28xx
em28xx_dvb 17075  0
em28xx_rc   6250  0
em28xx 85996  2 em28xx_dvb,em28xx_rc
rc_core12193  3 rc_msi_digivox_iii,em28xx_rc
dvb_core   86050  2 em28xx_dvb,lgdt3305
tveeprom   13658  1 em28xx
videobuf_vmalloc4136  1 em28xx
videobuf_core  15216  2 videobuf_vmalloc,em28xx
v4l2_common 6927  1 em28xx
videodev   97480  2 em28xx,v4l2_common


Just to make sure I'm not misunderstanding, the messages should get 
logged to dmesg, correct?



--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL FOR 3.8] Various USB webcam fixes resend

2012-12-09 Thread Hans de Goede

resend of the same mail from 29 November, as it seems to have been missed

Hi Mauro,

Please pull from my tree for some assorted USB webcam fixes for 3.8

The following changes since commit d8658bca2e5696df2b6c69bc5538f8fe54e4a01e:

  [media] omap3isp: Replace cpu_is_omap3630() with ISP revision check 
(2012-11-28 10:54:46 -0200)

are available in the git repository at:

  git://linuxtv.org/hgoede/gspca.git media-for_v3.8

for you to fetch changes up to 325b64b6cb9090c1bc7cda5444f84b2c00acf926:

  Documentation/media: Remove docs for obsoleted and removed v4l1 drivers 
(2012-11-29 11:29:48 +0100)


Hans de Goede (3):
  gspca-pac207: Add a led_invert module parameter
  stk-webcam: Add an upside down dmi table, and add the Asus G1 to it
  Documentation/media: Remove docs for obsoleted and removed v4l1 drivers

Jean-François Moine (1):
  gspca - stv06xx: Fix a regression with the bridge/sensor vv6410

 Documentation/video4linux/et61x251.txt   | 315 
 Documentation/video4linux/ibmcam.txt | 323 
 Documentation/video4linux/m5602.txt  |  12 -
 Documentation/video4linux/ov511.txt  | 288 --
 Documentation/video4linux/se401.txt  |  54 ---
 Documentation/video4linux/stv680.txt |  53 ---
 Documentation/video4linux/w9968cf.txt| 458 ---
 Documentation/video4linux/zc0301.txt | 270 -
 drivers/media/usb/gspca/pac207.c |  32 +-
 drivers/media/usb/gspca/stv06xx/stv06xx_vv6410.c |   4 +
 drivers/media/usb/stkwebcam/stk-webcam.c |  56 ++-
 11 files changed, 76 insertions(+), 1789 deletions(-)
 delete mode 100644 Documentation/video4linux/et61x251.txt
 delete mode 100644 Documentation/video4linux/ibmcam.txt
 delete mode 100644 Documentation/video4linux/m5602.txt
 delete mode 100644 Documentation/video4linux/ov511.txt
 delete mode 100644 Documentation/video4linux/se401.txt
 delete mode 100644 Documentation/video4linux/stv680.txt
 delete mode 100644 Documentation/video4linux/w9968cf.txt
 delete mode 100644 Documentation/video4linux/zc0301.txt

Thanks  Regards,

Hans
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Devin Heitmueller
On Sun, Dec 9, 2012 at 9:50 AM, Matthew Gyurgyik matt...@pyther.net wrote:
 Just to make sure I'm not misunderstanding, the messages should get logged
 to dmesg, correct?

I wrote the original IR support for the em2874, but it seems to have
changed a bit since I submitted it.  One thing that jumps out at me is
if you specify a remote control of the wrong *type* (e.g. the driver
is configured for RC5 but the actual remote is configured for NEC),
then you're likely to get no events from the device.

You may wish to lookup what type of remote RC_MAP_KWORLD_315U is, and
try a remote that is of the other protocol type (e.g. if
RC_MAP_KWORLD_315U is RC5 then try a remote which is NEC).  Then see
if you get events.  If so, then you know you have the correct RC
protocol and just need to adjust the RC profile specified.

Also, it's possible the remote control is an RC6 remote, which I never
got around to adding em2874 driver support for.  Take a look at the
windows trace and see what register R50 is being set to.  In
particular, bits [3-2] will tell you what RC protocol the Windows
driver expects the remote to be.  I'm pretty sure I put the definition
for the relevant bits in em28xx-reg.h.

Devin

--
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Frank Schäfer
Am 09.12.2012 16:46, schrieb Devin Heitmueller:
 On Sun, Dec 9, 2012 at 9:50 AM, Matthew Gyurgyik matt...@pyther.net wrote:
 Just to make sure I'm not misunderstanding, the messages should get logged
 to dmesg, correct?
 I wrote the original IR support for the em2874, but it seems to have
 changed a bit since I submitted it.  One thing that jumps out at me is
 if you specify a remote control of the wrong *type* (e.g. the driver
 is configured for RC5 but the actual remote is configured for NEC),
 then you're likely to get no events from the device.

 You may wish to lookup what type of remote RC_MAP_KWORLD_315U is, and
 try a remote that is of the other protocol type (e.g. if
 RC_MAP_KWORLD_315U is RC5 then try a remote which is NEC).  Then see
 if you get events.  If so, then you know you have the correct RC
 protocol and just need to adjust the RC profile specified.

 Also, it's possible the remote control is an RC6 remote, which I never
 got around to adding em2874 driver support for.  Take a look at the
 windows trace and see what register R50 is being set to.  In
 particular, bits [3-2] will tell you what RC protocol the Windows
 driver expects the remote to be.  I'm pretty sure I put the definition
 for the relevant bits in em28xx-reg.h.

According to the USB log, register 0x50 is set to 0x01.

em28xx-reg.h says:

/* em2874 IR config register (0x50) */
#define EM2874_IR_NEC   0x00
#define EM2874_IR_RC5   0x04
#define EM2874_IR_RC6_MODE_00x08
#define EM2874_IR_RC6_MODE_6A   0x0b

Any idea what 0x01 is ?

It also seems that em28xx_ir_change_protocol() always sets reg 0x05 to
EM2874_IR_RC5...

Regards,
Frank

 Devin

 --
 Devin J. Heitmueller - Kernel Labs
 http://www.kernellabs.com

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Frank Schäfer
Am 09.12.2012 17:19, schrieb Frank Schäfer:
 Am 09.12.2012 16:46, schrieb Devin Heitmueller:
 On Sun, Dec 9, 2012 at 9:50 AM, Matthew Gyurgyik matt...@pyther.net wrote:
 Just to make sure I'm not misunderstanding, the messages should get logged
 to dmesg, correct?
 I wrote the original IR support for the em2874, but it seems to have
 changed a bit since I submitted it.  One thing that jumps out at me is
 if you specify a remote control of the wrong *type* (e.g. the driver
 is configured for RC5 but the actual remote is configured for NEC),
 then you're likely to get no events from the device.

 You may wish to lookup what type of remote RC_MAP_KWORLD_315U is, and
 try a remote that is of the other protocol type (e.g. if
 RC_MAP_KWORLD_315U is RC5 then try a remote which is NEC).  Then see
 if you get events.  If so, then you know you have the correct RC
 protocol and just need to adjust the RC profile specified.

 Also, it's possible the remote control is an RC6 remote, which I never
 got around to adding em2874 driver support for.  Take a look at the
 windows trace and see what register R50 is being set to.  In
 particular, bits [3-2] will tell you what RC protocol the Windows
 driver expects the remote to be.  I'm pretty sure I put the definition
 for the relevant bits in em28xx-reg.h.
 According to the USB log, register 0x50 is set to 0x01.

 em28xx-reg.h says:

 /* em2874 IR config register (0x50) */
 #define EM2874_IR_NEC   0x00
 #define EM2874_IR_RC5   0x04
 #define EM2874_IR_RC6_MODE_00x08
 #define EM2874_IR_RC6_MODE_6A   0x0b

 Any idea what 0x01 is ?

 It also seems that em28xx_ir_change_protocol() always sets reg 0x05 to
 EM2874_IR_RC5...

Sorry, I was wrong. Of course it sets 0x05 to EM2874_IR_RC5 or
EM2874_IR_NEC depending on field .xclk in the board struct.

Frank


 Regards,
 Frank

 Devin

 --
 Devin J. Heitmueller - Kernel Labs
 http://www.kernellabs.com

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Frank Schäfer
Am 09.12.2012 17:23, schrieb Frank Schäfer:
 Am 09.12.2012 17:19, schrieb Frank Schäfer:
 Am 09.12.2012 16:46, schrieb Devin Heitmueller:
 On Sun, Dec 9, 2012 at 9:50 AM, Matthew Gyurgyik matt...@pyther.net wrote:
 Just to make sure I'm not misunderstanding, the messages should get logged
 to dmesg, correct?
 I wrote the original IR support for the em2874, but it seems to have
 changed a bit since I submitted it.  One thing that jumps out at me is
 if you specify a remote control of the wrong *type* (e.g. the driver
 is configured for RC5 but the actual remote is configured for NEC),
 then you're likely to get no events from the device.

 You may wish to lookup what type of remote RC_MAP_KWORLD_315U is, and
 try a remote that is of the other protocol type (e.g. if
 RC_MAP_KWORLD_315U is RC5 then try a remote which is NEC).  Then see
 if you get events.  If so, then you know you have the correct RC
 protocol and just need to adjust the RC profile specified.

 Also, it's possible the remote control is an RC6 remote, which I never
 got around to adding em2874 driver support for.  Take a look at the
 windows trace and see what register R50 is being set to.  In
 particular, bits [3-2] will tell you what RC protocol the Windows
 driver expects the remote to be.  I'm pretty sure I put the definition
 for the relevant bits in em28xx-reg.h.
 According to the USB log, register 0x50 is set to 0x01.

 em28xx-reg.h says:

 /* em2874 IR config register (0x50) */
 #define EM2874_IR_NEC   0x00
 #define EM2874_IR_RC5   0x04
 #define EM2874_IR_RC6_MODE_00x08
 #define EM2874_IR_RC6_MODE_6A   0x0b

 Any idea what 0x01 is ?

 It also seems that em28xx_ir_change_protocol() always sets reg 0x05 to
 EM2874_IR_RC5...
 Sorry, I was wrong. Of course it sets 0x05 to EM2874_IR_RC5 or
 EM2874_IR_NEC depending on field .xclk in the board struct.

Forget this sh... (never do multiple things at the same time ;) )

Reg 0x50 is set to according to rc_type specified in the selected remote
control map.
So if the correct map is selected, everything should be fine (as long as
it is RC_TYPE_NEC or RC_TYPE_RC5 because we don't support others yet).

RC_MAP_KWORLD_315U and RC_MAP_MSI_DIGIVOX_III are both RC_TYPE_NEC, so
the stick seems to use no NEC protocol.

Matthew, insert a line

ir_config = 0x01;

before

380em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, ir_config, 1);

in em28xx-input.c and see if something shows up in the dmesg output.

Regards,
Frank


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: em28xx: msi Digivox ATSC board id [0db0:8810]

2012-12-09 Thread Matthew Gyurgyik

On 12/09/2012 12:06 PM, Frank Schäfer wrote:

Forget this sh... (never do multiple things at the same time ;) )

Reg 0x50 is set to according to rc_type specified in the selected remote
control map.
So if the correct map is selected, everything should be fine (as long as
it is RC_TYPE_NEC or RC_TYPE_RC5 because we don't support others yet).

RC_MAP_KWORLD_315U and RC_MAP_MSI_DIGIVOX_III are both RC_TYPE_NEC, so
the stick seems to use no NEC protocol.

Matthew, insert a line

 ir_config = 0x01;

before

380em28xx_write_regs(dev, EM2874_R50_IR_CONFIG, ir_config, 1);

in em28xx-input.c and see if something shows up in the dmesg output.

Regards,
Frank


That seems to be a bit more successful!

Here is the dmesg output:


[root@tux ~]# dmesg -t | sort | uniq | grep 'em28xx IR' | grep handle
em28xx IR (em28xx #0)/ir: 6em28xx_ir_handle_key: toggle: 0, count: 1, key 0x61d6
em28xx IR (em28xx #0)/ir: 6em28xx_ir_handle_key: toggle: 0, count: 2, key 0x61d6
em28xx IR (em28xx #0)/ir: 6em28xx_ir_handle_key: toggle: 1, count: 1, key 0x61d6
em28xx IR (em28xx #0)/ir: em28xx_ir_handle_key: toggle: 0, count: 1, key 0x61d6
em28xx IR (em28xx #0)/ir: em28xx_ir_handle_key: toggle: 0, count: 2, key 0x61d6
em28xx IR (em28xx #0)/ir: em28xx_ir_handle_key: toggle: 1, count: 1, key 0x61d6
em28xx IR (em28xx #0)/ir: em28xx_ir_handle_key: toggle: 1, count: 2, key 0x61d6


I pressed all the buttons on the remote (40 buttons).

Thanks,
Matthew
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


populardating.net now links to you

2012-12-09 Thread Kemal TUTKUN
Dear Thestateofme,

I have visited your site and I think that the relationship content 
could be of interest to our web site visitors.

I have already placed a link to your site along with a description at 
http://www.populardating.net/. If you want the description of your site 
modified or if you have any other cross-promotion ideas, let me know.

I would appreciate if you placed a link back to my site:

PopularDating.net International Dating community for expatriates. Helps expats 
living abroad 
to chat, date, find love, find friends or find a partner.


Best regards,

Kemal TUTKUN
PopularDating. Ltd

http://www.populardating.net - kemalwo...@gmail.com
1234 Example Ave., Example City, NY A1B 3C4
Phone: (123) 456-7890 - Fax: 456-7890
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 06/17] fc0012: add RF loop through

2012-12-09 Thread Antti Palosaari
Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012-priv.h | 1 +
 drivers/media/tuners/fc0012.c  | 7 +++
 drivers/media/tuners/fc0012.h  | 5 +
 3 files changed, 13 insertions(+)

diff --git a/drivers/media/tuners/fc0012-priv.h 
b/drivers/media/tuners/fc0012-priv.h
index 4577c91..1195ee9 100644
--- a/drivers/media/tuners/fc0012-priv.h
+++ b/drivers/media/tuners/fc0012-priv.h
@@ -32,6 +32,7 @@
 
 struct fc0012_priv {
struct i2c_adapter *i2c;
+   const struct fc0012_config *cfg;
u8 addr;
u8 dual_master;
u8 xtal_freq;
diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index 5ede0c0..636f951 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -101,6 +101,9 @@ static int fc0012_init(struct dvb_frontend *fe)
if (priv-dual_master)
reg[0x0c] |= 0x02;
 
+   if (priv-cfg-loop_through)
+   reg[0x09] |= 0x01;
+
if (fe-ops.i2c_gate_ctrl)
fe-ops.i2c_gate_ctrl(fe, 1); /* open I2C-gate */
 
@@ -445,6 +448,7 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
return NULL;
 
priv-i2c = i2c;
+   priv-cfg = cfg;
priv-dual_master = cfg-dual_master;
priv-addr = cfg-i2c_address;
priv-xtal_freq = cfg-xtal_freq;
@@ -453,6 +457,9 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
 
fe-tuner_priv = priv;
 
+   if (priv-cfg-loop_through)
+   fc0012_writereg(priv, 0x09, 0x6f);
+
memcpy(fe-ops.tuner_ops, fc0012_tuner_ops,
sizeof(struct dvb_tuner_ops));
 
diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
index 41946f8..891d66d 100644
--- a/drivers/media/tuners/fc0012.h
+++ b/drivers/media/tuners/fc0012.h
@@ -36,6 +36,11 @@ struct fc0012_config {
enum fc001x_xtal_freq xtal_freq;
 
int dual_master;
+
+   /*
+* RF loop-through
+*/
+   bool loop_through;
 };
 
 #if defined(CONFIG_MEDIA_TUNER_FC0012) || \
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 07/17] fc0012: enable clock output on attach()

2012-12-09 Thread Antti Palosaari
We need feed clock to slave demodulator at the very beginning
in case of dual tuner configuration.

I am not sure if that configuration changes clock output divider
or enable clock output itself...

Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012.c | 7 +++
 drivers/media/tuners/fc0012.h | 5 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index 636f951..1a52b76 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -460,6 +460,13 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
if (priv-cfg-loop_through)
fc0012_writereg(priv, 0x09, 0x6f);
 
+   /*
+* TODO: Clock out en or div?
+* For dual tuner configuration clearing bit [0] is required.
+*/
+   if (priv-cfg-clock_out)
+   fc0012_writereg(priv, 0x0b, 0x82);
+
memcpy(fe-ops.tuner_ops, fc0012_tuner_ops,
sizeof(struct dvb_tuner_ops));
 
diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
index 891d66d..83a98e7 100644
--- a/drivers/media/tuners/fc0012.h
+++ b/drivers/media/tuners/fc0012.h
@@ -41,6 +41,11 @@ struct fc0012_config {
 * RF loop-through
 */
bool loop_through;
+
+   /*
+* clock output
+*/
+   bool clock_out;
 };
 
 #if defined(CONFIG_MEDIA_TUNER_FC0012) || \
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 09/17] fc0012: use config directly from the config struct

2012-12-09 Thread Antti Palosaari
No need to copy config to the driver state. Those are coming from
the const struct and could be used directly.

Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012-priv.h|  3 ---
 drivers/media/tuners/fc0012.c | 17 -
 drivers/media/tuners/fc0012.h |  2 +-
 drivers/media/usb/dvb-usb-v2/af9035.c |  4 ++--
 4 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/media/tuners/fc0012-priv.h 
b/drivers/media/tuners/fc0012-priv.h
index 1195ee9..3b98bf9 100644
--- a/drivers/media/tuners/fc0012-priv.h
+++ b/drivers/media/tuners/fc0012-priv.h
@@ -33,9 +33,6 @@
 struct fc0012_priv {
struct i2c_adapter *i2c;
const struct fc0012_config *cfg;
-   u8 addr;
-   u8 dual_master;
-   u8 xtal_freq;
 
u32 frequency;
u32 bandwidth;
diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index 1a52b76..01f5e40 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -25,7 +25,7 @@ static int fc0012_writereg(struct fc0012_priv *priv, u8 reg, 
u8 val)
 {
u8 buf[2] = {reg, val};
struct i2c_msg msg = {
-   .addr = priv-addr, .flags = 0, .buf = buf, .len = 2
+   .addr = priv-cfg-i2c_address, .flags = 0, .buf = buf, .len = 2
};
 
if (i2c_transfer(priv-i2c, msg, 1) != 1) {
@@ -38,8 +38,10 @@ static int fc0012_writereg(struct fc0012_priv *priv, u8 reg, 
u8 val)
 static int fc0012_readreg(struct fc0012_priv *priv, u8 reg, u8 *val)
 {
struct i2c_msg msg[2] = {
-   { .addr = priv-addr, .flags = 0, .buf = reg, .len = 1 },
-   { .addr = priv-addr, .flags = I2C_M_RD, .buf = val, .len = 1 },
+   { .addr = priv-cfg-i2c_address, .flags = 0,
+   .buf = reg, .len = 1 },
+   { .addr = priv-cfg-i2c_address, .flags = I2C_M_RD,
+   .buf = val, .len = 1 },
};
 
if (i2c_transfer(priv-i2c, msg, 2) != 2) {
@@ -88,7 +90,7 @@ static int fc0012_init(struct dvb_frontend *fe)
0x04,   /* reg. 0x15: Enable LNA COMPS */
};
 
-   switch (priv-xtal_freq) {
+   switch (priv-cfg-xtal_freq) {
case FC_XTAL_27_MHZ:
case FC_XTAL_28_8_MHZ:
reg[0x07] |= 0x20;
@@ -98,7 +100,7 @@ static int fc0012_init(struct dvb_frontend *fe)
break;
}
 
-   if (priv-dual_master)
+   if (priv-cfg-dual_master)
reg[0x0c] |= 0x02;
 
if (priv-cfg-loop_through)
@@ -147,7 +149,7 @@ static int fc0012_set_params(struct dvb_frontend *fe)
goto exit;
}
 
-   switch (priv-xtal_freq) {
+   switch (priv-cfg-xtal_freq) {
case FC_XTAL_27_MHZ:
xtal_freq_khz_2 = 27000 / 2;
break;
@@ -449,9 +451,6 @@ struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
 
priv-i2c = i2c;
priv-cfg = cfg;
-   priv-dual_master = cfg-dual_master;
-   priv-addr = cfg-i2c_address;
-   priv-xtal_freq = cfg-xtal_freq;
 
info(Fitipower FC0012 successfully attached.);
 
diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
index 83a98e7..3fb53b8 100644
--- a/drivers/media/tuners/fc0012.h
+++ b/drivers/media/tuners/fc0012.h
@@ -35,7 +35,7 @@ struct fc0012_config {
 */
enum fc001x_xtal_freq xtal_freq;
 
-   int dual_master;
+   bool dual_master;
 
/*
 * RF loop-through
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index 1c7fe5a..68e0e804 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -906,13 +906,13 @@ static const struct fc0012_config af9035_fc0012_config[] 
= {
{
.i2c_address = 0x63,
.xtal_freq = FC_XTAL_36_MHZ,
-   .dual_master = 1,
+   .dual_master = true,
.loop_through = true,
.clock_out = true,
}, {
.i2c_address = 0x63 | 0x80, /* I2C bus select hack */
.xtal_freq = FC_XTAL_36_MHZ,
-   .dual_master = 1,
+   .dual_master = true,
}
 };
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 16/17] af9033: update fc2580 init sequence

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033_priv.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033_priv.h 
b/drivers/media/dvb-frontends/af9033_priv.h
index 1fb84a2..e9bd782 100644
--- a/drivers/media/dvb-frontends/af9033_priv.h
+++ b/drivers/media/dvb-frontends/af9033_priv.h
@@ -525,11 +525,12 @@ static const struct reg_val tuner_init_fc2580[] = {
{ 0x800095, 0x00 },
{ 0x800096, 0x05 },
{ 0x8000b3, 0x01 },
-   { 0x8000c3, 0x01 },
-   { 0x8000c4, 0x00 },
+   { 0x8000c5, 0x01 },
+   { 0x8000c6, 0x00 },
+   { 0x8000d1, 0x01 },
{ 0x80f007, 0x00 },
{ 0x80f00c, 0x19 },
-   { 0x80f00d, 0x1A },
+   { 0x80f00d, 0x1a },
{ 0x80f00e, 0x00 },
{ 0x80f00f, 0x02 },
{ 0x80f010, 0x00 },
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 14/17] af9033: update tua9001 init sequence

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033_priv.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033_priv.h 
b/drivers/media/dvb-frontends/af9033_priv.h
index d96d128..e0be040 100644
--- a/drivers/media/dvb-frontends/af9033_priv.h
+++ b/drivers/media/dvb-frontends/af9033_priv.h
@@ -321,8 +321,9 @@ static const struct reg_val tuner_init_tua9001[] = {
{ 0x80009b, 0x05 },
{ 0x80009c, 0x80 },
{ 0x8000b3, 0x00 },
-   { 0x8000c1, 0x01 },
-   { 0x8000c2, 0x00 },
+   { 0x8000c5, 0x01 },
+   { 0x8000c6, 0x00 },
+   { 0x8000c9, 0x5d },
{ 0x80f007, 0x00 },
{ 0x80f01f, 0x82 },
{ 0x80f020, 0x00 },
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 13/17] af9033: update demod init sequence

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033_priv.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033_priv.h 
b/drivers/media/dvb-frontends/af9033_priv.h
index 288cd45..d96d128 100644
--- a/drivers/media/dvb-frontends/af9033_priv.h
+++ b/drivers/media/dvb-frontends/af9033_priv.h
@@ -199,10 +199,9 @@ static const struct reg_val ofsm_init[] = {
{ 0x8000a6, 0x01 },
{ 0x8000a9, 0x00 },
{ 0x8000aa, 0x01 },
-   { 0x8000ab, 0x01 },
{ 0x8000b0, 0x01 },
-   { 0x8000c0, 0x05 },
-   { 0x8000c4, 0x19 },
+   { 0x8000c4, 0x05 },
+   { 0x8000c8, 0x19 },
{ 0x80f000, 0x0f },
{ 0x80f016, 0x10 },
{ 0x80f017, 0x04 },
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 15/17] af9033: update fc0011 init sequence

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033_priv.h | 72 +++
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033_priv.h 
b/drivers/media/dvb-frontends/af9033_priv.h
index e0be040..1fb84a2 100644
--- a/drivers/media/dvb-frontends/af9033_priv.h
+++ b/drivers/media/dvb-frontends/af9033_priv.h
@@ -339,14 +339,14 @@ static const struct reg_val tuner_init_tua9001[] = {
 /* Fitipower fc0011 tuner init
AF9033_TUNER_FC0011= 0x28 */
 static const struct reg_val tuner_init_fc0011[] = {
-   { 0x800046, AF9033_TUNER_FC0011 },
+   { 0x800046, 0x28 },
{ 0x800057, 0x00 },
{ 0x800058, 0x01 },
{ 0x80005f, 0x00 },
{ 0x800060, 0x00 },
{ 0x800068, 0xa5 },
{ 0x80006e, 0x01 },
-   { 0x800071, 0x0A },
+   { 0x800071, 0x0a },
{ 0x800072, 0x02 },
{ 0x800074, 0x01 },
{ 0x800079, 0x01 },
@@ -354,7 +354,7 @@ static const struct reg_val tuner_init_fc0011[] = {
{ 0x800094, 0x00 },
{ 0x800095, 0x00 },
{ 0x800096, 0x00 },
-   { 0x80009b, 0x2D },
+   { 0x80009b, 0x2d },
{ 0x80009c, 0x60 },
{ 0x80009d, 0x23 },
{ 0x8000a4, 0x50 },
@@ -362,39 +362,39 @@ static const struct reg_val tuner_init_fc0011[] = {
{ 0x8000b3, 0x01 },
{ 0x8000b7, 0x88 },
{ 0x8000b8, 0xa6 },
-   { 0x8000c3, 0x01 },
-   { 0x8000c4, 0x01 },
-   { 0x8000c7, 0x69 },
-   { 0x80F007, 0x00 },
-   { 0x80F00A, 0x1B },
-   { 0x80F00B, 0x1B },
-   { 0x80F00C, 0x1B },
-   { 0x80F00D, 0x1B },
-   { 0x80F00E, 0xFF },
-   { 0x80F00F, 0x01 },
-   { 0x80F010, 0x00 },
-   { 0x80F011, 0x02 },
-   { 0x80F012, 0xFF },
-   { 0x80F013, 0x01 },
-   { 0x80F014, 0x00 },
-   { 0x80F015, 0x02 },
-   { 0x80F01B, 0xEF },
-   { 0x80F01C, 0x01 },
-   { 0x80F01D, 0x0f },
-   { 0x80F01E, 0x02 },
-   { 0x80F01F, 0x6E },
-   { 0x80F020, 0x00 },
-   { 0x80F025, 0xDE },
-   { 0x80F026, 0x00 },
-   { 0x80F027, 0x0A },
-   { 0x80F028, 0x03 },
-   { 0x80F029, 0x6E },
-   { 0x80F02A, 0x00 },
-   { 0x80F047, 0x00 },
-   { 0x80F054, 0x00 },
-   { 0x80F055, 0x00 },
-   { 0x80F077, 0x01 },
-   { 0x80F1E6, 0x00 },
+   { 0x8000c5, 0x01 },
+   { 0x8000c6, 0x01 },
+   { 0x8000c9, 0x69 },
+   { 0x80f007, 0x00 },
+   { 0x80f00a, 0x1b },
+   { 0x80f00b, 0x1b },
+   { 0x80f00c, 0x1b },
+   { 0x80f00d, 0x1b },
+   { 0x80f00e, 0xff },
+   { 0x80f00f, 0x01 },
+   { 0x80f010, 0x00 },
+   { 0x80f011, 0x02 },
+   { 0x80f012, 0xff },
+   { 0x80f013, 0x01 },
+   { 0x80f014, 0x00 },
+   { 0x80f015, 0x02 },
+   { 0x80f01b, 0xef },
+   { 0x80f01c, 0x01 },
+   { 0x80f01d, 0x0f },
+   { 0x80f01e, 0x02 },
+   { 0x80f01f, 0x6e },
+   { 0x80f020, 0x00 },
+   { 0x80f025, 0xde },
+   { 0x80f026, 0x00 },
+   { 0x80f027, 0x0a },
+   { 0x80f028, 0x03 },
+   { 0x80f029, 0x6e },
+   { 0x80f02a, 0x00 },
+   { 0x80f047, 0x00 },
+   { 0x80f054, 0x00 },
+   { 0x80f055, 0x00 },
+   { 0x80f077, 0x01 },
+   { 0x80f1e6, 0x00 },
 };
 
 /* Fitipower FC0012 tuner init
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 17/17] af9035: print warning when firmware is bad

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/af9035.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index 68e0e804..ea37b5c 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -437,6 +437,10 @@ static int af9035_download_firmware(struct dvb_usb_device 
*d,
__func__, fw-size - i);
}
 
+   /* print warn if firmware is bad, continue and see what happens */
+   if (i)
+   dev_warn(d-udev-dev, %s: bad firmware\n, KBUILD_MODNAME);
+
/* firmware loaded, request boot */
req.cmd = CMD_FW_BOOT;
ret = af9035_ctrl_msg(d, req);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 12/17] fc0012: remove unused callback and correct one comment

2012-12-09 Thread Antti Palosaari
There is no need to keep dummy sleep() callback implementation as
DVB-core checks existence of it before calls callback. Due to that
we can remove it.

FC0012 is based of direct-conversion receiver architecture
(aka Zero-IF) where is no IF used. Due to that IF is always 0 Hz.
Fix comment to point that.

Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index 4491f06..f4d0e79 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -129,12 +129,6 @@ static int fc0012_init(struct dvb_frontend *fe)
return ret;
 }
 
-static int fc0012_sleep(struct dvb_frontend *fe)
-{
-   /* nothing to do here */
-   return 0;
-}
-
 static int fc0012_set_params(struct dvb_frontend *fe)
 {
struct fc0012_priv *priv = fe-tuner_priv;
@@ -343,8 +337,7 @@ static int fc0012_get_frequency(struct dvb_frontend *fe, 
u32 *frequency)
 
 static int fc0012_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
-   /* CHECK: always ? */
-   *frequency = 0;
+   *frequency = 0; /* Zero-IF */
return 0;
 }
 
@@ -437,7 +430,6 @@ static const struct dvb_tuner_ops fc0012_tuner_ops = {
.release= fc0012_release,
 
.init   = fc0012_init,
-   .sleep  = fc0012_sleep,
 
.set_params = fc0012_set_params,
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 03/17] af9035: dual mode support

2012-12-09 Thread Antti Palosaari
From: Jose Alberto Reguero jaregu...@telefonica.net

Adds initial support for af9035 dual mode designs.

Signed-off-by: Jose Alberto Reguero jaregu...@telefonica.net
[cr...@iki.fi: fix merge conflict]
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033.c  |  12 +++
 drivers/media/usb/dvb-usb-v2/af9035.c | 155 +++---
 drivers/media/usb/dvb-usb-v2/af9035.h |   3 +
 3 files changed, 123 insertions(+), 47 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index 27638a9..745d2fa 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -335,6 +335,18 @@ static int af9033_init(struct dvb_frontend *fe)
goto err;
}
 
+   if (state-cfg.ts_mode == AF9033_TS_MODE_SERIAL) {
+   ret = af9033_wr_reg_mask(state, 0x00d91c, 0x01, 0x01);
+   if (ret  0)
+   goto err;
+   ret = af9033_wr_reg_mask(state, 0x00d917, 0x00, 0x01);
+   if (ret  0)
+   goto err;
+   ret = af9033_wr_reg_mask(state, 0x00d916, 0x00, 0x01);
+   if (ret  0)
+   goto err;
+   }
+
state-bandwidth_hz = 0; /* force to program all parameters */
 
return 0;
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index c1ec18c..15625eb 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -209,10 +209,14 @@ static int af9035_i2c_master_xfer(struct i2c_adapter 
*adap,
if (msg[0].len  40 || msg[1].len  40) {
/* TODO: correct limits  40 */
ret = -EOPNOTSUPP;
-   } else if (msg[0].addr == state-af9033_config[0].i2c_addr) {
+   } else if ((msg[0].addr == state-af9033_config[0].i2c_addr) ||
+  (msg[0].addr == state-af9033_config[1].i2c_addr)) {
/* integrated demod */
u32 reg = msg[0].buf[0]  16 | msg[0].buf[1]  8 |
msg[0].buf[2];
+   if (state-af9033_config[1].i2c_addr 
+  (msg[0].addr == state-af9033_config[1].i2c_addr))
+   reg |= 0x10;
ret = af9035_rd_regs(d, reg, msg[1].buf[0],
msg[1].len);
} else {
@@ -220,8 +224,9 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
u8 buf[5 + msg[0].len];
struct usb_req req = { CMD_I2C_RD, 0, sizeof(buf),
buf, msg[1].len, msg[1].buf };
+   req.mbox |= ((msg[0].addr  0x80)3);
buf[0] = msg[1].len;
-   buf[1] = msg[0].addr  1;
+   buf[1] = (u8)(msg[0].addr  1);
buf[2] = 0x00; /* reg addr len */
buf[3] = 0x00; /* reg addr MSB */
buf[4] = 0x00; /* reg addr LSB */
@@ -232,10 +237,14 @@ static int af9035_i2c_master_xfer(struct i2c_adapter 
*adap,
if (msg[0].len  40) {
/* TODO: correct limits  40 */
ret = -EOPNOTSUPP;
-   } else if (msg[0].addr == state-af9033_config[0].i2c_addr) {
+   } else if ((msg[0].addr == state-af9033_config[0].i2c_addr) ||
+  (msg[0].addr == state-af9033_config[1].i2c_addr)) {
/* integrated demod */
u32 reg = msg[0].buf[0]  16 | msg[0].buf[1]  8 |
msg[0].buf[2];
+   if (state-af9033_config[1].i2c_addr 
+  (msg[0].addr == state-af9033_config[1].i2c_addr))
+   reg |= 0x10;
ret = af9035_wr_regs(d, reg, msg[0].buf[3],
msg[0].len - 3);
} else {
@@ -243,8 +252,9 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
u8 buf[5 + msg[0].len];
struct usb_req req = { CMD_I2C_WR, 0, sizeof(buf), buf,
0, NULL };
+   req.mbox |= ((msg[0].addr  0x80)3);
buf[0] = msg[0].len;
-   buf[1] = msg[0].addr  1;
+   buf[1] = (u8)(msg[0].addr  1);
buf[2] = 0x00; /* reg addr len */
buf[3] = 0x00; /* reg addr MSB */
buf[4] = 0x00; /* reg addr LSB */
@@ -283,9 +293,30 @@ static int af9035_identify_state(struct dvb_usb_device *d, 
const char **name)
int ret;
u8 wbuf[1] = { 1 };
u8 rbuf[4];
+   u8 

[PATCH RFC 04/17] af9035: dual mode related changes

2012-12-09 Thread Antti Palosaari
Various small changes and fixes releated to dual mode.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033.c  |   2 +
 drivers/media/usb/dvb-usb-v2/af9035.c | 140 +++---
 drivers/media/usb/dvb-usb-v2/af9035.h |   5 +-
 3 files changed, 99 insertions(+), 48 deletions(-)

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index 745d2fa..c9cad98 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -339,9 +339,11 @@ static int af9033_init(struct dvb_frontend *fe)
ret = af9033_wr_reg_mask(state, 0x00d91c, 0x01, 0x01);
if (ret  0)
goto err;
+
ret = af9033_wr_reg_mask(state, 0x00d917, 0x00, 0x01);
if (ret  0)
goto err;
+
ret = af9033_wr_reg_mask(state, 0x00d916, 0x00, 0x01);
if (ret  0)
goto err;
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index 15625eb..d1beb7f 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -211,12 +211,13 @@ static int af9035_i2c_master_xfer(struct i2c_adapter 
*adap,
ret = -EOPNOTSUPP;
} else if ((msg[0].addr == state-af9033_config[0].i2c_addr) ||
   (msg[0].addr == state-af9033_config[1].i2c_addr)) {
-   /* integrated demod */
+   /* demod access via firmware interface */
u32 reg = msg[0].buf[0]  16 | msg[0].buf[1]  8 |
msg[0].buf[2];
-   if (state-af9033_config[1].i2c_addr 
-  (msg[0].addr == state-af9033_config[1].i2c_addr))
+
+   if (msg[0].addr == state-af9033_config[1].i2c_addr)
reg |= 0x10;
+
ret = af9035_rd_regs(d, reg, msg[1].buf[0],
msg[1].len);
} else {
@@ -226,7 +227,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
buf, msg[1].len, msg[1].buf };
req.mbox |= ((msg[0].addr  0x80)3);
buf[0] = msg[1].len;
-   buf[1] = (u8)(msg[0].addr  1);
+   buf[1] = msg[0].addr  1;
buf[2] = 0x00; /* reg addr len */
buf[3] = 0x00; /* reg addr MSB */
buf[4] = 0x00; /* reg addr LSB */
@@ -239,12 +240,13 @@ static int af9035_i2c_master_xfer(struct i2c_adapter 
*adap,
ret = -EOPNOTSUPP;
} else if ((msg[0].addr == state-af9033_config[0].i2c_addr) ||
   (msg[0].addr == state-af9033_config[1].i2c_addr)) {
-   /* integrated demod */
+   /* demod access via firmware interface */
u32 reg = msg[0].buf[0]  16 | msg[0].buf[1]  8 |
msg[0].buf[2];
-   if (state-af9033_config[1].i2c_addr 
-  (msg[0].addr == state-af9033_config[1].i2c_addr))
+
+   if (msg[0].addr == state-af9033_config[1].i2c_addr)
reg |= 0x10;
+
ret = af9035_wr_regs(d, reg, msg[0].buf[3],
msg[0].len - 3);
} else {
@@ -254,7 +256,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
0, NULL };
req.mbox |= ((msg[0].addr  0x80)3);
buf[0] = msg[0].len;
-   buf[1] = (u8)(msg[0].addr  1);
+   buf[1] = msg[0].addr  1;
buf[2] = 0x00; /* reg addr len */
buf[3] = 0x00; /* reg addr MSB */
buf[4] = 0x00; /* reg addr LSB */
@@ -293,30 +295,9 @@ static int af9035_identify_state(struct dvb_usb_device *d, 
const char **name)
int ret;
u8 wbuf[1] = { 1 };
u8 rbuf[4];
-   u8 tmp;
struct usb_req req = { CMD_FW_QUERYINFO, 0, sizeof(wbuf), wbuf,
sizeof(rbuf), rbuf };
 
-   /* check if there is dual tuners */
-   ret = af9035_rd_reg(d, EEPROM_DUAL_MODE, tmp);
-   if (ret  0)
-   goto err;
-
-   if (tmp) {
-   /* read 2nd demodulator I2C address */
-   ret = af9035_rd_reg(d, EEPROM_2WIREADDR, tmp);
-   if (ret  0)
-   goto err;
-
-   ret = af9035_wr_reg(d, 0x00417f, tmp);
-   if (ret  0)
-   goto err;
-
-   ret = af9035_wr_reg(d, 0x00d81a, 1);
-   if 

[PATCH RFC 11/17] fc0012: use Kernel dev_foo() logging

2012-12-09 Thread Antti Palosaari
Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012-priv.h |  9 -
 drivers/media/tuners/fc0012.c  | 20 ++--
 drivers/media/tuners/fc0012.h  |  2 +-
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/media/tuners/fc0012-priv.h 
b/drivers/media/tuners/fc0012-priv.h
index 3b98bf9..1a86ce1 100644
--- a/drivers/media/tuners/fc0012-priv.h
+++ b/drivers/media/tuners/fc0012-priv.h
@@ -21,15 +21,6 @@
 #ifndef _FC0012_PRIV_H_
 #define _FC0012_PRIV_H_
 
-#define LOG_PREFIX fc0012
-
-#undef err
-#define err(f, arg...)  printk(KERN_ERR LOG_PREFIX:  f \n , ## arg)
-#undef info
-#define info(f, arg...) printk(KERN_INFOLOG_PREFIX:  f \n , ## arg)
-#undef warn
-#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX:  f \n , ## arg)
-
 struct fc0012_priv {
struct i2c_adapter *i2c;
const struct fc0012_config *cfg;
diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index feb1594..4491f06 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -29,7 +29,9 @@ static int fc0012_writereg(struct fc0012_priv *priv, u8 reg, 
u8 val)
};
 
if (i2c_transfer(priv-i2c, msg, 1) != 1) {
-   err(I2C write reg failed, reg: %02x, val: %02x, reg, val);
+   dev_err(priv-i2c-dev,
+   %s: I2C write reg failed, reg: %02x, val: %02x\n,
+   KBUILD_MODNAME, reg, val);
return -EREMOTEIO;
}
return 0;
@@ -45,7 +47,9 @@ static int fc0012_readreg(struct fc0012_priv *priv, u8 reg, 
u8 *val)
};
 
if (i2c_transfer(priv-i2c, msg, 2) != 2) {
-   err(I2C read reg failed, reg: %02x, reg);
+   dev_err(priv-i2c-dev,
+   %s: I2C read reg failed, reg: %02x\n,
+   KBUILD_MODNAME, reg);
return -EREMOTEIO;
}
return 0;
@@ -119,7 +123,8 @@ static int fc0012_init(struct dvb_frontend *fe)
fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
 
if (ret)
-   err(fc0012_writereg failed: %d, ret);
+   dev_err(priv-i2c-dev, %s: fc0012_writereg failed: %d\n,
+   KBUILD_MODNAME, ret);
 
return ret;
 }
@@ -261,7 +266,8 @@ static int fc0012_set_params(struct dvb_frontend *fe)
break;
}
} else {
-   err(%s: modulation type not supported!, __func__);
+   dev_err(priv-i2c-dev, %s: modulation type not supported!\n,
+   KBUILD_MODNAME);
return -EINVAL;
}
 
@@ -323,7 +329,8 @@ exit:
if (fe-ops.i2c_gate_ctrl)
fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
if (ret)
-   warn(%s: failed: %d, __func__, ret);
+   dev_warn(priv-i2c-dev, %s: %s failed: %d\n,
+   KBUILD_MODNAME, __func__, ret);
return ret;
 }
 
@@ -413,7 +420,8 @@ err:
fe-ops.i2c_gate_ctrl(fe, 0); /* close I2C-gate */
 exit:
if (ret)
-   warn(%s: failed: %d, __func__, ret);
+   dev_warn(priv-i2c-dev, %s: %s failed: %d\n,
+   KBUILD_MODNAME, __func__, ret);
return ret;
 }
 
diff --git a/drivers/media/tuners/fc0012.h b/drivers/media/tuners/fc0012.h
index 3fb53b8..54508fc 100644
--- a/drivers/media/tuners/fc0012.h
+++ b/drivers/media/tuners/fc0012.h
@@ -58,7 +58,7 @@ static inline struct dvb_frontend *fc0012_attach(struct 
dvb_frontend *fe,
struct i2c_adapter *i2c,
const struct fc0012_config *cfg)
 {
-   printk(KERN_WARNING %s: driver disabled by Kconfig\n, __func__);
+   pr_warn(%s: driver disabled by Kconfig\n, __func__);
return NULL;
 }
 #endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 10/17] fc0012: rework attach() to check chip id and I/O errors

2012-12-09 Thread Antti Palosaari
Cc: Hans-Frieder Vogt hfv...@gmx.net
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/tuners/fc0012.c | 59 +++
 1 file changed, 49 insertions(+), 10 deletions(-)

diff --git a/drivers/media/tuners/fc0012.c b/drivers/media/tuners/fc0012.c
index 01f5e40..feb1594 100644
--- a/drivers/media/tuners/fc0012.c
+++ b/drivers/media/tuners/fc0012.c
@@ -443,32 +443,71 @@ static const struct dvb_tuner_ops fc0012_tuner_ops = {
 struct dvb_frontend *fc0012_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c, const struct fc0012_config *cfg)
 {
-   struct fc0012_priv *priv = NULL;
+   struct fc0012_priv *priv;
+   int ret;
+   u8 chip_id;
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1);
 
priv = kzalloc(sizeof(struct fc0012_priv), GFP_KERNEL);
-   if (priv == NULL)
-   return NULL;
+   if (!priv) {
+   ret = -ENOMEM;
+   dev_err(i2c-dev, %s: kzalloc() failed\n, KBUILD_MODNAME);
+   goto err;
+   }
 
-   priv-i2c = i2c;
priv-cfg = cfg;
+   priv-i2c = i2c;
 
-   info(Fitipower FC0012 successfully attached.);
+   /* check if the tuner is there */
+   ret = fc0012_readreg(priv, 0x00, chip_id);
+   if (ret  0)
+   goto err;
 
-   fe-tuner_priv = priv;
+   dev_dbg(i2c-dev, %s: chip_id=%02x\n, __func__, chip_id);
 
-   if (priv-cfg-loop_through)
-   fc0012_writereg(priv, 0x09, 0x6f);
+   switch (chip_id) {
+   case 0xa1:
+   break;
+   default:
+   ret = -ENODEV;
+   goto err;
+   }
+
+   dev_info(i2c-dev, %s: Fitipower FC0012 successfully identified\n,
+   KBUILD_MODNAME);
+
+   if (priv-cfg-loop_through) {
+   ret = fc0012_writereg(priv, 0x09, 0x6f);
+   if (ret  0)
+   goto err;
+   }
 
/*
 * TODO: Clock out en or div?
 * For dual tuner configuration clearing bit [0] is required.
 */
-   if (priv-cfg-clock_out)
-   fc0012_writereg(priv, 0x0b, 0x82);
+   if (priv-cfg-clock_out) {
+   ret =  fc0012_writereg(priv, 0x0b, 0x82);
+   if (ret  0)
+   goto err;
+   }
 
+   fe-tuner_priv = priv;
memcpy(fe-ops.tuner_ops, fc0012_tuner_ops,
sizeof(struct dvb_tuner_ops));
 
+err:
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 0);
+
+   if (ret) {
+   dev_dbg(i2c-dev, %s: failed: %d\n, __func__, ret);
+   kfree(priv);
+   return NULL;
+   }
+
return fe;
 }
 EXPORT_SYMBOL(fc0012_attach);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 08/17] af9035: add support for fc0012 dual tuner configuration

2012-12-09 Thread Antti Palosaari
That adds support for AF9035 dual devices having FC0012 tuners.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/af9035.c | 56 +--
 1 file changed, 41 insertions(+), 15 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index 6cf9ad5..1c7fe5a 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -597,6 +597,8 @@ static int af9035_read_config(struct dvb_usb_device *d)
/* disable dual mode if driver does not support it */
if (i == 1)
switch (tmp) {
+   case AF9033_TUNER_FC0012:
+   break;
default:
state-dual_mode = false;
dev_info(d-udev-dev, %s: driver does not  \
@@ -900,10 +902,18 @@ static const struct fc2580_config af9035_fc2580_config = {
.clock = 16384000,
 };
 
-static const struct fc0012_config af9035_fc0012_config = {
-   .i2c_address = 0x63,
-   .xtal_freq = FC_XTAL_36_MHZ,
-   .dual_master = 1,
+static const struct fc0012_config af9035_fc0012_config[] = {
+   {
+   .i2c_address = 0x63,
+   .xtal_freq = FC_XTAL_36_MHZ,
+   .dual_master = 1,
+   .loop_through = true,
+   .clock_out = true,
+   }, {
+   .i2c_address = 0x63 | 0x80, /* I2C bus select hack */
+   .xtal_freq = FC_XTAL_36_MHZ,
+   .dual_master = 1,
+   }
 };
 
 static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
@@ -912,6 +922,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
struct dvb_usb_device *d = adap_to_d(adap);
int ret;
struct dvb_frontend *fe;
+   struct i2c_msg msg[1];
u8 tuner_addr;
/*
 * XXX: Hack used in that function: we abuse unused I2C address bit [7]
@@ -1034,23 +1045,38 @@ static int af9035_tuner_attach(struct dvb_usb_adapter 
*adap)
 * my test I didn't find any difference.
 */
 
-   /* configure gpiot2 as output and high */
-   ret = af9035_wr_reg_mask(d, 0xd8eb, 0x01, 0x01);
-   if (ret  0)
-   goto err;
+   if (adap-id == 0) {
+   /* configure gpiot2 as output and high */
+   ret = af9035_wr_reg_mask(d, 0xd8eb, 0x01, 0x01);
+   if (ret  0)
+   goto err;
 
-   ret = af9035_wr_reg_mask(d, 0xd8ec, 0x01, 0x01);
-   if (ret  0)
-   goto err;
+   ret = af9035_wr_reg_mask(d, 0xd8ec, 0x01, 0x01);
+   if (ret  0)
+   goto err;
 
-   ret = af9035_wr_reg_mask(d, 0xd8ed, 0x01, 0x01);
-   if (ret  0)
-   goto err;
+   ret = af9035_wr_reg_mask(d, 0xd8ed, 0x01, 0x01);
+   if (ret  0)
+   goto err;
+   } else {
+   /*
+* FIXME: That belongs for the FC0012 driver.
+* Write 02 to FC0012 master tuner register 0d directly
+* in order to make slave tuner working.
+*/
+   msg[0].addr = 0x63;
+   msg[0].flags = 0;
+   msg[0].len = 2;
+   msg[0].buf = \x0d\x02;
+   ret = i2c_transfer(d-i2c_adap, msg, 1);
+   if (ret  0)
+   goto err;
+   }
 
usleep_range(1, 5);
 
fe = dvb_attach(fc0012_attach, adap-fe[0], d-i2c_adap,
-   af9035_fc0012_config);
+   af9035_fc0012_config[adap-id]);
break;
default:
fe = NULL;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 01/17] af9033: add support for Fitipower FC0012 tuner

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/dvb-frontends/af9033.c  |  4 +++
 drivers/media/dvb-frontends/af9033.h  |  1 +
 drivers/media/dvb-frontends/af9033_priv.h | 43 +++
 3 files changed, 48 insertions(+)

diff --git a/drivers/media/dvb-frontends/af9033.c 
b/drivers/media/dvb-frontends/af9033.c
index 464ad87..27638a9 100644
--- a/drivers/media/dvb-frontends/af9033.c
+++ b/drivers/media/dvb-frontends/af9033.c
@@ -318,6 +318,10 @@ static int af9033_init(struct dvb_frontend *fe)
len = ARRAY_SIZE(tuner_init_fc2580);
init = tuner_init_fc2580;
break;
+   case AF9033_TUNER_FC0012:
+   len = ARRAY_SIZE(tuner_init_fc0012);
+   init = tuner_init_fc0012;
+   break;
default:
dev_dbg(state-i2c-dev, %s: unsupported tuner ID=%d\n,
__func__, state-cfg.tuner);
diff --git a/drivers/media/dvb-frontends/af9033.h 
b/drivers/media/dvb-frontends/af9033.h
index bfa4313..82bd8c1 100644
--- a/drivers/media/dvb-frontends/af9033.h
+++ b/drivers/media/dvb-frontends/af9033.h
@@ -40,6 +40,7 @@ struct af9033_config {
 */
 #define AF9033_TUNER_TUA9001 0x27 /* Infineon TUA 9001 */
 #define AF9033_TUNER_FC0011  0x28 /* Fitipower FC0011 */
+#define AF9033_TUNER_FC0012  0x2e /* Fitipower FC0012 */
 #define AF9033_TUNER_MXL5007T0xa0 /* MaxLinear MxL5007T */
 #define AF9033_TUNER_TDA182180xa1 /* NXP TDA 18218HN */
 #define AF9033_TUNER_FC2580  0x32 /* FCI FC2580 */
diff --git a/drivers/media/dvb-frontends/af9033_priv.h 
b/drivers/media/dvb-frontends/af9033_priv.h
index 34dddcd..288cd45 100644
--- a/drivers/media/dvb-frontends/af9033_priv.h
+++ b/drivers/media/dvb-frontends/af9033_priv.h
@@ -397,6 +397,49 @@ static const struct reg_val tuner_init_fc0011[] = {
{ 0x80F1E6, 0x00 },
 };
 
+/* Fitipower FC0012 tuner init
+   AF9033_TUNER_FC0012= 0x2e */
+static const struct reg_val tuner_init_fc0012[] = {
+   { 0x800046, 0x2e },
+   { 0x800057, 0x00 },
+   { 0x800058, 0x01 },
+   { 0x800059, 0x01 },
+   { 0x80005f, 0x00 },
+   { 0x800060, 0x00 },
+   { 0x80006d, 0x00 },
+   { 0x800071, 0x05 },
+   { 0x800072, 0x02 },
+   { 0x800074, 0x01 },
+   { 0x800075, 0x03 },
+   { 0x800076, 0x02 },
+   { 0x800077, 0x01 },
+   { 0x800078, 0x00 },
+   { 0x800079, 0x00 },
+   { 0x80007a, 0x90 },
+   { 0x80007b, 0x90 },
+   { 0x800093, 0x00 },
+   { 0x800094, 0x01 },
+   { 0x800095, 0x02 },
+   { 0x800096, 0x01 },
+   { 0x800098, 0x0a },
+   { 0x80009b, 0x05 },
+   { 0x80009c, 0x80 },
+   { 0x8000b3, 0x00 },
+   { 0x8000c5, 0x01 },
+   { 0x8000c6, 0x00 },
+   { 0x8000c9, 0x5d },
+   { 0x80f007, 0x00 },
+   { 0x80f01f, 0xa0 },
+   { 0x80f020, 0x00 },
+   { 0x80f029, 0x82 },
+   { 0x80f02a, 0x00 },
+   { 0x80f047, 0x00 },
+   { 0x80f054, 0x00 },
+   { 0x80f055, 0x00 },
+   { 0x80f077, 0x01 },
+   { 0x80f1e6, 0x00 },
+};
+
 /* MaxLinear MxL5007T tuner init
AF9033_TUNER_MXL5007T= 0xa0 */
 static const struct reg_val tuner_init_mxl5007t[] = {
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 02/17] af9035: support for Fitipower FC0012 tuner devices

2012-12-09 Thread Antti Palosaari
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/af9035.c | 26 ++
 drivers/media/usb/dvb-usb-v2/af9035.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index 61ae7f9..c1ec18c 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -514,6 +514,7 @@ static int af9035_read_config(struct dvb_usb_device *d)
case AF9033_TUNER_MXL5007T:
case AF9033_TUNER_TDA18218:
case AF9033_TUNER_FC2580:
+   case AF9033_TUNER_FC0012:
state-af9033_config[i].spec_inv = 1;
break;
default:
@@ -907,6 +908,31 @@ static int af9035_tuner_attach(struct dvb_usb_adapter 
*adap)
fe = dvb_attach(fc2580_attach, adap-fe[0],
d-i2c_adap, af9035_fc2580_config);
break;
+   case AF9033_TUNER_FC0012:
+   /*
+* AF9035 gpiot2 = FC0012 enable
+* XXX: there seems to be something on gpioh8 too, but on my
+* my test I didn't find any difference.
+*/
+
+   /* configure gpiot2 as output and high */
+   ret = af9035_wr_reg_mask(d, 0xd8eb, 0x01, 0x01);
+   if (ret  0)
+   goto err;
+
+   ret = af9035_wr_reg_mask(d, 0xd8ec, 0x01, 0x01);
+   if (ret  0)
+   goto err;
+
+   ret = af9035_wr_reg_mask(d, 0xd8ed, 0x01, 0x01);
+   if (ret  0)
+   goto err;
+
+   usleep_range(1, 5);
+
+   fe = dvb_attach(fc0012_attach, adap-fe[0], d-i2c_adap, 0x63,
+   1, FC_XTAL_36_MHZ);
+   break;
default:
fe = NULL;
}
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.h 
b/drivers/media/usb/dvb-usb-v2/af9035.h
index 75ef1ec..f509d35 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.h
+++ b/drivers/media/usb/dvb-usb-v2/af9035.h
@@ -26,6 +26,7 @@
 #include af9033.h
 #include tua9001.h
 #include fc0011.h
+#include fc0012.h
 #include mxl5007t.h
 #include tda18218.h
 #include fc2580.h
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: ERRORS

2012-12-09 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:Sun Dec  9 19:00:20 CET 2012
git hash:16427faf28674451a7a0485ab0a929402f355ffd
gcc version:  i686-linux-gcc (GCC) 4.7.1
host hardware:x86_64
host os:  3.4.07-marune

linux-git-arm-eabi-davinci: WARNINGS
linux-git-arm-eabi-exynos: OK
linux-git-arm-eabi-omap: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: OK
linux-git-mips: WARNINGS
linux-git-powerpc64: OK
linux-git-sh: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.36-i686: WARNINGS
linux-2.6.37-i686: WARNINGS
linux-2.6.38.2-i686: WARNINGS
linux-2.6.39.1-i686: WARNINGS
linux-3.0-i686: WARNINGS
linux-3.1-i686: WARNINGS
linux-3.2.1-i686: WARNINGS
linux-3.3-i686: WARNINGS
linux-3.4-i686: ERRORS
linux-3.5-i686: ERRORS
linux-3.6-i686: WARNINGS
linux-3.7-rc1-i686: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
linux-2.6.36-x86_64: WARNINGS
linux-2.6.37-x86_64: WARNINGS
linux-2.6.38.2-x86_64: WARNINGS
linux-2.6.39.1-x86_64: WARNINGS
linux-3.0-x86_64: WARNINGS
linux-3.1-x86_64: WARNINGS
linux-3.2.1-x86_64: WARNINGS
linux-3.3-x86_64: WARNINGS
linux-3.4-x86_64: ERRORS
linux-3.5-x86_64: ERRORS
linux-3.6-x86_64: WARNINGS
linux-3.7-rc1-x86_64: WARNINGS
apps: WARNINGS
spec-git: WARNINGS
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Sunday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] gspca_kinect: add Kinect for Windows USB id

2012-12-09 Thread Antonio Ospite
From: Jacob Schloss jacob.schl...@unlimitedautomata.com

Add the USB ID for the Kinect for Windows RGB camera so it can be used
with the gspca_kinect driver.

Signed-off-by: Jacob Schloss jacob.schl...@unlimitedautomata.com
Signed-off-by: Antonio Ospite osp...@studenti.unina.it
---

Thanks Jacob, I took the liberty to rebase the patch on top of
linux-3.7.0-rc7 as the gspca location has changed from
drivers/media/video/gspca to drivers/media/usb/gspca

It will be a little easier for HdG to apply it.

Regards,
   Antonio

 drivers/media/usb/gspca/kinect.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/gspca/kinect.c b/drivers/media/usb/gspca/kinect.c
index 40ad668..3773a8a 100644
--- a/drivers/media/usb/gspca/kinect.c
+++ b/drivers/media/usb/gspca/kinect.c
@@ -381,6 +381,7 @@ static const struct sd_desc sd_desc = {
 /* -- module initialisation -- */
 static const struct usb_device_id device_table[] = {
{USB_DEVICE(0x045e, 0x02ae)},
+   {USB_DEVICE(0x045e, 0x02bf)},
{}
 };
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 05/11] af9035: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/af9035.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c 
b/drivers/media/usb/dvb-usb-v2/af9035.c
index ea37b5c..19b1394 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -1146,6 +1146,7 @@ err:
return ret;
 }
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 static int af9035_rc_query(struct dvb_usb_device *d)
 {
unsigned int key;
@@ -1220,6 +1221,9 @@ err:
 
return ret;
 }
+#else
+   #define af9035_get_rc_config NULL
+#endif
 
 /* interface 0 is used by DVB-T receiver and
interface 1 is for remote controller (HID) */
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 02/11] rtl28xxu: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 
b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index eddda69..9a68903 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1125,7 +1125,7 @@ err:
return ret;
 }
 
-
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 static int rtl2831u_rc_query(struct dvb_usb_device *d)
 {
int ret, i;
@@ -1208,7 +1208,11 @@ static int rtl2831u_get_rc_config(struct dvb_usb_device 
*d,
 
return 0;
 }
+#else
+   #define rtl2831u_get_rc_config NULL
+#endif
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 static int rtl2832u_rc_query(struct dvb_usb_device *d)
 {
int ret, i;
@@ -1280,6 +1284,9 @@ static int rtl2832u_get_rc_config(struct dvb_usb_device 
*d,
 
return 0;
 }
+#else
+   #define rtl2832u_get_rc_config NULL
+#endif
 
 static const struct dvb_usb_device_properties rtl2831u_props = {
.driver_name = KBUILD_MODNAME,
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 04/11] af9015: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/af9015.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/af9015.c 
b/drivers/media/usb/dvb-usb-v2/af9015.c
index 943d934..51505d1 100644
--- a/drivers/media/usb/dvb-usb-v2/af9015.c
+++ b/drivers/media/usb/dvb-usb-v2/af9015.c
@@ -1156,6 +1156,7 @@ error:
return ret;
 }
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 struct af9015_rc_setup {
unsigned int id;
char *rc_codes;
@@ -1312,6 +1313,9 @@ static int af9015_get_rc_config(struct dvb_usb_device *d, 
struct dvb_usb_rc *rc)
 
return 0;
 }
+#else
+   #define af9015_get_rc_config NULL
+#endif
 
 /* interface 0 is used by DVB-T receiver and
interface 1 is for remote controller (HID) */
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 03/11] anysee: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/anysee.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/usb/dvb-usb-v2/anysee.c 
b/drivers/media/usb/dvb-usb-v2/anysee.c
index d05c5b5..5f45037 100644
--- a/drivers/media/usb/dvb-usb-v2/anysee.c
+++ b/drivers/media/usb/dvb-usb-v2/anysee.c
@@ -1019,6 +1019,7 @@ static int anysee_tuner_attach(struct dvb_usb_adapter 
*adap)
return ret;
 }
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 static int anysee_rc_query(struct dvb_usb_device *d)
 {
u8 buf[] = {CMD_GET_IR_CODE};
@@ -1054,6 +1055,9 @@ static int anysee_get_rc_config(struct dvb_usb_device *d, 
struct dvb_usb_rc *rc)
 
return 0;
 }
+#else
+   #define anysee_get_rc_config NULL
+#endif
 
 static int anysee_ci_read_attribute_mem(struct dvb_ca_en50221 *ci, int slot,
int addr)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 01/11] dvb_usb_v2: make remote controller optional

2012-12-09 Thread Antti Palosaari
Make it possible to compile dvb_usb_v2 driver without the remote
controller (RC-core).

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/Kconfig|  3 ++-
 drivers/media/usb/dvb-usb-v2/dvb_usb.h  |  9 +
 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 12 
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/dvb-usb-v2/Kconfig 
b/drivers/media/usb/dvb-usb-v2/Kconfig
index 834bfec..60f4240 100644
--- a/drivers/media/usb/dvb-usb-v2/Kconfig
+++ b/drivers/media/usb/dvb-usb-v2/Kconfig
@@ -1,6 +1,6 @@
 config DVB_USB_V2
tristate Support for various USB DVB devices v2
-   depends on DVB_CORE  USB  I2C  RC_CORE
+   depends on DVB_CORE  USB  I2C
help
  By enabling this you will be able to choose the various supported
  USB1.1 and USB2.0 DVB devices.
@@ -113,6 +113,7 @@ config DVB_USB_IT913X
 config DVB_USB_LME2510
tristate LME DM04/QQBOX DVB-S USB2.0 support
depends on DVB_USB_V2
+   depends on RC_CORE
select DVB_TDA10086 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TDA826X if MEDIA_SUBDRV_AUTOSELECT
select DVB_STV0288 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb.h 
b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
index 059291b..e2678a7 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb.h
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
@@ -400,4 +400,13 @@ extern int dvb_usbv2_reset_resume(struct usb_interface *);
 extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16);
 extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16);
 
+/* stub implementations that will be never called when RC-core is disabled */
+#if !defined(CONFIG_RC_CORE)  !defined(CONFIG_RC_CORE_MODULE)
+#define rc_repeat(args...)
+#define rc_keydown(args...)
+#define rc_keydown_notimeout(args...)
+#define rc_keyup(args...)
+#define rc_g_keycode_from_table(args...) 0
+#endif
+
 #endif
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 671b4fa..94f134c 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -102,6 +102,7 @@ static int dvb_usbv2_i2c_exit(struct dvb_usb_device *d)
return 0;
 }
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 static void dvb_usb_read_remote_control(struct work_struct *work)
 {
struct dvb_usb_device *d = container_of(work,
@@ -202,6 +203,17 @@ static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
 
return 0;
 }
+#else
+static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
+{
+   return 0;
+}
+
+static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
+{
+   return 0;
+}
+#endif
 
 static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buf,
size_t len)
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 10/11] dvb_usb_v2: use dummy function defines instead stub functions

2012-12-09 Thread Antti Palosaari
I think it is better (cheaper) to use dummy defines for functions
that has no meaning when remote controller is disabled by Kconfig.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 94f134c..1330c64 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -204,15 +204,8 @@ static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
return 0;
 }
 #else
-static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
-{
-   return 0;
-}
-
-static int dvb_usbv2_remote_exit(struct dvb_usb_device *d)
-{
-   return 0;
-}
+   #define dvb_usbv2_remote_init(args...) 0
+   #define dvb_usbv2_remote_exit(args...)
 #endif
 
 static void dvb_usb_data_complete(struct usb_data_stream *stream, u8 *buf,
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 09/11] dvb_usb_v2: remove rc-core stub implementations

2012-12-09 Thread Antti Palosaari
Those are not needed anymore as all dvb-usb-v2 drivers has proper
dependency checks for RC-core.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/dvb_usb.h | 9 -
 1 file changed, 9 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb.h 
b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
index e2678a7..059291b 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb.h
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
@@ -400,13 +400,4 @@ extern int dvb_usbv2_reset_resume(struct usb_interface *);
 extern int dvb_usbv2_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16);
 extern int dvb_usbv2_generic_write(struct dvb_usb_device *, u8 *, u16);
 
-/* stub implementations that will be never called when RC-core is disabled */
-#if !defined(CONFIG_RC_CORE)  !defined(CONFIG_RC_CORE_MODULE)
-#define rc_repeat(args...)
-#define rc_keydown(args...)
-#define rc_keydown_notimeout(args...)
-#define rc_keyup(args...)
-#define rc_g_keycode_from_table(args...) 0
-#endif
-
 #endif
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 06/11] az6007: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Cc: Mauro Carvalho Chehab mche...@redhat.com
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/az6007.c | 26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/az6007.c 
b/drivers/media/usb/dvb-usb-v2/az6007.c
index d75dbf2..3b33f1e 100644
--- a/drivers/media/usb/dvb-usb-v2/az6007.c
+++ b/drivers/media/usb/dvb-usb-v2/az6007.c
@@ -189,6 +189,7 @@ static int az6007_streaming_ctrl(struct dvb_frontend *fe, 
int onoff)
return az6007_write(d, 0xbc, onoff, 0, NULL, 0);
 }
 
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 /* remote control stuff (does not work with my box) */
 static int az6007_rc_query(struct dvb_usb_device *d)
 {
@@ -215,6 +216,20 @@ static int az6007_rc_query(struct dvb_usb_device *d)
return 0;
 }
 
+static int az6007_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc 
*rc)
+{
+   pr_debug(Getting az6007 Remote Control properties\n);
+
+   rc-allowed_protos = RC_BIT_NEC;
+   rc-query  = az6007_rc_query;
+   rc-interval   = 400;
+
+   return 0;
+}
+#else
+   #define az6007_get_rc_config NULL
+#endif
+
 static int az6007_ci_read_attribute_mem(struct dvb_ca_en50221 *ca,
int slot,
int address)
@@ -822,17 +837,6 @@ static void az6007_usb_disconnect(struct usb_interface 
*intf)
dvb_usbv2_disconnect(intf);
 }
 
-static int az6007_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc 
*rc)
-{
-   pr_debug(Getting az6007 Remote Control properties\n);
-
-   rc-allowed_protos = RC_BIT_NEC;
-   rc-query  = az6007_rc_query;
-   rc-interval   = 400;
-
-   return 0;
-}
-
 static int az6007_download_firmware(struct dvb_usb_device *d,
const struct firmware *fw)
 {
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 07/11] it913x: make remote controller optional

2012-12-09 Thread Antti Palosaari
Do not compile remote controller when RC-core is disabled by Kconfig.

Cc: Malcolm Priestley tvbox...@gmail.com
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/it913x.c | 36 +++
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/it913x.c 
b/drivers/media/usb/dvb-usb-v2/it913x.c
index 4720428..5dc352b 100644
--- a/drivers/media/usb/dvb-usb-v2/it913x.c
+++ b/drivers/media/usb/dvb-usb-v2/it913x.c
@@ -308,6 +308,7 @@ static struct i2c_algorithm it913x_i2c_algo = {
 };
 
 /* Callbacks for DVB USB */
+#if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
 #define IT913X_POLL 250
 static int it913x_rc_query(struct dvb_usb_device *d)
 {
@@ -334,6 +335,25 @@ static int it913x_rc_query(struct dvb_usb_device *d)
return ret;
 }
 
+static int it913x_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc 
*rc)
+{
+   struct it913x_state *st = d-priv;
+
+   if (st-proprietary_ir == false) {
+   rc-map_name = NULL;
+   return 0;
+   }
+
+   rc-allowed_protos = RC_BIT_NEC;
+   rc-query = it913x_rc_query;
+   rc-interval = 250;
+
+   return 0;
+}
+#else
+   #define it913x_get_rc_config NULL
+#endif
+
 /* Firmware sets raw */
 static const char fw_it9135_v1[] = FW_IT9135_V1;
 static const char fw_it9135_v2[] = FW_IT9135_V2;
@@ -695,22 +715,6 @@ static int it913x_frontend_attach(struct dvb_usb_adapter 
*adap)
 }
 
 /* DVB USB Driver */
-static int it913x_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc 
*rc)
-{
-   struct it913x_state *st = d-priv;
-
-   if (st-proprietary_ir == false) {
-   rc-map_name = NULL;
-   return 0;
-   }
-
-   rc-allowed_protos = RC_BIT_NEC;
-   rc-query = it913x_rc_query;
-   rc-interval = 250;
-
-   return 0;
-}
-
 static int it913x_get_adapter_count(struct dvb_usb_device *d)
 {
struct it913x_state *st = d-priv;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 11/11] dvb_usb_v2: change rc polling active/deactive logic

2012-12-09 Thread Antti Palosaari
Use own flag to mark when rc polling is active/deactive and make
decisions, like start/stop polling on suspend/resume, against that.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/dvb_usb.h  |  3 ++-
 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 10 +++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb.h 
b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
index 059291b..3cac8bd 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb.h
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb.h
@@ -347,6 +347,7 @@ struct dvb_usb_adapter {
  * @props: device properties
  * @name: device name
  * @rc_map: name of rc codes table
+ * @rc_polling_active: set when RC polling is active
  * @udev: pointer to the device's struct usb_device
  * @intf: pointer to the device's usb interface
  * @rc: remote controller configuration
@@ -364,7 +365,7 @@ struct dvb_usb_device {
const struct dvb_usb_device_properties *props;
const char *name;
const char *rc_map;
-
+   bool rc_polling_active;
struct usb_device *udev;
struct usb_interface *intf;
struct dvb_usb_rc rc;
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c 
b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 1330c64..95968d3 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -113,13 +113,16 @@ static void dvb_usb_read_remote_control(struct 
work_struct *work)
 * When the parameter has been set to 1 via sysfs while the
 * driver was running, or when bulk mode is enabled after IR init.
 */
-   if (dvb_usbv2_disable_rc_polling || d-rc.bulk_mode)
+   if (dvb_usbv2_disable_rc_polling || d-rc.bulk_mode) {
+   d-rc_polling_active = false;
return;
+   }
 
ret = d-rc.query(d);
if (ret  0) {
dev_err(d-udev-dev, %s: rc.query() failed=%d\n,
KBUILD_MODNAME, ret);
+   d-rc_polling_active = false;
return; /* stop polling */
}
 
@@ -183,6 +186,7 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
d-rc.interval);
schedule_delayed_work(d-rc_query_work,
msecs_to_jiffies(d-rc.interval));
+   d-rc_polling_active = true;
}
 
return 0;
@@ -964,7 +968,7 @@ int dvb_usbv2_suspend(struct usb_interface *intf, 
pm_message_t msg)
dev_dbg(d-udev-dev, %s:\n, __func__);
 
/* stop remote controller poll */
-   if (d-rc.query  !d-rc.bulk_mode)
+   if (d-rc_polling_active)
cancel_delayed_work_sync(d-rc_query_work);
 
for (i = MAX_NO_OF_ADAPTER_PER_DEVICE - 1; i = 0; i--) {
@@ -1011,7 +1015,7 @@ static int dvb_usbv2_resume_common(struct dvb_usb_device 
*d)
}
 
/* start remote controller poll */
-   if (d-rc.query  !d-rc.bulk_mode)
+   if (d-rc_polling_active)
schedule_delayed_work(d-rc_query_work,
msecs_to_jiffies(d-rc.interval));
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH RFC 08/11] it913x: remove unused define and increase module version

2012-12-09 Thread Antti Palosaari
Cc: Malcolm Priestley tvbox...@gmail.com
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/dvb-usb-v2/it913x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/it913x.c 
b/drivers/media/usb/dvb-usb-v2/it913x.c
index 5dc352b..3d20e38 100644
--- a/drivers/media/usb/dvb-usb-v2/it913x.c
+++ b/drivers/media/usb/dvb-usb-v2/it913x.c
@@ -309,7 +309,6 @@ static struct i2c_algorithm it913x_i2c_algo = {
 
 /* Callbacks for DVB USB */
 #if defined(CONFIG_RC_CORE) || defined(CONFIG_RC_CORE_MODULE)
-#define IT913X_POLL 250
 static int it913x_rc_query(struct dvb_usb_device *d)
 {
u8 ibuf[4];
@@ -801,7 +800,7 @@ module_usb_driver(it913x_driver);
 
 MODULE_AUTHOR(Malcolm Priestley tvbox...@gmail.com);
 MODULE_DESCRIPTION(it913x USB 2 Driver);
-MODULE_VERSION(1.32);
+MODULE_VERSION(1.33);
 MODULE_LICENSE(GPL);
 MODULE_FIRMWARE(FW_IT9135_V1);
 MODULE_FIRMWARE(FW_IT9135_V2);
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html