PROBLEM: siano "transfer buffer not dma capable" when trying to capture video in 4.9.0

2016-12-17 Thread Piotr Chmura

siano "transfer buffer not dma capable" when trying to capture video

On kernel 4.9.0 when trying to watch TV (in Kaffeine 1.0.5, libVLC) i 
get Oops instead of audio/video stream.

Kernel 4.8.X series works fine (currently using 4.8.13).

[   60.268359] [ cut here ]
[   60.268366] WARNING: CPU: 1 PID: 3558 at drivers/usb/core/hcd.c:1584 
usb_hcd_map_urb_for_dma+0x249/0x2f9

[   60.268366] transfer buffer not dma capable
[   60.268367] Modules linked in: nfsv3 nfs_acl auth_rpcgss oid_registry 
nfsv4 dns_resolver nfs lockd grace fscache sunrpc snd_usb_audio 
snd_usbmidi_lib snd_rawmidi gspca_zc3xx gspca_main v4l2_common videodev 
cdc_acm joydev btusb btrtl btbcm btintel bluetooth smsdvb dvb_core 
smsusb smsmdtv media usb_storage nvidia_modeset(PO) nvidia(PO) 
x86_pkg_temp_thermal drm xhci_pci xhci_hcd ehci_pci ehci_hcd 8250 
8250_base serial_core
[   60.268389] CPU: 1 PID: 3558 Comm: kdvb-ad-1-fe-0 Tainted: 
P   O4.9.0 #1
[   60.268390] Hardware name: Gigabyte Technology Co., Ltd. To be filled 
by O.E.M./Z77N-WIFI, BIOS F4a 07/29/2013
[   60.268391]   811e7617 c90008a83830 

[   60.268393]  8103a5a7 8803dca48780 c90008a83888 
0001
[   60.268395]   88040bed4780 c90008a83a58 
8103a606

[   60.268397] Call Trace:
[   60.268401]  [] ? dump_stack+0x46/0x59
[   60.268404]  [] ? __warn+0xc8/0xe1
[   60.268406]  [] ? warn_slowpath_fmt+0x46/0x4e
[   60.268408]  [] ? usb_hcd_map_urb_for_dma+0x249/0x2f9
[   60.268409]  [] ? usb_hcd_submit_urb+0x627/0x6f0
[   60.268412]  [] ? usb_start_wait_urb+0x54/0xc5
[   60.268415]  [] ? smsusb_sendrequest+0x4c/0x58 [smsusb]
[   60.268417]  [] ? 
smsdvb_sendrequest_and_wait.isra.4+0x9/0x29 [smsdvb]
[   60.268419]  [] ? smsdvb_set_frontend+0x2b9/0x2c9 
[smsdvb]
[   60.268422]  [] ? 
dvb_frontend_swzigzag_autotune+0x160/0x1b2 [dvb_core]
[   60.268426]  [] ? dvb_frontend_swzigzag+0x1ef/0x25a 
[dvb_core]

[   60.268428]  [] ? update_load_avg+0x25a/0x293
[   60.268429]  [] ? update_load_avg+0x25a/0x293
[   60.268431]  [] ? 
get_sd_balance_interval.isra.55+0x13/0x2e

[   60.268433]  [] ? update_next_balance+0x15/0x26
[   60.268435]  [] ? vtime_account_idle+0x5/0xd
[   60.268437]  [] ? vtime_common_task_switch+0x12/0x1f
[   60.268438]  [] ? finish_task_switch+0x130/0x19e
[   60.268440]  [] ? lock_timer_base+0x33/0x57
[   60.268442]  [] ? try_to_del_timer_sync+0x3f/0x49
[   60.268443]  [] ? del_timer_sync+0x20/0x3d
[   60.268446]  [] ? schedule_timeout+0xad/0xd0
[   60.268447]  [] ? del_timer_sync+0x3d/0x3d
[   60.268449]  [] ? dvb_frontend_thread+0x3fd/0x4bd 
[dvb_core]

[   60.268452]  [] ? wake_up_atomic_t+0x21/0x21
[   60.268454]  [] ? dtv_set_frontend+0x325/0x325 
[dvb_core]

[   60.268456]  [] ? kthread+0x96/0x9e
[   60.268457]  [] ? init_completion+0x1d/0x1d
[   60.268460]  [] ? ret_from_fork+0x22/0x30
[   60.268472] ---[ end trace f08e58646fa0507a ]---


System info:
$ ./ver_linux
Linux darkstar 4.9.0 #1 SMP PREEMPT Sat Dec 17 17:45:05 CET 2016 x86_64 
Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz GenuineIntel GNU/Linux


GNU C   5.4.0
GNU Make4.1
Binutils2.27
Util-linux  2.29
Mount   2.29
Linux C Library 2.23
Dynamic linker (ldd)2.23
Procps  3.3.12
Net-tools   1.60
Kbd 2.0.3
Console-tools   2.0.3
Sh-utils8.25
Udev232
Modules Loaded  8250 8250_base auth_rpcgss bluetooth btbcm 
btintel btrtl btusb cdc_acm dns_resolver drm dvb_core ehci_hcd ehci_pci 
fscache grace gspca_main gspca_zc3xx joydev lockd media nfs nfs_acl 
nfsv3 nfsv4 nvidia nvidia_modeset oid_registry serial_core smsdvb 
smsmdtv smsusb snd_rawmidi snd_usb_audio snd_usbmidi_lib sunrpc 
usb_storage v4l2_common videodev x86_pkg_temp_thermal xhci_hcd xhci_pci



--
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: [PATCH] dvb/as102 nBox DVB-T dongle

2011-10-14 Thread Piotr Chmura

Hi,

There's  licencing problem with as10x_cmd_cfg.c and as10x_cmd_stream.c 
files which are not GPL ( (c) Copyright Abilis Systems SARL 2005-2009 
All rigths reserved \n

   www.abilis.com).

Dunno if it's only Davin's Heitmueller oversight in changing licencing 
or a real problem.

What about it Davin ?


Peter


W dniu 14.10.2011 09:27, Hans Petter Selasky pisze:

Hi,

Could someone pull the AS102 driver into the media tree?

http://git.linuxtv.org/media_tree.git/tree/HEAD:/drivers/media/dvb

--HPS


On Wednesday 20 July 2011 22:29:41 Piotr Chmura wrote:

I just bought DVB-T USB dongle for one of polish digital platform. It
works fine with as102 driver.
Here is patch adding vendor and product ID to as102 driver taken from
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102.
I tested it with kernel-3.0-rc7-git7 (had to change usb_buffer_alloc()
to usb_alloc_coherent and usb_buffer_free to usb_free_coherent() ).

patch:

diff -Nur linux/drivers/media/dvb/as102/as102_usb_drv.c
linux-mine/drivers/media/dvb/as102/as102_usb_drv.c
--- as102/as102_usb_drv.c2011-07-20 21:37:33.924143297 +0200
+++ /usr/src/linux/drivers/media/dvb/as102/as102_usb_drv.c2011-07-20
20:40:21.0 +0200
@@ -39,6 +39,7 @@
   static struct usb_device_id as102_usb_id_table[] = {
   { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001)
}, { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
+{ USB_DEVICE(NBOX_USB_VID, NBOX_USB_PID) },
   { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
   { } /* Terminating entry */
   };
@@ -48,6 +49,7 @@
   static const char *as102_device_names[] = {
   AS102_REFERENCE_DESIGN,
   AS102_PCTV_74E,
+AS102_NBOX,
   AS102_ELGATO_EYETV_DTT_NAME,
   NULL /* Terminating entry */
   };
diff -Nur linux/drivers/media/dvb/as102/as102_usb_drv.h
linux-mine/drivers/media/dvb/as102/as102_usb_drv.h
--- as102/as102_usb_drv.h2011-07-20 21:37:33.925143297 +0200
+++ /usr/src/linux/drivers/media/dvb/as102/as102_usb_drv.h2011-07-20
20:39:46.0 +0200
@@ -36,6 +36,11 @@
   #define PCTV_74E_USB_VID0x2013
   #define PCTV_74E_USB_PID0x0246

+/* nBox DVB-T Stick */
+#define AS102_NBOX"nBox DVB-T Stick"
+#define NBOX_USB_VID0x0b89
+#define NBOX_USB_PID0x0007
+
   /* Elgato: EyeTV DTT Deluxe */
   #define AS102_ELGATO_EYETV_DTT_NAME"Elgato EyeTV DTT Deluxe"
   #define ELGATO_EYETV_DTT_USB_VID0x0fd9


--
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

--
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 0/7] Staging submission: PCTV 74e drivers and some cleanup (was: Staging submission: PCTV 80e and PCTV 74e drivers)

2011-10-15 Thread Piotr Chmura

[PATCH 1/7] pull as102 driver 
fromhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
with the only change needed to compile it in git tree[1]: usb_buffer_alloc()
to usb_alloc_coherent() and usb_buffer_free() to usb_free_coherent()

[PATCH 2/7] as102: add new device nBox DVB-T Dongle
adds new device working on this driver


Next patches i made basing on Mauro Carvalho Chehab comments from previous pull 
try [2].

[PATCH 3/7] as102: cleanup - get rid off typedefs
[PATCH 4/7] as102: cleanup - formatting code
[PATCH 5/7] as102: cleanup - set __attribute__(packed) instead of pragma(pack)
[PATCH 6/7] as102: cleanup - delete vim comments
[PATCH 7/7] as102: cleanup - get rid of unnecessary defines (WIN32, LINUX)


[1] git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
kernel-3.1.0-git9+
[2] http://www.spinics.net/lists/linux-media/msg16723.html



W dniu 27.09.2011 21:33, Stefan Richter pisze:

On Sep 27 Greg KH wrote:

On Tue, Sep 27, 2011 at 09:44:09AM +0200, Stefan Richter wrote:

Adding Cc: staging maintainer and mailinglist.

On Sep 26 Devin Heitmueller wrote:

On Sun, Sep 25, 2011 at 11:25 PM, Mauro Carvalho Chehab
  wrote:

In summary, if you don't have a couple hours to make your driver to
match Kernel Coding Style, just send it as is to /drivers/staging, c/c
me and Greg KH, and that's it.

PULLhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-80e/
PULLhttp://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

I can't do that as I need some commit messages in a format we can accept
(i.e. your directory structure doesn't match what we need in the kernel
tree from what I can tell.)

[...]

As the drivers don't seem to be touched in way over a year, odds are the
code isn't going to be able to build as-is, so it will require some
changes for basic issues.

And I'll glady accept patches for the staging tree.  Also note that
we've just created a drivers/staging/media/ tree to house lots of
different v4l drivers that are being worked on in the staging tree to
help coordinate this type of work better.

The conversion into patches with proper changelog, fitting directory
structure, and basic build-ability in current staging is exactly
the first step for which a volunteer is sought (next would then be the
cleanup associated with staging->mainline transition); Devin noted that he
is not going to dedicate time for these types of tasks.  (I for one also
won't; still got plenty to do in some other drivers...)

--
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 2/7] staging/as102: add new device nBox DVB-T Dongle

2011-10-15 Thread Piotr Chmura

staging/as102: add new device nBox DVB-T Dongle

Add nBox DVB-T Dongle tuner based on 74e chip.

Tested by me on amd64.

Signed-off-by: Piotr Chmura
Cc: Devin Heitmueller
Cc: Greg HK

diff -Nur linux.as102.01-initial/drivers/staging/as102/as102_usb_drv.c 
linux.as102.02-nbox/drivers/staging/as102/as102_usb_drv.c
--- linux.as102.01-initial/drivers/staging/as102/as102_usb_drv.c
2011-10-14 18:00:19.0 +0200
+++ linux.as102.02-nbox/drivers/staging/as102/as102_usb_drv.c   2011-10-14 
18:21:36.0 +0200
@@ -41,6 +41,7 @@
{ USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
{ USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
{ USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
+   { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) },
{ } /* Terminating entry */
 };

@@ -50,6 +51,7 @@
AS102_REFERENCE_DESIGN,
AS102_PCTV_74E,
AS102_ELGATO_EYETV_DTT_NAME,
+   AS102_NBOX_DVBT_DONGLE_NAME,
NULL /* Terminating entry */
 };

diff -Nur linux.as102.01-initial/drivers/staging/as102/as102_usb_drv.h 
linux.as102.02-nbox/drivers/staging/as102/as102_usb_drv.h
--- linux.as102.01-initial/drivers/staging/as102/as102_usb_drv.h
2011-10-14 17:55:02.0 +0200
+++ linux.as102.02-nbox/drivers/staging/as102/as102_usb_drv.h   2011-10-14 
18:20:32.0 +0200
@@ -42,6 +42,11 @@
 #define ELGATO_EYETV_DTT_USB_VID   0x0fd9
 #define ELGATO_EYETV_DTT_USB_PID   0x002c

+/* nBox: nBox DVB-T Dongle */
+#define AS102_NBOX_DVBT_DONGLE_NAME"nBox DVB-T Dongle"
+#define NBOX_DVBT_DONGLE_USB_VID   0x0b89
+#define NBOX_DVBT_DONGLE_USB_PID   0x0007
+
 #if (LINUX_VERSION_CODE<= KERNEL_VERSION(2, 6, 18))
 void as102_urb_stream_irq(struct urb *urb, struct pt_regs *regs);
 #else




--
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 3/7] staging/as102: cleanup - get rid of typedefs

2011-10-15 Thread Piotr Chmura

staging as102: cleanup - get rid off typedefs

Cleanup code: get rid of typedef in structures and union definitions.

Signed-off-by: Piotr Chmura
Cc: Devin Heitmueller
Cc: Greg HK

diff -Nur linux.as102.02-nbox/drivers/staging/as102/as10x_cmd.h 
linux.as102.03-typedefs/drivers/staging/as102/as10x_cmd.h
--- linux.as102.02-nbox/drivers/staging/as102/as10x_cmd.h   2011-10-14 
17:55:02.0 +0200
+++ linux.as102.03-typedefs/drivers/staging/as102/as10x_cmd.h   2011-10-14 
18:48:39.0 +0200
@@ -52,7 +52,7 @@
 /*/
 /* TYPE DEFINITION   */
 /*/
-typedef enum {
+enum control_proc {
CONTROL_PROC_TURNON   = 0x0001,
CONTROL_PROC_TURNON_RSP   = 0x0100,
CONTROL_PROC_SET_REGISTER = 0x0002,
@@ -92,11 +92,11 @@
CONTROL_PROC_DUMPLOG_MEMORY_RSP   = 0xFE00,
CONTROL_PROC_TURNOFF  = 0x00FF,
CONTROL_PROC_TURNOFF_RSP  = 0xFF00
-} control_proc;
+};


 #pragma pack(1)
-typedef union {
+union TURN_ON {
/* request */
struct {
   /* request identifier */
@@ -109,9 +109,9 @@
   /* error */
   uint8_t error;
} rsp;
-} TURN_ON;
+};

-typedef union {
+union TURN_OFF {
/* request */
struct {
   /* request identifier */
@@ -124,9 +124,9 @@
   /* error */
   uint8_t err;
} rsp;
-} TURN_OFF;
+};

-typedef union {
+union SET_TUNE {
/* request */
struct {
   /* request identifier */
@@ -141,9 +141,9 @@
   /* response error */
   uint8_t error;
} rsp;
-} SET_TUNE;
+};

-typedef union {
+union GET_TUNE_STATUS {
/* request */
struct {
   /* request identifier */
@@ -158,9 +158,9 @@
   /* tune status */
   struct as10x_tune_status sts;
} rsp;
-} GET_TUNE_STATUS;
+};

-typedef union {
+union GET_TPS {
/* request */
struct {
   /* request identifier */
@@ -175,9 +175,9 @@
   /* tps details */
   struct as10x_tps tps;
} rsp;
-} GET_TPS;
+};

-typedef union {
+union COMMON {
/* request */
struct {
   /* request identifier */
@@ -190,9 +190,9 @@
   /* response error */
   uint8_t error;
} rsp;
-} COMMON;
+};

-typedef union {
+union ADD_PID_FILTER {
/* request */
struct {
   /* request identifier */
@@ -213,9 +213,9 @@
   /* Filter id */
   uint8_t filter_id;
} rsp;
-} ADD_PID_FILTER;
+};

-typedef union {
+union DEL_PID_FILTER {
/* request */
struct {
   /* request identifier */
@@ -230,9 +230,9 @@
   /* response error */
   uint8_t error;
} rsp;
-} DEL_PID_FILTER;
+};

-typedef union {
+union START_STREAMING {
/* request */
struct {
   /* request identifier */
@@ -245,9 +245,9 @@
   /* error */
   uint8_t error;
} rsp;
-} START_STREAMING;
+};

-typedef union {
+union STOP_STREAMING {
/* request */
struct {
   /* request identifier */
@@ -260,9 +260,9 @@
   /* error */
   uint8_t error;
} rsp;
-} STOP_STREAMING;
+};

-typedef union {
+union GET_DEMOD_STATS {
/* request */
struct {
   /* request identifier */
@@ -277,9 +277,9 @@
   /* demod stats */
   struct as10x_demod_stats stats;
} rsp;
-} GET_DEMOD_STATS;
+};

-typedef union {
+union GET_IMPULSE_RESP {
/* request */
struct {
   /* request identifier */
@@ -294,9 +294,9 @@
   /* impulse response ready */
   uint8_t is_ready;
} rsp;
-} GET_IMPULSE_RESP;
+};

-typedef union {
+union FW_CONTEXT {
/* request */
struct {
   /* request identifier */
@@ -319,9 +319,9 @@
   /* error */
   uint8_t error;
} rsp;
-} FW_CONTEXT;
+};

-typedef union {
+union SET_REGISTER {
/* request */
struct {
   /* response identifier */
@@ -338,9 +338,9 @@
   /* error */
   uint8_t error;
} rsp;
-} SET_REGISTER;
+};

-typedef union {
+union GET_REGISTER {
/* request */
struct {
   /* response identifier */
@@ -357,9 +357,9 @@
   /* register content */
   struct as10x_register_value reg_val;
} rsp;
-} GET_REGISTER;
+};

-typedef union {
+union CFG_CHANGE_MODE {
/* request */
struct {
   /* request identifier */
@@ -374,7 +374,7 @@
   /* error */
   uint8_t error;
} rsp;
-} CFG_CHANGE_MODE;
+};

 struct as10x_cmd_header_t {
uint16_t req_id;
@@ -384,7 +384,7 @@
 };

 #define DUMP_BLOCK_SIZE 16
-typedef union {
+union DUMP_MEMORY {
/* request */
struct {
   /* request identifier */
@@ -411,9 +411,9 @@
 uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)];
   } u;
} rsp;
-} DUMP_MEMORY;
+};

-typedef union {
+union DUMPLOG_MEMORY {
struct {
   /* request identifier */
   uint16_t proc_id;
@@ -430,9 +430,9 @@
   /* dump data */
   uint8_t data[DUMP_BLOCK_SIZE];
} rsp;
-} DUMPLOG_MEMORY;
+};

-typedef union {
+union RAW_DATA {
/* request */
struct {
   uint16_t proc_id;
@@ -445,32 +445,32 @@
   uint8_t data[64 - sizeof

[PATCH 5/7] staging as102: cleanup - get rid of pragma(pack)

2011-10-15 Thread Piotr Chmura

staging as102: cleanup - get rid of pragma(pack)

Cleanup code: change #pragma(pack) directive to __attribute__(packed)

Signed-off-by: Piotr Chmura
Cc: Devin Heitmueller
Cc: Greg HK

diff -Nur linux.as102.04-tabs/drivers/staging/as102/as102_fw.h 
linux.as102.05-pragmapack//drivers/staging/as102/as102_fw.h
--- linux.as102.04-tabs/drivers/staging/as102/as102_fw.h2011-10-14 
23:36:54.0 +0200
+++ linux.as102.05-pragmapack//drivers/staging/as102/as102_fw.h 2011-10-14 
23:38:24.0 +0200
@@ -20,11 +20,10 @@

 extern int dual_tuner;

-#pragma pack(1)
 struct as10x_raw_fw_pkt {
unsigned char address[4];
unsigned char data[MAX_FW_PKT_SIZE - 6];
-};
+} __attribute__((packed));

 struct as10x_fw_pkt_t {
union {
@@ -32,8 +31,7 @@
unsigned char length[2];
} u;
struct as10x_raw_fw_pkt raw;
-};
-#pragma pack()
+} __attribute__((packed));

 #ifdef __KERNEL__
 int as102_fw_upload(struct as102_bus_adapter_t *bus_adap);
diff -Nur linux.as102.04-tabs/drivers/staging/as102/as10x_cmd.h 
linux.as102.05-pragmapack//drivers/staging/as102/as10x_cmd.h
--- linux.as102.04-tabs/drivers/staging/as102/as10x_cmd.h   2011-10-14 
23:34:17.0 +0200
+++ linux.as102.05-pragmapack//drivers/staging/as102/as10x_cmd.h
2011-10-14 23:39:06.0 +0200
@@ -95,7 +95,6 @@
 };


-#pragma pack(1)
 union TURN_ON {
/* request */
struct {
@@ -109,7 +108,7 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union TURN_OFF {
/* request */
@@ -124,7 +123,7 @@
/* error */
uint8_t err;
} rsp;
-};
+} __attribute__((packed));

 union SET_TUNE {
/* request */
@@ -141,7 +140,7 @@
/* response error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union GET_TUNE_STATUS {
/* request */
@@ -158,7 +157,7 @@
/* tune status */
struct as10x_tune_status sts;
} rsp;
-};
+} __attribute__((packed));

 union GET_TPS {
/* request */
@@ -175,7 +174,7 @@
/* tps details */
struct as10x_tps tps;
} rsp;
-};
+} __attribute__((packed));

 union COMMON {
/* request */
@@ -190,7 +189,7 @@
/* response error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union ADD_PID_FILTER {
/* request */
@@ -213,7 +212,7 @@
/* Filter id */
uint8_t filter_id;
} rsp;
-};
+} __attribute__((packed));

 union DEL_PID_FILTER {
/* request */
@@ -230,7 +229,7 @@
/* response error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union START_STREAMING {
/* request */
@@ -245,7 +244,7 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union STOP_STREAMING {
/* request */
@@ -260,7 +259,7 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union GET_DEMOD_STATS {
/* request */
@@ -277,7 +276,7 @@
/* demod stats */
struct as10x_demod_stats stats;
} rsp;
-};
+} __attribute__((packed));

 union GET_IMPULSE_RESP {
/* request */
@@ -294,7 +293,7 @@
/* impulse response ready */
uint8_t is_ready;
} rsp;
-};
+} __attribute__((packed));

 union FW_CONTEXT {
/* request */
@@ -319,7 +318,7 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union SET_REGISTER {
/* request */
@@ -338,7 +337,7 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 union GET_REGISTER {
/* request */
@@ -357,7 +356,7 @@
/* register content */
struct as10x_register_value reg_val;
} rsp;
-};
+} __attribute__((packed));

 union CFG_CHANGE_MODE {
/* request */
@@ -374,14 +373,14 @@
/* error */
uint8_t error;
} rsp;
-};
+} __attribute__((packed));

 struct as10x_cmd_header_t {
uint16_t req_id;
uint16_t prog;
uint16_t version;
uint16_t data_len;
-};
+} __attribute__((packed));

 #define DUMP_BLOCK_SIZE 16
 union DUMP_MEMORY {
@@ -411,7 +410,7 @@
uint32_t data32[DUMP_BLOCK_SIZE / sizeof(uint32_t)];
} u;
} rsp;
-};
+} __attribute__((packed));

 union DUMPLOG_MEMORY {
struct {
@@ -430,7 +429,7 @@
/* dump data */
uint8_t data[DUMP_BLOCK_SIZE];
} rsp;
-};
+} __attribute__((packed));

 union RAW_DATA {
/* request */
@@ -444,7 +443,7 @@
uint8_t error;
uint8_t data[64 - sizeof(struct as10x_cmd_header_t) - 2 - 1

[PATCH 6/7] staging/as102: cleanup - get rid of editor comments

2011-10-15 Thread Piotr Chmura

staging/as102: cleanup - get rid of editor comments

Cleanup code: Delete vim formatting comments.

Signed-off-by: Piotr Chmura
Cc: Devin Heitmueller
Cc: Greg HK



diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_drv.c 
linux.as102.06-editor/drivers/staging/as102/as102_drv.c
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_drv.c 2011-10-14 
23:20:05.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_drv.c 2011-10-14 
23:42:30.0 +0200
@@ -356,5 +356,3 @@
 MODULE_DESCRIPTION(DRIVER_FULL_NAME);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Pierrick Hascoet");
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_drv.h 
linux.as102.06-editor/drivers/staging/as102/as102_drv.h
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_drv.h 2011-10-14 
22:21:58.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_drv.h 2011-10-14 
23:42:40.0 +0200
@@ -143,5 +143,3 @@
 int as102_dvb_register_fe(struct as102_dev_t *dev, struct dvb_frontend *fe);
 int as102_dvb_unregister_fe(struct dvb_frontend *dev);
 #endif
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_fe.c 
linux.as102.06-editor/drivers/staging/as102/as102_fe.c
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_fe.c  2011-10-14 
23:21:51.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_fe.c  2011-10-14 
23:42:47.0 +0200
@@ -671,5 +671,3 @@
}
 }
 #endif
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_fw.c 
linux.as102.06-editor/drivers/staging/as102/as102_fw.c
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_fw.c  2011-10-14 
23:22:33.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_fw.c  2011-10-14 
23:42:54.0 +0200
@@ -247,5 +247,3 @@
return errno;
 }
 #endif
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_fw.h 
linux.as102.06-editor/drivers/staging/as102/as102_fw.h
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_fw.h  2011-10-14 
23:38:24.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_fw.h  2011-10-14 
23:43:00.0 +0200
@@ -36,5 +36,3 @@
 #ifdef __KERNEL__
 int as102_fw_upload(struct as102_bus_adapter_t *bus_adap);
 #endif
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_usb_drv.c 
linux.as102.06-editor/drivers/staging/as102/as102_usb_drv.c
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_usb_drv.c 
2011-10-14 23:23:14.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_usb_drv.c 2011-10-14 
23:43:07.0 +0200
@@ -482,5 +482,3 @@
 }

 MODULE_DEVICE_TABLE(usb, as102_usb_id_table);
-
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as102_usb_drv.h 
linux.as102.06-editor/drivers/staging/as102/as102_usb_drv.h
--- linux.as102.05-pragmapack/drivers/staging/as102/as102_usb_drv.h 
2011-10-14 22:22:15.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as102_usb_drv.h 2011-10-14 
23:43:13.0 +0200
@@ -61,4 +61,3 @@
struct as10x_cmd_t r;
 };
 #endif
-/* EOF - vim: set textwidth=80 ts=8 sw=8 sts=8 noet: */
diff -Nur linux.as102.05-pragmapack/drivers/staging/as102/as10x_cmd.h 
linux.as102.06-editor/drivers/staging/as102/as10x_cmd.h
--- linux.as102.05-pragmapack/drivers/staging/as102/as10x_cmd.h 2011-10-14 
23:39:06.0 +0200
+++ linux.as102.06-editor/drivers/staging/as102/as10x_cmd.h 2011-10-14 
23:43:20.0 +0200
@@ -534,4 +534,3 @@
 }
 #endif
 #endif
-/* EOF - vim: set textwidth=80 ts=3 sw=3 sts=3 et: */





--
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 7/7] staging/as102: cleanup - get rid unnecessary LINUX and WIN32 defines

2011-10-15 Thread Piotr Chmura

staging/as102: cleanup - get rid unnecessary LINUX and WIN32 defines

Cleanup code: Remove of unnecessary defines WIN32 and LINUX.
We are always on linux so code (includes) for WIN32 compatibility is totally 
useless.

Signed-off-by: Piotr Chmura
Cc: Devin Heitmueller
Cc: Greg HK

diff -Nur linux.as102.06-editor/drivers/staging/as102/as10x_cmd.c 
linux.as102.07-defines/drivers/staging/as102/as10x_cmd.c
--- linux.as102.06-editor/drivers/staging/as102/as10x_cmd.c 2011-10-14 
23:25:27.0 +0200
+++ linux.as102.07-defines/drivers/staging/as102/as10x_cmd.c2011-10-14 
23:46:57.0 +0200
@@ -18,29 +18,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */

-#if defined(LINUX)&&  defined(__KERNEL__) /* linux kernel implementation */
 #include
 #include "as102_drv.h"
-#elif defined(WIN32)
-#if defined(__BUILDMACHINE__)&&  (__BUILDMACHINE__ == WinDDK)
-/* win32 ddk implementation */
-#include "wdm.h"
-#include "Device.h"
-#include "endian_mgmt.h" /* FIXME */
-#else /* win32 sdk implementation */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h"
-#endif
-#else /* all other cases */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h" /* FIXME */
-#endif /* __KERNEL__ */

 #include "as10x_types.h"
 #include "as10x_cmd.h"
diff -Nur linux.as102.06-editor/drivers/staging/as102/as10x_cmd_cfg.c 
linux.as102.07-defines/drivers/staging/as102/as10x_cmd_cfg.c
--- linux.as102.06-editor/drivers/staging/as102/as10x_cmd_cfg.c 2011-10-14 
23:24:05.0 +0200
+++ linux.as102.07-defines/drivers/staging/as102/as10x_cmd_cfg.c
2011-10-14 23:46:32.0 +0200
@@ -17,29 +17,8 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */

-#if defined(LINUX)&&  defined(__KERNEL__) /* linux kernel implementation */
 #include
 #include "as102_drv.h"
-#elif defined(WIN32)
-#if defined(__BUILDMACHINE__)&&  (__BUILDMACHINE__ == WinDDK)
-/* win32 ddk implementation */
-#include "wdm.h"
-#include "Device.h"
-#include "endian_mgmt.h" /* FIXME */
-#else /* win32 sdk implementation */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h"
-#endif
-#else /* all other cases */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h" /* FIXME */
-#endif /* __KERNEL__ */

 #include "as10x_types.h"
 #include "as10x_cmd.h"
diff -Nur linux.as102.06-editor/drivers/staging/as102/as10x_cmd_stream.c 
linux.as102.07-defines/drivers/staging/as102/as10x_cmd_stream.c
--- linux.as102.06-editor/drivers/staging/as102/as10x_cmd_stream.c  
2011-10-14 23:24:32.0 +0200
+++ linux.as102.07-defines/drivers/staging/as102/as10x_cmd_stream.c 
2011-10-14 23:46:46.0 +0200
@@ -16,28 +16,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-#if defined(LINUX)&&  defined(__KERNEL__) /* linux kernel implementation */
 #include
 #include "as102_drv.h"
-#elif defined(WIN32)
-#if defined(DDK) /* win32 ddk implementation */
-#include "wdm.h"
-#include "Device.h"
-#include "endian_mgmt.h" /* FIXME */
-#else /* win32 sdk implementation */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h"
-#endif
-#else /* all other cases */
-#include
-#include "types.h"
-#include "util.h"
-#include "as10x_handle.h"
-#include "endian_mgmt.h" /* FIXME */
-#endif /* __KERNEL__ */

 #include "as10x_cmd.h"

diff -Nur linux.as102.06-editor/drivers/staging/as102/Makefile 
linux.as102.07-defines/drivers/staging/as102/Makefile
--- linux.as102.06-editor/drivers/staging/as102/Makefile2011-10-14 
17:55:02.0 +0200
+++ linux.as102.07-defines/drivers/staging/as102/Makefile   2011-10-14 
23:47:30.0 +0200
@@ -2,4 +2,4 @@

 obj-$(CONFIG_DVB_AS102) += dvb-as102.o

-EXTRA_CFLAGS += -DLINUX -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core
+EXTRA_CFLAGS += -DCONFIG_AS102_USB -Idrivers/media/dvb/dvb-core



--
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 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)

2011-10-18 Thread Piotr Chmura
On Sun, 16 Oct 2011 11:44:14 -0200
Mauro Carvalho Chehab  wrote:

> Em 16-10-2011 09:45, Devin Heitmueller escreveu:
> > On Sun, Oct 16, 2011 at 4:57 AM, Stefan Richter
> >  wrote:
> >> Hi Piotr,
> >>
> >> thanks for getting this going again.  - I have not yet looked through the
> >> source but have some small remarks on the patch format.
> >>
> >>  - In your changelogs and in the diffs, somehow the space between real
> >>name and e-mail address got lost.
> >>
> >>  - The repetition of the Subject: line as first line in the changelog is
> >>unnecessary (and would cause an undesired duplication e.g. when git-am
> >>is used, last time I checked).
> >>
> >>  - AFAICT, author of patch 1/7 is not Devin but you.  Hence the From: line
> >>right above the changelog is wrong.
> >>
> >>  - The reference to the source hg tree is very helpful.  However, since
> >>the as102 related history in there is very well laid out, it may be
> >>beneficial to quote some of this prior history.  I suggest, include
> >>the changelog of "as102: import initial as102 driver",
> >>http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/rev/a78bda1e1a0b
> >>(but mark it clearly as a quote from the out-of-tree repo), and include
> >>a shortlog from this commit inclusive until the head commit inclusive.
> >>(Note, the hg author field appears to be wrong; some of the changes
> >>apparently need to be attributed to Pierrick Hascoet as author.)
> >>This would IMO improve the picture of who contributed what when this
> >>goes into mainline git history, even though the hg history needed to
> >>be discarded.
> >>
> >>  - A diffstat is always very nice to have in a patch posting.  Most tools
> >>for patch generation make it easy to add, and it helps the recipients
> >>of the patch posting.
> >>(Also, a diffstat of all patches combined would be good to have in the
> >>introductory PATCH 0/n posting, but not many developers take the time
> >>to do so.)
> >>
> >> Again, thanks for the effort and also thanks to Devin for making it
> >> possible.
> > 
> > I think collapsing my entire patch series in to a single patch would
> > not be acceptable, as it loses the entire history of what code was
> > originally delivered by Abilis as well as what changes I made.  The
> > fact that it's from multiple authors (including a commercial entity
> > contributing the code) makes this worse.
> > 
> > I think the tree does need to be rebased, but I don't think the entire
> > patch series would need to be reworked to be on staging from the
> > beginning.  You could probably import the first patch (as102: import
> > initial as102 driver), fix the usb_alloc_coherent() so that it
> > compiles (and put a note in it saying you did), apply the rest of the
> > patch series, and then add a final patch that says something like
> > "moving to staging as code is not production ready".  This would allow
> > the history to be preserved without having to rebase every patch to
> > deal with the files being moved to the staging tree.
> 
> Rebasing a changeset to move it to staging is not as complex as it seems. 
> I did it with tm6000 at the time I merged it. A simple bash script could
> do that. Something like (untested):
> 
> $ git export some_base_reference
> $ for i in 00*.patch; do sed s,/drivers/media/video,/drivers/staging,g <$i >a 
> && mv a $i; done
> $ mkdir patches/
> $ mv 00*.patches patches/
> $ (cd patches; ls *.patch > series)
> $ git quiltimport
> 
> Of course, the Makefike/Kconfig patch will need changes, but this is as easy
> as just dropping the hunks that are touching at /drivers/media/video/Makefile
> and /drivers/media/video/Kconfig, and then adding a final patch adding it to
> the /drivers/staging/*.
> 
> > 
> > An alternative would be make a minor tweak to my first patch which
> > removes the driver from the makefile.  Then every patch in the patch
> > series wouldn't actually have to compile successfully until the very
> > end when you add it back into the Makefile.  This is a luxury you can
> > do when it's a brand new driver.
> > 
> > When it's a brand new driver there is a bit more flexibility as long
> > as you don't break "git bisect".  Both of the approaches described
> > above accomplish that.
> > 
> > Mauro, what do you think?
> 
> Didn't actually reviewed the changeset, but let me comment about the
> submission procedure.
> 
> Folding patches from different authors generally is not a good idea.
> As Devin said, things like replacing "foo" by "bar" because "foo" core
> function were replaced by "bar" upstream is the kind of thing that you
> could fold, if you properly document it with:
>  
> [john@john_email.com: replaced "foo" by "bar" to fix compilation] 
> 
> So, you should rebase the patchsets, instead of just folding everything.
> It is up to you to change the patches on each patch, or to do it only at
> a final patch. Both ways work for me.
> 
> I suggest you to remo

[PATCH 2/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318502 18000
# Node ID e2ba344c99936bddc46722f1f1efec5600c58659
# Parent  a78bda1e1a0badc4a1296be958f1f8a49014ae18
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_drv.c

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_drv.c 
linuxb/drivers/media/dvb/as102/as102_drv.c
--- linux/drivers/staging/media/as102/as102_drv.c
+++ linuxb/drivers/staging/media/as102/as102_drv.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,23 +37,23 @@
 #warning >>> DVB_CORE not defined !!! <<<
 #endif
 
-int debug = 0;
+int debug;
 module_param_named(debug, debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off debugging (default: off)");
 
-int dual_tuner = 0;
+int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
-MODULE_PARM_DESC(dual_tuner, "Activate Dual-Tuner configuration (default: 
off)");
+MODULE_PARM_DESC(dual_tuner, "Activate Dual-Tuner config (default: off)");
 
 static int fw_upload = 1;
 module_param_named(fw_upload, fw_upload, int, 0644);
 MODULE_PARM_DESC(fw_upload, "Turn on/off default FW upload (default: on)");
 
-static int pid_filtering = 0;
+static int pid_filtering;
 module_param_named(pid_filtering, pid_filtering, int, 0644);
 MODULE_PARM_DESC(pid_filtering, "Activate HW PID filtering (default: off)");
 
-static int ts_auto_disable = 0;
+static int ts_auto_disable;
 module_param_named(ts_auto_disable, ts_auto_disable, int, 0644);
 MODULE_PARM_DESC(ts_auto_disable, "Stream Auto Enable on FW (default: off)");
 
@@ -65,7 +66,8 @@
 #endif
 
 #if defined(CONFIG_DVB_CORE) || defined(CONFIG_DVB_CORE_MODULE)
-static void as102_stop_stream(struct as102_dev_t *dev) {
+static void as102_stop_stream(struct as102_dev_t *dev)
+{
struct as102_bus_adapter_t *bus_adap;
 
if (dev != NULL)
@@ -80,16 +82,15 @@
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return;
 
-   if (as10x_cmd_stop_streaming(bus_adap) < 0) {
+   if (as10x_cmd_stop_streaming(bus_adap) < 0)
dprintk(debug, "as10x_cmd_stop_streaming failed\n");
-   }
 
mutex_unlock(&dev->bus_adap.lock);
}
 }
 
-static int as102_start_stream(struct as102_dev_t *dev) {
-
+static int as102_start_stream(struct as102_dev_t *dev)
+{
struct as102_bus_adapter_t *bus_adap;
int ret = -EFAULT;
 
@@ -98,9 +99,8 @@
else
return ret;
 
-   if (bus_adap->ops->start_stream != NULL) {
+   if (bus_adap->ops->start_stream != NULL)
ret = bus_adap->ops->start_stream(dev);
-   }
 
if (ts_auto_disable) {
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -127,25 +127,25 @@
return -EBUSY;
}
 
-   switch(onoff) {
-   case 0:
-   ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) 
pid);
-   dprintk(debug, "DEL_PID_FILTER([%02d] 0x%04x) ret = 
%d\n",
-   index, pid, ret);
-   break;
-   case 1:
-   {
-   struct as10x_ts_filter filter;
+   switch (onoff) {
+   case 0:
+   ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
+   dprintk(debug, "DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n",
+   index, pid, ret);
+   break;
+   case 1:
+   {
+   struct as10x_ts_filter filter;
 
-   filter.type = TS_PID_TYPE_TS;
-   filter.idx = 0xFF;
-   filter.pid = pid;
+   filter.type = TS_PID_TYPE_TS;
+   filter.idx = 0xFF;
+   filter.pid = pid;
 
-   ret = as10x_cmd_add_PID_filter(bus_adap, &filter);
-   dprintk(debug, "ADD_PID_FILTER([%02d -> %02d], 0x%04x) 
ret = %d\n",
-   index, filter.idx, filter.pid, ret);
-   break;
-   }
+   ret = as10x_cmd_add_PID_filter(bus_adap, &filter);
+   dprintk(debug, "ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n",
+   index, filter.idx, filter.pid, ret);
+   break;
+   }
}
 
mutex_unlock(&dev->bus_adap.lo

[PATCH 3/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318626 18000
# Node ID b91e96a07bee27c1d421b4c3702e33ee8075de83
# Parent  e2ba344c99936bddc46722f1f1efec5600c58659
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_fw.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_fw.c 
linuxb/drivers/media/dvb/as102/as102_fw.c
--- linux/drivers/staging/media/as102/as102_fw.c
+++ linuxb/drivers/staging/media/as102/as102_fw.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,15 +32,16 @@
 char as102_dt_fw1[] = "as102_data1_dt.hex";
 char as102_dt_fw2[] = "as102_data2_dt.hex";
 
-static unsigned char atohx(unsigned char *dst, char *src) {
+static unsigned char atohx(unsigned char *dst, char *src)
+{
unsigned char value = 0;
 
char msb = tolower(*src) - '0';
-   char lsb = tolower(*(src +1)) - '0';
+   char lsb = tolower(*(src + 1)) - '0';
 
-   if (msb > 9 )
+   if (msb > 9)
msb -= 7;
-   if (lsb > 9 )
+   if (lsb > 9)
lsb -= 7;
 
*dst = value = ((msb & 0xF) << 4) | (lsb & 0xF);
@@ -62,43 +64,42 @@
}
 
/* locate end of line */
-   for (src=fw_data; *src != '\n'; src += 2) {
+   for (src = fw_data; *src != '\n'; src += 2) {
atohx(&dst, src);
/* parse line to split addr / data */
switch (count) {
-   case 0:
-   *dataLength = dst;
-   break;
-   case 1:
-   addr[2] = dst;
-   break;
-   case 2:
-   addr[3] = dst;
-   break;
-   case 3:
-   /* check if data is an address */
-   if (dst == 0x04)
-   *addr_has_changed = 1;
-   else
-   *addr_has_changed = 0;
-   break;
-   case  4:
-   case  5:
-   if (*addr_has_changed) {
-   addr[(count - 4)] = dst;
-   } else {
-   data[(count - 4)] = dst;
-   }
-   break;
-   default:
+   case 0:
+   *dataLength = dst;
+   break;
+   case 1:
+   addr[2] = dst;
+   break;
+   case 2:
+   addr[3] = dst;
+   break;
+   case 3:
+   /* check if data is an address */
+   if (dst == 0x04)
+   *addr_has_changed = 1;
+   else
+   *addr_has_changed = 0;
+   break;
+   case  4:
+   case  5:
+   if (*addr_has_changed)
+   addr[(count - 4)] = dst;
+   else
data[(count - 4)] = dst;
-   break;
+   break;
+   default:
+   data[(count - 4)] = dst;
+   break;
}
count++;
}
 
/* return read value + ':' + '\n' */
-   return ((count * 2) + 2);
+   return (count * 2) + 2;
 }
 
 static int as102_firmware_upload(struct as102_bus_adapter_t *bus_adap,
@@ -122,17 +123,20 @@
&data_len,
&addr_has_changed);
 
-   if (read_bytes <= 0) {
+   if (read_bytes <= 0)
goto error;
-   }
 
/* detect the end of file */
-   if ((total_read_bytes += read_bytes) == firmware->size) {
+   total_read_bytes += read_bytes;
+   if (total_read_bytes == firmware->size) {
fw_pkt.u.request[0] = 0x00;
fw_pkt.u.request[1] = 0x03;
 
/* send EOF command */
-   if ((errno = 

[PATCH 4/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent  b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as10x_cmd.c 
linuxb/drivers/media/dvb/as102/as10x_cmd.c
--- linux/drivers/staging/media/as102/as10x_cmd.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@
 #include 
 #include "as102_drv.h"
 #elif defined(WIN32)
-   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk 
implementation */
+   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
+  /* win32 ddk implementation */
   #include "wdm.h"
   #include "Device.h"
   #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@
 */
 int as10x_cmd_turn_on(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid), sizeof(pcmd->body.turn_on.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_on.req));
 
-   /* fill command */
-   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
+   /* fill command */
+   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
-   phandle,
-   (uint8_t *) pcmd,
-   sizeof(pcmd->body.turn_on.req) + HEADER_SIZE,
-   (uint8_t *) prsp,
-   sizeof(prsp->body.turn_on.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+  sizeof(pcmd->body.turn_on.req) +
+  HEADER_SIZE,
+  (uint8_t *) prsp,
+  sizeof(prsp->body.turn_on.rsp) +
+  HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -98,42 +99,41 @@
 */
 int as10x_cmd_turn_off(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.turn_off.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_off.req));
 
-   /* fill command */
-   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
+   /* fill command */
+   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(
phandle, (uint8_t *) pcmd,
sizeof(pcmd->body.turn_off.req) + HEADER_SIZE,
-(uint8_t *) prsp,
+   (uint8_t *) prsp,
sizeof(prsp->body.turn_off.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   } else {
+   error = AS10X_CMD_ERROR;
+

[PATCH 5/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318751 18000
# Node ID 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
# Parent  69c8f5172790784738bcc18f8301919ef3d5373f
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd_stream.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as10x_cmd_stream.c 
linuxb/drivers/media/dvb/as102/as10x_cmd_stream.c
--- linux/drivers/staging/media/as102/as10x_cmd_stream.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
@@ -2,8 +2,6 @@
 
  \file   as10x_cmd_stream.c
 
- \version $Id$
-
  \author: S. Martinelli
 
  \n
@@ -53,57 +51,57 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_add_PID_filter(as10x_handle_t* phandle,
-struct as10x_ts_filter *filter) {
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+int as10x_cmd_add_PID_filter(as10x_handle_t *phandle,
+struct as10x_ts_filter *filter)
+{
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.add_pid_filter.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.add_pid_filter.req));
 
-   /* fill command */
-   pcmd->body.add_pid_filter.req.proc_id = cpu_to_le16(CONTROL_PROC_SETFILTER);
-   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
-   pcmd->body.add_pid_filter.req.stream_type = filter->type;
+   /* fill command */
+   pcmd->body.add_pid_filter.req.proc_id =
+   cpu_to_le16(CONTROL_PROC_SETFILTER);
+   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
+   pcmd->body.add_pid_filter.req.stream_type = filter->type;
 
-   if(filter->idx < 16)
-   pcmd->body.add_pid_filter.req.idx = filter->idx;
-   else
-   pcmd->body.add_pid_filter.req.idx = 0xFF;
+   if (filter->idx < 16)
+   pcmd->body.add_pid_filter.req.idx = filter->idx;
+   else
+   pcmd->body.add_pid_filter.req.idx = 0xFF;
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(phandle,
-  (uint8_t *) pcmd,
-  sizeof(pcmd->body.add_pid_filter.req) + HEADER_SIZE,
-  (uint8_t *) prsp,
-  sizeof(prsp->body.add_pid_filter.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+   sizeof(pcmd->body.add_pid_filter.req)
+   + HEADER_SIZE, (uint8_t *) prsp,
+   sizeof(prsp->body.add_pid_filter.rsp)
+   + HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
 
-   if(error == 0) {
- /* Response OK -> get response data */
- filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
-   }
+   if (error == 0) {
+   /* Response OK -> get response data */
+   filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
+   }
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -113,144 +111,138 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_del_PID_filter(as10x_handle_t* phandle,
+int as10x_cmd_del_PID_filter(as10x_handle_t *phandle,
 uint16_t pid_value)
 {
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+   ENTER();
 
-   ENTER();
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.del_pid_filter.req));
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-

[PATCH 6/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318799 18000
# Node ID 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
# Parent  1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_fe.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/media/dvb/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,12 +32,14 @@
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *dst,
  struct dvb_frontend_parameters *src);
 
-static void as102_fe_release(struct dvb_frontend *fe) {
+static void as102_fe_release(struct dvb_frontend *fe)
+{
struct as102_dev_t *dev;
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return;
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
@@ -64,13 +67,15 @@
 }
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
-static int as102_fe_init(struct dvb_frontend *fe) {
+static int as102_fe_init(struct dvb_frontend *fe)
+{
int ret = 0;
struct as102_dev_t *dev;
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -90,14 +95,16 @@
 #endif
 
 static int as102_fe_set_frontend(struct dvb_frontend *fe,
-struct dvb_frontend_parameters *params) {
+struct dvb_frontend_parameters *params)
+{
int ret = 0;
struct as102_dev_t *dev;
struct as10x_tune_args tune_args = { 0 };
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -107,9 +114,8 @@
 
/* send abilis command: SET_TUNE */
ret =  as10x_cmd_set_tune(&dev->bus_adap, &tune_args);
-   if(ret != 0) {
+   if (ret != 0)
dprintk(debug, "as10x_cmd_set_tune failed. (err = %d)\n", ret);
-   }
 
mutex_unlock(&dev->bus_adap.lock);
 
@@ -117,7 +123,7 @@
return (ret < 0) ? -EINVAL : 0;
 }
 
-static int as102_fe_get_frontend(struct dvb_frontend* fe,
+static int as102_fe_get_frontend(struct dvb_frontend *fe,
 struct dvb_frontend_parameters *p) {
int ret = 0;
struct as102_dev_t *dev;
@@ -125,7 +131,8 @@
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -EINVAL;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -150,7 +157,8 @@
 #if 0
dprintk(debug, "step_size= %d\n", settings->step_size);
dprintk(debug, "max_drift= %d\n", settings->max_drift);
-   dprintk(debug, "min_delay_ms = %d -> %d\n", settings->min_delay_ms, 
1000);
+   dprintk(debug, "min_delay_ms = %d -> %d\n", settings->min_delay_ms,
+   1000);
 #endif
 
settings->min_delay_ms = 1000;
@@ -160,14 +168,16 @@
 }
 
 
-static int as102_fe_read_status(struct dvb_frontend *fe, fe_status_t *status) {
+static int as102_fe_read_status(struct dvb_frontend *fe, fe_status_t *status)
+{
int ret = 0;
struct as102_dev_t *dev;
struct as10x_tune_status tstate = { 0 };
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -176,48 +186,47 @@
/* send abilis command: GET_TUNE_STATUS */
ret = as10x_cmd_get_tune_status(&dev->bus_adap, &tstate);
if (ret < 0) {
-   dprintk(debug, "as10x_cmd_get_tune_status failed (err = %d)\n", 
ret);
+   dprintk(debug, "as10x_cmd_get_tune_status failed (err = %d)\n",

[PATCH 7/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318867 18000
# Node ID 152825226bec049f947a844bea2c530fc9269ae5
# Parent  5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_usb_drv.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/media/dvb/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -49,7 +50,7 @@
.id_table   =  as102_usb_id_table
 };
 
-struct file_operations as102_dev_fops = {
+static const struct file_operations as102_dev_fops = {
.owner   = THIS_MODULE,
.open= as102_open,
.release = as102_release,
@@ -63,46 +64,48 @@
 
 static int as102_usb_xfer_cmd(struct as102_bus_adapter_t *bus_adap,
  unsigned char *send_buf, int send_buf_len,
- unsigned char *recv_buf, int recv_buf_len) {
-
+ unsigned char *recv_buf, int recv_buf_len)
+{
int ret = 0;
ENTER();
 
-   if(send_buf != NULL) {
+   if (send_buf != NULL) {
ret = usb_control_msg(bus_adap->usb_dev,
  usb_sndctrlpipe(bus_adap->usb_dev, 0),
  AS102_USB_DEVICE_TX_CTRL_CMD,
- USB_DIR_OUT | USB_TYPE_VENDOR | 
USB_RECIP_DEVICE,
+ USB_DIR_OUT | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE,
  bus_adap->cmd_xid, /* value */
  0, /* index */
  send_buf, send_buf_len,
  USB_CTRL_SET_TIMEOUT /* 200 */);
-   if(ret < 0) {
+   if (ret < 0) {
dprintk(debug, "usb_control_msg(send) failed, err %i\n",
ret);
return ret;
}
 
-   if(ret != send_buf_len) {
+   if (ret != send_buf_len) {
dprintk(debug, "only wrote %d of %d bytes\n",
ret, send_buf_len);
return -1;
}
}
 
-   if(recv_buf != NULL) {
+   if (recv_buf != NULL) {
 #ifdef TRACE
dprintk(debug, "want to read: %d bytes\n", recv_buf_len);
 #endif
ret = usb_control_msg(bus_adap->usb_dev,
  usb_rcvctrlpipe(bus_adap->usb_dev, 0),
  AS102_USB_DEVICE_RX_CTRL_CMD,
- USB_DIR_IN | USB_TYPE_VENDOR | 
USB_RECIP_DEVICE,
+ USB_DIR_IN | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE,
  bus_adap->cmd_xid, /* value */
  0, /* index */
  recv_buf, recv_buf_len,
  USB_CTRL_GET_TIMEOUT /* 200 */);
-   if(ret < 0) {
+   if (ret < 0) {
dprintk(debug, "usb_control_msg(recv) failed, err %i\n",
ret);
return ret;
@@ -119,18 +122,19 @@
 static int as102_send_ep1(struct as102_bus_adapter_t *bus_adap,
  unsigned char *send_buf,
  int send_buf_len,
- int swap32) {
-
+ int swap32)
+{
int ret = 0, actual_len;
 
-   ret = usb_bulk_msg(bus_adap->usb_dev, 
usb_sndbulkpipe(bus_adap->usb_dev, 1),
+   ret = usb_bulk_msg(bus_adap->usb_dev,
+  usb_sndbulkpipe(bus_adap->usb_dev, 1),
   send_buf, send_buf_len, &actual_len, 200);
-   if(ret) {
+   if (ret) {
dprintk(debug, "usb_bulk_msg(send) failed, err %i\n", ret);
return ret;
}
 
-   if(actual_len != send_buf_len) {
+   if (actual_len != send_buf_len) {
dprintk(debug, "only wrote %d of %d bytes\n",
actual_len, send_buf_len);
return -1;
@@ -139,21 +143,22 @@
 }
 
 stati

[PATCH 8/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318909 18000
# Node ID 89de57601df871f6d951ca13bf52b136f9eadddf
# Parent  152825226bec049f947a844bea2c530fc9269ae5
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd_cfg.c.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as10x_cmd_cfg.c 
linuxb/drivers/media/dvb/as102/as10x_cmd_cfg.c
--- linux/drivers/staging/media/as102/as10x_cmd_cfg.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
@@ -2,8 +2,6 @@
 
  \file   as10x_cmd_cfg.c
 
- \version $Id$
-
  \author: S. Martinelli
 
  \n
@@ -22,7 +20,8 @@
 #include 
 #include "as102_drv.h"
 #elif defined(WIN32)
-   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk 
implementation */
+   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
+  /* win32 ddk implementation */
   #include "wdm.h"
   #include "Device.h"
   #include "endian_mgmt.h" /* FIXME */
@@ -59,52 +58,52 @@
 int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag,
  uint32_t *pvalue)
 {
-   int  error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int  error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.context.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.context.req));
 
-   /* fill command */
-   pcmd->body.context.req.proc_id  = cpu_to_le16(CONTROL_PROC_CONTEXT);
-   pcmd->body.context.req.tag  = cpu_to_le16(tag);
-   pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA);
+   /* fill command */
+   pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT);
+   pcmd->body.context.req.tag = cpu_to_le16(tag);
+   pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error  = phandle->ops->xfer_cmd(phandle,
-  (uint8_t *) pcmd,
-  sizeof(pcmd->body.context.req) + HEADER_SIZE,
-  (uint8_t *) prsp,
-  sizeof(prsp->body.context.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error  = phandle->ops->xfer_cmd(phandle,
+   (uint8_t *) pcmd,
+   sizeof(pcmd->body.context.req)
+   + HEADER_SIZE,
+   (uint8_t *) prsp,
+   sizeof(prsp->body.context.rsp)
+   + HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response: context command do not follow the common response */
-   /* structure -> specific handling response parse required*/
-   error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
+   /* parse response: context command do not follow the common response */
+   /* structure -> specific handling response parse required*/
+   error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
 
-   if(error == 0) {
- /* Response OK -> get response data */
-  *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32);
- /* value returned is always a 32-bit value */
-   }
+   if (error == 0) {
+   /* Response OK -> get response data */
+   *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32);
+   /* value returned is always a 32-bit value */
+   }
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -118,47 +117,48 @@
 int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag,
  uint32_t value)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare

[PATCH 9/14] staging/media/as102: Add Elgato EyeTV DTT Deluxe

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318991 18000
# Node ID 4a82558f6df8b957bc623d854a118a5da32dead2
# Parent  89de57601df871f6d951ca13bf52b136f9eadddf
as102: Add Elgato EyeTV DTT Deluxe

From: Devin Heitmueller 

Add support for the Elgato EyeTV DTT Deluxe.  Note that the product
name field has not yet been abstracted out, so it will still identify
itself as a PCTV 74e.  The driver was originally built by the chipset
manufacturer so that the product vendor can specify the deivce name via
a #define, but wasn't setup to support multiple products from the same build of
the driver.

Thanks to Joerg Unglaub for suggesting this change.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 
Cc: Joerg Unglaub 

diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/staging/media/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -40,6 +40,7 @@
 static struct usb_device_id as102_usb_id_table[] = {
{ USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
{ USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
+   { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
{ } /* Terminating entry */
 };
 
diff --git linux/drivers/staging/media/as102/as102_usb_drv.h 
linuxb/drivers/staging/media/as102/as102_usb_drv.h
--- linux/drivers/staging/media/as102/as102_usb_drv.h
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.h
@@ -36,6 +36,11 @@
 #define PCTV_74E_USB_VID   0x2013
 #define PCTV_74E_USB_PID   0x0246
 
+/* Elgato: EyeTV DTT Deluxe */
+#define ELGATO_EYETV_DTT_NAME  "Elgato EyeTV DTT Deluxe"
+#define ELGATO_EYETV_DTT_USB_VID   0x0fd9
+#define ELGATO_EYETV_DTT_USB_PID   0x002c
+
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
 void as102_urb_stream_irq(struct urb *urb, struct pt_regs *regs);
 #else
--
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 10/14] staging/media/as102: properly handle multiple product names

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:# HG changeset patch
# User Devin Heitmueller 
# Date 1267319051 18000
# Node ID 22ef1bdca69a2781abf397c53a0f7f6125f5359a
# Parent  4a82558f6df8b957bc623d854a118a5da32dead2
as102: properly handle multiple product names

From: Devin Heitmueller 

Properly handle the case where the driver can be associated with multiple
different products (as opposed to always saying the device is named after the
value in a #define

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_drv.c 
linuxb/drivers/media/dvb/as102/as102_drv.c
--- linux/drivers/staging/media/as102/as102_drv.c
+++ linuxb/drivers/staging/media/as102/as102_drv.c
@@ -209,7 +209,7 @@
 
 #if defined(CONFIG_DVB_CORE) || defined(CONFIG_DVB_CORE_MODULE)
ret = dvb_register_adapter(&as102_dev->dvb_adap,
-  DEVICE_FULL_NAME,
+  as102_dev->name,
   THIS_MODULE,
 #if defined(CONFIG_AS102_USB)
   &as102_dev->bus_adap.usb_dev->dev
diff --git linux/drivers/staging/media/as102/as102_drv.h 
linuxb/drivers/media/dvb/as102/as102_drv.h
--- linux/drivers/staging/media/as102/as102_drv.h
+++ linuxb/drivers/staging/media/as102/as102_drv.h
@@ -106,6 +106,7 @@
 };
 
 struct as102_dev_t {
+   const char *name;
struct as102_bus_adapter_t bus_adap;
struct list_head device_entry;
struct kref kref;
diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/media/dvb/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -346,7 +346,7 @@
 
 static struct dvb_frontend_ops as102_fe_ops = {
.info = {
-   .name   = DEVICE_FULL_NAME,
+   .name   = "Unknown AS102 device",
.type   = FE_OFDM,
.frequency_min  = 17400,
.frequency_max  = 86200,
@@ -408,6 +408,8 @@
 
/* init frontend callback ops */
memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops));
+   strncpy(dvb_fe->ops.info.name, as102_dev->name,
+   sizeof(dvb_fe->ops.info.name));
 
/* register dbvb frontend */
errno = dvb_register_frontend(dvb_adap, dvb_fe);
diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/media/dvb/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -44,6 +44,15 @@
{ } /* Terminating entry */
 };
 
+/* Note that this table must always have the same number of entries as the
+   as102_usb_id_table struct */
+static const char *as102_device_names[] = {
+   AS102_REFERENCE_DESIGN,
+   AS102_PCTV_74E,
+   AS102_ELGATO_EYETV_DTT_NAME,
+   NULL /* Terminating entry */
+};
+
 struct usb_driver as102_usb_driver = {
.name   =  DRIVER_FULL_NAME,
.probe  =  as102_usb_probe,
@@ -344,6 +353,7 @@
 {
int ret;
struct as102_dev_t *as102_dev;
+   int i;
 
ENTER();
 
@@ -353,6 +363,23 @@
return -ENOMEM;
}
 
+   /* This should never actually happen */
+   if ((sizeof(as102_usb_id_table) / sizeof(struct usb_device_id)) !=
+   (sizeof(as102_device_names) / sizeof(const char *))) {
+   printk(KERN_ERR "Device names table invalid size");
+   return -EINVAL;
+   }
+
+   /* Assign the user-friendly device name */
+   for (i = 0; i < (sizeof(as102_usb_id_table) /
+sizeof(struct usb_device_id)); i++) {
+   if (id == &as102_usb_id_table[i])
+   as102_dev->name = as102_device_names[i];
+   }
+
+   if (as102_dev->name == NULL)
+   as102_dev->name = "Unknown AS102 device";
+
/* set private callback functions */
as102_dev->bus_adap.ops = &as102_priv_ops;
 
diff --git linux/drivers/staging/media/as102/as102_usb_drv.h 
linuxb/drivers/media/dvb/as102/as102_usb_drv.h
--- linux/drivers/staging/media/as102/as102_usb_drv.h
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.h
@@ -28,16 +28,17 @@
 /* define these values to match the supported devices */
 
 /* Abilis system: "TITAN" */
+#define AS102_REFERENCE_DESIGN "Abilis Systems DVB-Titan"
 #define AS102_USB_DEVICE_VENDOR_ID 0x1BA6
 #define AS102_USB_DEVICE_PID_0001  0x0001
 
 /* PCTV Systems: PCTV picoStick (74e) */
-#define DEVICE_FULL_NAME   "PCTV Systems : PCTV picoStick (74e)"
+#define AS102_PCTV_74E "PCTV Systems picoStick (74e)"
 #define PCTV_74E_USB_VID

[PATCH 11/14] staging/media/as102: fix compile warning about unused function

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267319685 18000
# Node ID 84b93826c0a19efa114a6808165f91390cb86daa
# Parent  22ef1bdca69a2781abf397c53a0f7f6125f5359a
as102: fix compile warning about unused function

From: Devin Heitmueller 

The function in question is only used on old kernels, so we had the call to
the function #ifdef'd, but the definition of the function was stil being
included.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 

diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/media/dvb/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -32,6 +32,7 @@
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *dst,
  struct dvb_frontend_parameters *src);
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
 static void as102_fe_release(struct dvb_frontend *fe)
 {
struct as102_dev_t *dev;
@@ -42,7 +43,6 @@
if (dev == NULL)
return;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return;
 
@@ -50,7 +50,6 @@
as10x_cmd_turn_off(&dev->bus_adap);
 
mutex_unlock(&dev->bus_adap.lock);
-#endif
 
/* release frontend callback ops */
memset(&fe->ops, 0, sizeof(struct dvb_frontend_ops));
@@ -66,7 +65,6 @@
LEAVE();
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
 static int as102_fe_init(struct dvb_frontend *fe)
 {
int ret = 0;
--
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 12/14] staging/media/as102: fix licensing oversight

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:# HG changeset patch
# User Devin Heitmueller 
# Date 1267577404 18000
# Node ID 8557cb6da3e71a350a538e3a0eb41126884289b9
# Parent  84b93826c0a19efa114a6808165f91390cb86daa
as102: fix licensing oversight

From: Pierrick Hascoet 

Fix a couple of files which were supposed by be relicensed as GPL but were
overlooked.

Priority: normal

Signed-off-by: Piotr Chmura 
Cc: Devin Heitmueller 
Cc: Pierrick Hascoet 

diff --git linux/drivers/staging/media/as102/as10x_cmd_cfg.c 
linuxb/drivers/media/dvb/as102/as10x_cmd_cfg.c
--- linux/drivers/staging/media/as102/as10x_cmd_cfg.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
@@ -1,20 +1,21 @@
-/**
-
- \file   as10x_cmd_cfg.c
-
- \author: S. Martinelli
-
- \n
-   (c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n
-   www.abilis.com  \n
- \n
-
- \brief AS10x API, configuration services
-
-   AS10x cmd management: build command buffer, send command through
-   selected port and wait for the response when required.
-
-*/
+/*
+ * Abilis Systems Single DVB-T Receiver
+ * Copyright (C) 2008 Pierrick Hascoet 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 
 #if defined(LINUX) && defined(__KERNEL__) /* linux kernel implementation */
 #include 
diff --git linux/drivers/staging/media/as102/as10x_cmd_stream.c 
linuxb/drivers/media/dvb/as102/as10x_cmd_stream.c
--- linux/drivers/staging/media/as102/as10x_cmd_stream.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
@@ -1,22 +1,21 @@
-/**
-
- \file   as10x_cmd_stream.c
-
- \author: S. Martinelli
-
- \n
-   (c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n
-   www.abilis.com  \n
- \n
-
- \brief AS10x CMD, stream services
-
-   AS10x CMD management: build command buffer, send command through
-   selected port and wait for the response when required.
-
-*/
-
-
+/*
+ * Abilis Systems Single DVB-T Receiver
+ * Copyright (C) 2008 Pierrick Hascoet 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 #if defined(LINUX) && defined(__KERNEL__) /* linux kernel implementation */
 #include 
 #include "as102_drv.h"
--
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 13/14] staging/media/as102: fix compile

2011-10-18 Thread Piotr Chmura
Replace usb_buffer_free() and usb_buffer_alloc() by usb_free_coherent() and 
usb_alloc_coherent() making it compile in current tree.
Add driver to parent Makefile and Kconfig

Signed-off-by: Piotr Chmura 

diff -Nur linux.as102.pulled/drivers/staging/Kconfig 
linux.as102.compiling/drivers/staging/Kconfig
--- linux.as102.pulled/drivers/staging/Kconfig  2011-10-14 15:26:42.0 
+0200
+++ linux.as102.compiling/drivers/staging/Kconfig   2011-10-17 
22:26:48.0 +0200
@@ -150,4 +150,6 @@
 
 source "drivers/staging/nvec/Kconfig"
 
+source "drivers/staging/media/as102/Kconfig"
+
 endif # STAGING
diff -Nur linux.as102.pulled/drivers/staging/Makefile 
linux.as102.compiling/drivers/staging/Makefile
--- linux.as102.pulled/drivers/staging/Makefile 2011-10-14 15:26:42.0 
+0200
+++ linux.as102.compiling/drivers/staging/Makefile  2011-10-17 
22:17:39.439874425 +0200
@@ -66,3 +66,4 @@
 obj-$(CONFIG_DRM_PSB)  += gma500/
 obj-$(CONFIG_INTEL_MEI)+= mei/
 obj-$(CONFIG_MFD_NVEC) += nvec/
+obj-$(CONFIG_DVB_AS102)+= media/as102/
diff -Nur linux.as102.pulled/drivers/staging/media/as102/as102_usb_drv.c 
linux.as102.compiling/drivers/staging/media/as102/as102_usb_drv.c
--- linux.as102.pulled/drivers/staging/media/as102/as102_usb_drv.c  
2011-10-17 22:05:15.996841251 +0200
+++ linux.as102.compiling/drivers/staging/media/as102/as102_usb_drv.c   
2011-10-17 22:22:33.317887538 +0200
@@ -238,7 +238,7 @@
for (i = 0; i < MAX_STREAM_URB; i++)
usb_free_urb(dev->stream_urb[i]);
 
-   usb_buffer_free(dev->bus_adap.usb_dev,
+   usb_free_coherent(dev->bus_adap.usb_dev,
MAX_STREAM_URB * AS102_USB_BUF_SIZE,
dev->stream,
dev->dma_addr);
@@ -251,7 +251,7 @@
 
ENTER();
 
-   dev->stream = usb_buffer_alloc(dev->bus_adap.usb_dev,
+   dev->stream = usb_alloc_coherent(dev->bus_adap.usb_dev,
   MAX_STREAM_URB * AS102_USB_BUF_SIZE,
   GFP_KERNEL,
   &dev->dma_addr);
--
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 14/14] staging/media/as102: add nBox Tuner Dongle support

2011-10-18 Thread Piotr Chmura
Add support for nBox Tuner Dongle based on the same chip.

Signed-off-by: Piotr Chmura 


diff -Nur linux.as102.01-initial/drivers/staging/media/as102/as102_usb_drv.c 
linux.as102.02-nbox/drivers/staging/media/as102/as102_usb_drv.c
--- linux.as102.01-initial/drivers/staging/media/as102/as102_usb_drv.c  
2011-10-14 18:00:19.0 +0200
+++ linux.as102.02-nbox/drivers/staging/media/as102/as102_usb_drv.c 
2011-10-14 18:21:36.0 +0200
@@ -41,6 +41,7 @@
{ USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
{ USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
{ USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
+   { USB_DEVICE(NBOX_DVBT_DONGLE_USB_VID, NBOX_DVBT_DONGLE_USB_PID) },
{ } /* Terminating entry */
 };
 
@@ -50,6 +51,7 @@
AS102_REFERENCE_DESIGN,
AS102_PCTV_74E,
AS102_ELGATO_EYETV_DTT_NAME,
+   AS102_NBOX_DVBT_DONGLE_NAME,
NULL /* Terminating entry */
 };
 
diff -Nur linux.as102.01-initial/drivers/staging/as102/as102_usb_drv.h 
linux.as102.02-nbox/drivers/staging/as102/as102_usb_drv.h
--- linux.as102.01-initial/drivers/staging/media/as102/as102_usb_drv.h  
2011-10-14 17:55:02.0 +0200
+++ linux.as102.02-nbox/drivers/staging/media/as102/as102_usb_drv.h 
2011-10-14 18:20:32.0 +0200
@@ -42,6 +42,11 @@
 #define ELGATO_EYETV_DTT_USB_VID   0x0fd9
 #define ELGATO_EYETV_DTT_USB_PID   0x002c
 
+/* nBox: nBox DVB-T Dongle */
+#define AS102_NBOX_DVBT_DONGLE_NAME"nBox DVB-T Dongle"
+#define NBOX_DVBT_DONGLE_USB_VID   0x0b89
+#define NBOX_DVBT_DONGLE_USB_PID   0x0007
+
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
 void as102_urb_stream_irq(struct urb *urb, struct pt_regs *regs);
 #else
--
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: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)

2011-10-18 Thread Piotr Chmura
On Tue, 18 Oct 2011 11:52:17 -0400
Devin Heitmueller  wrote:

> On Tue, Oct 18, 2011 at 5:10 AM, Piotr Chmura  
> wrote:
> > Thanks for comments for all of you.
> >
> > [PATCH 1-12/14] Following your guidelines i exported all changes from hg 
> > one by one. This way we will have all history in kernel tree.
> > I moved driver to staging/media and removed Kconfig/Makefile changes in 
> > parent directory in first patch.
> 
> Hello Piotr,
> 
> Not that I want to create more work for you, but it would appear that
> your patches stripped off all the Signed-off-by lines for both myself
> and Pierrick Hascoet (the developer from the hardware vendor).  You
> have replaced them with "cc:" lines, which breaks the chain of
> "Developer's Certificate of Origin".
> 
> When you take somebody else's patches, you need to preserve any
> existing Signed-off-by lines, adding your own at the bottom of the
> list.
> 
> In other words, the first patch should be:
> 
> Signed-off-by: Pierrick Hascoet 
> Signed-off-by: Devin Heitmueller 
> Signed-off-by: Piotr Chmura 
> 
> instead of:
> 
> Signed-off-by: Piotr Chmura 
> Cc: Pierrick Hascoet 
> Cc: Devin Heitmueller 
> 
> 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

Ok, i'll resend them again. 

Should I replay to every patch with something like [RESEND PATCH nn/mm]..., 
right ?

Peter
--
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


[RESEND PATCH 2/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318502 18000
# Node ID e2ba344c99936bddc46722f1f1efec5600c58659
# Parent  a78bda1e1a0badc4a1296be958f1f8a49014ae18
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_drv.c

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_drv.c 
linuxb/drivers/media/dvb/as102/as102_drv.c
--- linux/drivers/staging/media/as102/as102_drv.c
+++ linuxb/drivers/staging/media/as102/as102_drv.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,23 +37,23 @@
 #warning >>> DVB_CORE not defined !!! <<<
 #endif
 
-int debug = 0;
+int debug;
 module_param_named(debug, debug, int, 0644);
 MODULE_PARM_DESC(debug, "Turn on/off debugging (default: off)");
 
-int dual_tuner = 0;
+int dual_tuner;
 module_param_named(dual_tuner, dual_tuner, int, 0644);
-MODULE_PARM_DESC(dual_tuner, "Activate Dual-Tuner configuration (default: 
off)");
+MODULE_PARM_DESC(dual_tuner, "Activate Dual-Tuner config (default: off)");
 
 static int fw_upload = 1;
 module_param_named(fw_upload, fw_upload, int, 0644);
 MODULE_PARM_DESC(fw_upload, "Turn on/off default FW upload (default: on)");
 
-static int pid_filtering = 0;
+static int pid_filtering;
 module_param_named(pid_filtering, pid_filtering, int, 0644);
 MODULE_PARM_DESC(pid_filtering, "Activate HW PID filtering (default: off)");
 
-static int ts_auto_disable = 0;
+static int ts_auto_disable;
 module_param_named(ts_auto_disable, ts_auto_disable, int, 0644);
 MODULE_PARM_DESC(ts_auto_disable, "Stream Auto Enable on FW (default: off)");
 
@@ -65,7 +66,8 @@
 #endif
 
 #if defined(CONFIG_DVB_CORE) || defined(CONFIG_DVB_CORE_MODULE)
-static void as102_stop_stream(struct as102_dev_t *dev) {
+static void as102_stop_stream(struct as102_dev_t *dev)
+{
struct as102_bus_adapter_t *bus_adap;
 
if (dev != NULL)
@@ -80,16 +82,15 @@
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return;
 
-   if (as10x_cmd_stop_streaming(bus_adap) < 0) {
+   if (as10x_cmd_stop_streaming(bus_adap) < 0)
dprintk(debug, "as10x_cmd_stop_streaming failed\n");
-   }
 
mutex_unlock(&dev->bus_adap.lock);
}
 }
 
-static int as102_start_stream(struct as102_dev_t *dev) {
-
+static int as102_start_stream(struct as102_dev_t *dev)
+{
struct as102_bus_adapter_t *bus_adap;
int ret = -EFAULT;
 
@@ -98,9 +99,8 @@
else
return ret;
 
-   if (bus_adap->ops->start_stream != NULL) {
+   if (bus_adap->ops->start_stream != NULL)
ret = bus_adap->ops->start_stream(dev);
-   }
 
if (ts_auto_disable) {
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -127,25 +127,25 @@
return -EBUSY;
}
 
-   switch(onoff) {
-   case 0:
-   ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) 
pid);
-   dprintk(debug, "DEL_PID_FILTER([%02d] 0x%04x) ret = 
%d\n",
-   index, pid, ret);
-   break;
-   case 1:
-   {
-   struct as10x_ts_filter filter;
+   switch (onoff) {
+   case 0:
+   ret = as10x_cmd_del_PID_filter(bus_adap, (uint16_t) pid);
+   dprintk(debug, "DEL_PID_FILTER([%02d] 0x%04x) ret = %d\n",
+   index, pid, ret);
+   break;
+   case 1:
+   {
+   struct as10x_ts_filter filter;
 
-   filter.type = TS_PID_TYPE_TS;
-   filter.idx = 0xFF;
-   filter.pid = pid;
+   filter.type = TS_PID_TYPE_TS;
+   filter.idx = 0xFF;
+   filter.pid = pid;
 
-   ret = as10x_cmd_add_PID_filter(bus_adap, &filter);
-   dprintk(debug, "ADD_PID_FILTER([%02d -> %02d], 0x%04x) 
ret = %d\n",
-   index, filter.idx, filter.pid, ret);
-   break;
-   }
+   ret = as10x_cmd_add_PID_filter(bus_adap, &filter);
+   dprintk(debug, "ADD_PID_FILTER([%02d -> %02d], 0x%04x) ret = %d\n",
+   index, filter.idx, filter.pid, ret);
+   break;
+   }
}
 
mutex_unlock(&dev->

[RESEND PATCH 3/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318626 18000
# Node ID b91e96a07bee27c1d421b4c3702e33ee8075de83
# Parent  e2ba344c99936bddc46722f1f1efec5600c58659
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_fw.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_fw.c 
linuxb/drivers/media/dvb/as102/as102_fw.c
--- linux/drivers/staging/media/as102/as102_fw.c
+++ linuxb/drivers/staging/media/as102/as102_fw.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,15 +32,16 @@
 char as102_dt_fw1[] = "as102_data1_dt.hex";
 char as102_dt_fw2[] = "as102_data2_dt.hex";
 
-static unsigned char atohx(unsigned char *dst, char *src) {
+static unsigned char atohx(unsigned char *dst, char *src)
+{
unsigned char value = 0;
 
char msb = tolower(*src) - '0';
-   char lsb = tolower(*(src +1)) - '0';
+   char lsb = tolower(*(src + 1)) - '0';
 
-   if (msb > 9 )
+   if (msb > 9)
msb -= 7;
-   if (lsb > 9 )
+   if (lsb > 9)
lsb -= 7;
 
*dst = value = ((msb & 0xF) << 4) | (lsb & 0xF);
@@ -62,43 +64,42 @@
}
 
/* locate end of line */
-   for (src=fw_data; *src != '\n'; src += 2) {
+   for (src = fw_data; *src != '\n'; src += 2) {
atohx(&dst, src);
/* parse line to split addr / data */
switch (count) {
-   case 0:
-   *dataLength = dst;
-   break;
-   case 1:
-   addr[2] = dst;
-   break;
-   case 2:
-   addr[3] = dst;
-   break;
-   case 3:
-   /* check if data is an address */
-   if (dst == 0x04)
-   *addr_has_changed = 1;
-   else
-   *addr_has_changed = 0;
-   break;
-   case  4:
-   case  5:
-   if (*addr_has_changed) {
-   addr[(count - 4)] = dst;
-   } else {
-   data[(count - 4)] = dst;
-   }
-   break;
-   default:
+   case 0:
+   *dataLength = dst;
+   break;
+   case 1:
+   addr[2] = dst;
+   break;
+   case 2:
+   addr[3] = dst;
+   break;
+   case 3:
+   /* check if data is an address */
+   if (dst == 0x04)
+   *addr_has_changed = 1;
+   else
+   *addr_has_changed = 0;
+   break;
+   case  4:
+   case  5:
+   if (*addr_has_changed)
+   addr[(count - 4)] = dst;
+   else
data[(count - 4)] = dst;
-   break;
+   break;
+   default:
+   data[(count - 4)] = dst;
+   break;
}
count++;
}
 
/* return read value + ':' + '\n' */
-   return ((count * 2) + 2);
+   return (count * 2) + 2;
 }
 
 static int as102_firmware_upload(struct as102_bus_adapter_t *bus_adap,
@@ -122,17 +123,20 @@
&data_len,
&addr_has_changed);
 
-   if (read_bytes <= 0) {
+   if (read_bytes <= 0)
goto error;
-   }
 
/* detect the end of file */
-   if ((total_read_bytes += read_bytes) == firmware->size) {
+   total_read_bytes += read_bytes;
+   if (total_read_bytes == firmware->size) {
fw_pkt.u.request[0] = 0x00;
fw_pkt.u.request[1] = 0x03;
 
/* send EOF command */
-   if ((

[RESEND PATCH 4/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent  b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as10x_cmd.c 
linuxb/drivers/media/dvb/as102/as10x_cmd.c
--- linux/drivers/staging/media/as102/as10x_cmd.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@
 #include 
 #include "as102_drv.h"
 #elif defined(WIN32)
-   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk 
implementation */
+   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
+  /* win32 ddk implementation */
   #include "wdm.h"
   #include "Device.h"
   #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@
 */
 int as10x_cmd_turn_on(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid), sizeof(pcmd->body.turn_on.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_on.req));
 
-   /* fill command */
-   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
+   /* fill command */
+   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
-   phandle,
-   (uint8_t *) pcmd,
-   sizeof(pcmd->body.turn_on.req) + HEADER_SIZE,
-   (uint8_t *) prsp,
-   sizeof(prsp->body.turn_on.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+  sizeof(pcmd->body.turn_on.req) +
+  HEADER_SIZE,
+  (uint8_t *) prsp,
+  sizeof(prsp->body.turn_on.rsp) +
+  HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -98,42 +99,41 @@
 */
 int as10x_cmd_turn_off(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.turn_off.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_off.req));
 
-   /* fill command */
-   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
+   /* fill command */
+   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(
phandle, (uint8_t *) pcmd,
sizeof(pcmd->body.turn_off.req) + HEADER_SIZE,
-(uint8_t *) prsp,
+   (uint8_t *) prsp,
sizeof(prsp->body.turn_off.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   } else {
+   

[RESEND PATCH 5/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318751 18000
# Node ID 1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
# Parent  69c8f5172790784738bcc18f8301919ef3d5373f
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd_stream.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as10x_cmd_stream.c 
linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
--- linux/drivers/staging/media/as102/as10x_cmd_stream.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
@@ -2,8 +2,6 @@
 
  \file   as10x_cmd_stream.c
 
- \version $Id$
-
  \author: S. Martinelli
 
  \n
@@ -53,57 +51,57 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_add_PID_filter(as10x_handle_t* phandle,
-struct as10x_ts_filter *filter) {
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+int as10x_cmd_add_PID_filter(as10x_handle_t *phandle,
+struct as10x_ts_filter *filter)
+{
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.add_pid_filter.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.add_pid_filter.req));
 
-   /* fill command */
-   pcmd->body.add_pid_filter.req.proc_id = cpu_to_le16(CONTROL_PROC_SETFILTER);
-   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
-   pcmd->body.add_pid_filter.req.stream_type = filter->type;
+   /* fill command */
+   pcmd->body.add_pid_filter.req.proc_id =
+   cpu_to_le16(CONTROL_PROC_SETFILTER);
+   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
+   pcmd->body.add_pid_filter.req.stream_type = filter->type;
 
-   if(filter->idx < 16)
-   pcmd->body.add_pid_filter.req.idx = filter->idx;
-   else
-   pcmd->body.add_pid_filter.req.idx = 0xFF;
+   if (filter->idx < 16)
+   pcmd->body.add_pid_filter.req.idx = filter->idx;
+   else
+   pcmd->body.add_pid_filter.req.idx = 0xFF;
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(phandle,
-  (uint8_t *) pcmd,
-  sizeof(pcmd->body.add_pid_filter.req) + HEADER_SIZE,
-  (uint8_t *) prsp,
-  sizeof(prsp->body.add_pid_filter.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+   sizeof(pcmd->body.add_pid_filter.req)
+   + HEADER_SIZE, (uint8_t *) prsp,
+   sizeof(prsp->body.add_pid_filter.rsp)
+   + HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
 
-   if(error == 0) {
- /* Response OK -> get response data */
- filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
-   }
+   if (error == 0) {
+   /* Response OK -> get response data */
+   filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
+   }
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -113,144 +111,138 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_del_PID_filter(as10x_handle_t* phandle,
+int as10x_cmd_del_PID_filter(as10x_handle_t *phandle,
 uint16_t pid_value)
 {
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+   ENTER();
 
-   ENTER();
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.del_pid_filter.req));
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->c

[RESEND PATCH 6/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318799 18000
# Node ID 5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
# Parent  1ccb2e0adbf02a111decf8a4c78e93f4354e2bd2
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_fe.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/staging/media/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -31,12 +32,14 @@
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *dst,
  struct dvb_frontend_parameters *src);
 
-static void as102_fe_release(struct dvb_frontend *fe) {
+static void as102_fe_release(struct dvb_frontend *fe)
+{
struct as102_dev_t *dev;
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return;
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
@@ -64,13 +67,15 @@
 }
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
-static int as102_fe_init(struct dvb_frontend *fe) {
+static int as102_fe_init(struct dvb_frontend *fe)
+{
int ret = 0;
struct as102_dev_t *dev;
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -90,14 +95,16 @@
 #endif
 
 static int as102_fe_set_frontend(struct dvb_frontend *fe,
-struct dvb_frontend_parameters *params) {
+struct dvb_frontend_parameters *params)
+{
int ret = 0;
struct as102_dev_t *dev;
struct as10x_tune_args tune_args = { 0 };
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -107,9 +114,8 @@
 
/* send abilis command: SET_TUNE */
ret =  as10x_cmd_set_tune(&dev->bus_adap, &tune_args);
-   if(ret != 0) {
+   if (ret != 0)
dprintk(debug, "as10x_cmd_set_tune failed. (err = %d)\n", ret);
-   }
 
mutex_unlock(&dev->bus_adap.lock);
 
@@ -117,7 +123,7 @@
return (ret < 0) ? -EINVAL : 0;
 }
 
-static int as102_fe_get_frontend(struct dvb_frontend* fe,
+static int as102_fe_get_frontend(struct dvb_frontend *fe,
 struct dvb_frontend_parameters *p) {
int ret = 0;
struct as102_dev_t *dev;
@@ -125,7 +131,8 @@
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -EINVAL;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -150,7 +157,8 @@
 #if 0
dprintk(debug, "step_size= %d\n", settings->step_size);
dprintk(debug, "max_drift= %d\n", settings->max_drift);
-   dprintk(debug, "min_delay_ms = %d -> %d\n", settings->min_delay_ms, 
1000);
+   dprintk(debug, "min_delay_ms = %d -> %d\n", settings->min_delay_ms,
+   1000);
 #endif
 
settings->min_delay_ms = 1000;
@@ -160,14 +168,16 @@
 }
 
 
-static int as102_fe_read_status(struct dvb_frontend *fe, fe_status_t *status) {
+static int as102_fe_read_status(struct dvb_frontend *fe, fe_status_t *status)
+{
int ret = 0;
struct as102_dev_t *dev;
struct as10x_tune_status tstate = { 0 };
 
ENTER();
 
-   if ((dev = (struct as102_dev_t *) fe->tuner_priv) == NULL)
+   dev = (struct as102_dev_t *) fe->tuner_priv;
+   if (dev == NULL)
return -ENODEV;
 
if (mutex_lock_interruptible(&dev->bus_adap.lock))
@@ -176,48 +186,47 @@
/* send abilis command: GET_TUNE_STATUS */
ret = as10x_cmd_get_tune_status(&dev->bus_adap, &tstate);
if (ret < 0) {
-   dprintk(debug, "as10x_cmd_get_tune_status failed (err = %d)\n", 
ret);
+   dprintk(debug, "as10x_cmd_get_tune_status failed (err = %d)\n",

[RESEND PATCH 7/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318867 18000
# Node ID 152825226bec049f947a844bea2c530fc9269ae5
# Parent  5916edd6739e9b8e02ff8a1e93161c4d23b50b3e
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as102_usb_drv.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/media/dvb/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -49,7 +50,7 @@
.id_table   =  as102_usb_id_table
 };
 
-struct file_operations as102_dev_fops = {
+static const struct file_operations as102_dev_fops = {
.owner   = THIS_MODULE,
.open= as102_open,
.release = as102_release,
@@ -63,46 +64,48 @@
 
 static int as102_usb_xfer_cmd(struct as102_bus_adapter_t *bus_adap,
  unsigned char *send_buf, int send_buf_len,
- unsigned char *recv_buf, int recv_buf_len) {
-
+ unsigned char *recv_buf, int recv_buf_len)
+{
int ret = 0;
ENTER();
 
-   if(send_buf != NULL) {
+   if (send_buf != NULL) {
ret = usb_control_msg(bus_adap->usb_dev,
  usb_sndctrlpipe(bus_adap->usb_dev, 0),
  AS102_USB_DEVICE_TX_CTRL_CMD,
- USB_DIR_OUT | USB_TYPE_VENDOR | 
USB_RECIP_DEVICE,
+ USB_DIR_OUT | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE,
  bus_adap->cmd_xid, /* value */
  0, /* index */
  send_buf, send_buf_len,
  USB_CTRL_SET_TIMEOUT /* 200 */);
-   if(ret < 0) {
+   if (ret < 0) {
dprintk(debug, "usb_control_msg(send) failed, err %i\n",
ret);
return ret;
}
 
-   if(ret != send_buf_len) {
+   if (ret != send_buf_len) {
dprintk(debug, "only wrote %d of %d bytes\n",
ret, send_buf_len);
return -1;
}
}
 
-   if(recv_buf != NULL) {
+   if (recv_buf != NULL) {
 #ifdef TRACE
dprintk(debug, "want to read: %d bytes\n", recv_buf_len);
 #endif
ret = usb_control_msg(bus_adap->usb_dev,
  usb_rcvctrlpipe(bus_adap->usb_dev, 0),
  AS102_USB_DEVICE_RX_CTRL_CMD,
- USB_DIR_IN | USB_TYPE_VENDOR | 
USB_RECIP_DEVICE,
+ USB_DIR_IN | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE,
  bus_adap->cmd_xid, /* value */
  0, /* index */
  recv_buf, recv_buf_len,
  USB_CTRL_GET_TIMEOUT /* 200 */);
-   if(ret < 0) {
+   if (ret < 0) {
dprintk(debug, "usb_control_msg(recv) failed, err %i\n",
ret);
return ret;
@@ -119,18 +122,19 @@
 static int as102_send_ep1(struct as102_bus_adapter_t *bus_adap,
  unsigned char *send_buf,
  int send_buf_len,
- int swap32) {
-
+ int swap32)
+{
int ret = 0, actual_len;
 
-   ret = usb_bulk_msg(bus_adap->usb_dev, 
usb_sndbulkpipe(bus_adap->usb_dev, 1),
+   ret = usb_bulk_msg(bus_adap->usb_dev,
+  usb_sndbulkpipe(bus_adap->usb_dev, 1),
   send_buf, send_buf_len, &actual_len, 200);
-   if(ret) {
+   if (ret) {
dprintk(debug, "usb_bulk_msg(send) failed, err %i\n", ret);
return ret;
}
 
-   if(actual_len != send_buf_len) {
+   if (actual_len != send_buf_len) {
dprintk(debug, "only wrote %d of %d bytes\n",
actual_len, send_buf_len);
return -1;
@@ -139,21 +143,22

[RESEND PATCH 8/14] staging/media/as102: checkpatch fixes

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318909 18000
# Node ID 89de57601df871f6d951ca13bf52b136f9eadddf
# Parent  152825226bec049f947a844bea2c530fc9269ae5
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd_cfg.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as10x_cmd_cfg.c 
linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
--- linux/drivers/staging/media/as102/as10x_cmd_cfg.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
@@ -2,8 +2,6 @@
 
  \file   as10x_cmd_cfg.c
 
- \version $Id$
-
  \author: S. Martinelli
 
  \n
@@ -22,7 +20,8 @@
 #include 
 #include "as102_drv.h"
 #elif defined(WIN32)
-   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk 
implementation */
+   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
+  /* win32 ddk implementation */
   #include "wdm.h"
   #include "Device.h"
   #include "endian_mgmt.h" /* FIXME */
@@ -59,52 +58,52 @@
 int as10x_cmd_get_context(as10x_handle_t *phandle, uint16_t tag,
  uint32_t *pvalue)
 {
-   int  error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int  error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.context.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.context.req));
 
-   /* fill command */
-   pcmd->body.context.req.proc_id  = cpu_to_le16(CONTROL_PROC_CONTEXT);
-   pcmd->body.context.req.tag  = cpu_to_le16(tag);
-   pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA);
+   /* fill command */
+   pcmd->body.context.req.proc_id = cpu_to_le16(CONTROL_PROC_CONTEXT);
+   pcmd->body.context.req.tag = cpu_to_le16(tag);
+   pcmd->body.context.req.type = cpu_to_le16(GET_CONTEXT_DATA);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error  = phandle->ops->xfer_cmd(phandle,
-  (uint8_t *) pcmd,
-  sizeof(pcmd->body.context.req) + HEADER_SIZE,
-  (uint8_t *) prsp,
-  sizeof(prsp->body.context.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error  = phandle->ops->xfer_cmd(phandle,
+   (uint8_t *) pcmd,
+   sizeof(pcmd->body.context.req)
+   + HEADER_SIZE,
+   (uint8_t *) prsp,
+   sizeof(prsp->body.context.rsp)
+   + HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response: context command do not follow the common response */
-   /* structure -> specific handling response parse required*/
-   error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
+   /* parse response: context command do not follow the common response */
+   /* structure -> specific handling response parse required*/
+   error = as10x_context_rsp_parse(prsp, CONTROL_PROC_CONTEXT_RSP);
 
-   if(error == 0) {
- /* Response OK -> get response data */
-  *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32);
- /* value returned is always a 32-bit value */
-   }
+   if (error == 0) {
+   /* Response OK -> get response data */
+   *pvalue = le32_to_cpu(prsp->body.context.rsp.reg_val.u.value32);
+   /* value returned is always a 32-bit value */
+   }
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -118,47 +117,48 @@
 int as10x_cmd_set_context(as10x_handle_t *phandle, uint16_t tag,
  uint32_t value)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /

[RESEND PATCH 9/14] staging/media/as102: Add Elgato EyeTV DTT Deluxe

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318991 18000
# Node ID 4a82558f6df8b957bc623d854a118a5da32dead2
# Parent  89de57601df871f6d951ca13bf52b136f9eadddf
as102: Add Elgato EyeTV DTT Deluxe

From: Devin Heitmueller 

Add support for the Elgato EyeTV DTT Deluxe.  Note that the product
name field has not yet been abstracted out, so it will still identify
itself as a PCTV 74e.  The driver was originally built by the chipset
manufacturer so that the product vendor can specify the deivce name via
a #define, but wasn't setup to support multiple products from the same build of
the driver.

Thanks to Joerg Unglaub for suggesting this change.

Priority: normal

Signed-off-by: Joerg Unglaub 
Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/staging/media/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -40,6 +40,7 @@
 static struct usb_device_id as102_usb_id_table[] = {
{ USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
{ USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
+   { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
{ } /* Terminating entry */
 };
 
diff --git linux/drivers/staging/media/as102/as102_usb_drv.h 
linuxb/drivers/staging/media/as102/as102_usb_drv.h
--- linux/drivers/staging/media/as102/as102_usb_drv.h
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.h
@@ -36,6 +36,11 @@
 #define PCTV_74E_USB_VID   0x2013
 #define PCTV_74E_USB_PID   0x0246
 
+/* Elgato: EyeTV DTT Deluxe */
+#define ELGATO_EYETV_DTT_NAME  "Elgato EyeTV DTT Deluxe"
+#define ELGATO_EYETV_DTT_USB_VID   0x0fd9
+#define ELGATO_EYETV_DTT_USB_PID   0x002c
+
 #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
 void as102_urb_stream_irq(struct urb *urb, struct pt_regs *regs);
 #else
--
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


[RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:# HG changeset patch
# User Devin Heitmueller 
# Date 1267319051 18000
# Node ID 22ef1bdca69a2781abf397c53a0f7f6125f5359a
# Parent  4a82558f6df8b957bc623d854a118a5da32dead2
as102: properly handle multiple product names

From: Devin Heitmueller 

Properly handle the case where the driver can be associated with multiple
different products (as opposed to always saying the device is named after the
value in a #define

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_drv.c 
linuxb/drivers/staging/media/as102/as102_drv.c
--- linux/drivers/staging/media/as102/as102_drv.c
+++ linuxb/drivers/staging/media/as102/as102_drv.c
@@ -209,7 +209,7 @@
 
 #if defined(CONFIG_DVB_CORE) || defined(CONFIG_DVB_CORE_MODULE)
ret = dvb_register_adapter(&as102_dev->dvb_adap,
-  DEVICE_FULL_NAME,
+  as102_dev->name,
   THIS_MODULE,
 #if defined(CONFIG_AS102_USB)
   &as102_dev->bus_adap.usb_dev->dev
diff --git linux/drivers/staging/media/as102/as102_drv.h 
linuxb/drivers/staging/media/as102/as102_drv.h
--- linux/drivers/staging/media/as102/as102_drv.h
+++ linuxb/drivers/staging/media/as102/as102_drv.h
@@ -106,6 +106,7 @@
 };
 
 struct as102_dev_t {
+   const char *name;
struct as102_bus_adapter_t bus_adap;
struct list_head device_entry;
struct kref kref;
diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/staging/media/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -346,7 +346,7 @@
 
 static struct dvb_frontend_ops as102_fe_ops = {
.info = {
-   .name   = DEVICE_FULL_NAME,
+   .name   = "Unknown AS102 device",
.type   = FE_OFDM,
.frequency_min  = 17400,
.frequency_max  = 86200,
@@ -408,6 +408,8 @@
 
/* init frontend callback ops */
memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops));
+   strncpy(dvb_fe->ops.info.name, as102_dev->name,
+   sizeof(dvb_fe->ops.info.name));
 
/* register dbvb frontend */
errno = dvb_register_frontend(dvb_adap, dvb_fe);
diff --git linux/drivers/staging/media/as102/as102_usb_drv.c 
linuxb/drivers/staging/media/as102/as102_usb_drv.c
--- linux/drivers/staging/media/as102/as102_usb_drv.c
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.c
@@ -44,6 +44,15 @@
{ } /* Terminating entry */
 };
 
+/* Note that this table must always have the same number of entries as the
+   as102_usb_id_table struct */
+static const char *as102_device_names[] = {
+   AS102_REFERENCE_DESIGN,
+   AS102_PCTV_74E,
+   AS102_ELGATO_EYETV_DTT_NAME,
+   NULL /* Terminating entry */
+};
+
 struct usb_driver as102_usb_driver = {
.name   =  DRIVER_FULL_NAME,
.probe  =  as102_usb_probe,
@@ -344,6 +353,7 @@
 {
int ret;
struct as102_dev_t *as102_dev;
+   int i;
 
ENTER();
 
@@ -353,6 +363,23 @@
return -ENOMEM;
}
 
+   /* This should never actually happen */
+   if ((sizeof(as102_usb_id_table) / sizeof(struct usb_device_id)) !=
+   (sizeof(as102_device_names) / sizeof(const char *))) {
+   printk(KERN_ERR "Device names table invalid size");
+   return -EINVAL;
+   }
+
+   /* Assign the user-friendly device name */
+   for (i = 0; i < (sizeof(as102_usb_id_table) /
+sizeof(struct usb_device_id)); i++) {
+   if (id == &as102_usb_id_table[i])
+   as102_dev->name = as102_device_names[i];
+   }
+
+   if (as102_dev->name == NULL)
+   as102_dev->name = "Unknown AS102 device";
+
/* set private callback functions */
as102_dev->bus_adap.ops = &as102_priv_ops;
 
diff --git linux/drivers/staging/media/as102/as102_usb_drv.h 
linuxb/drivers/staging/media/as102/as102_usb_drv.h
--- linux/drivers/staging/media/as102/as102_usb_drv.h
+++ linuxb/drivers/staging/media/as102/as102_usb_drv.h
@@ -28,16 +28,17 @@
 /* define these values to match the supported devices */
 
 /* Abilis system: "TITAN" */
+#define AS102_REFERENCE_DESIGN "Abilis Systems DVB-Titan"
 #define AS102_USB_DEVICE_VENDOR_ID 0x1BA6
 #define AS102_USB_DEVICE_PID_0001  0x0001
 
 /* PCTV Systems: PCTV picoStick (74e) */
-#define DEVICE_FULL_NAME   "PCTV Systems : PCTV picoStick (74e)"
+#define AS102_PCTV_74E "PCTV Systems picoStick (74e)"
 #d

[RESEND PATCH 11/14] staging/media/as102: fix compile warning about unused function

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267319685 18000
# Node ID 84b93826c0a19efa114a6808165f91390cb86daa
# Parent  22ef1bdca69a2781abf397c53a0f7f6125f5359a
as102: fix compile warning about unused function

From: Devin Heitmueller 

The function in question is only used on old kernels, so we had the call to
the function #ifdef'd, but the definition of the function was stil being
included.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as102_fe.c 
linuxb/drivers/staging/media/as102/as102_fe.c
--- linux/drivers/staging/media/as102/as102_fe.c
+++ linuxb/drivers/staging/media/as102/as102_fe.c
@@ -32,6 +32,7 @@
 static void as102_fe_copy_tune_parameters(struct as10x_tune_args *dst,
  struct dvb_frontend_parameters *src);
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
 static void as102_fe_release(struct dvb_frontend *fe)
 {
struct as102_dev_t *dev;
@@ -42,7 +43,6 @@
if (dev == NULL)
return;
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
if (mutex_lock_interruptible(&dev->bus_adap.lock))
return;
 
@@ -50,7 +50,6 @@
as10x_cmd_turn_off(&dev->bus_adap);
 
mutex_unlock(&dev->bus_adap.lock);
-#endif
 
/* release frontend callback ops */
memset(&fe->ops, 0, sizeof(struct dvb_frontend_ops));
@@ -66,7 +65,6 @@
LEAVE();
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
 static int as102_fe_init(struct dvb_frontend *fe)
 {
int ret = 0;
--
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


[RESEND PATCH 12/14] staging/media/as102: fix licensing oversight

2011-10-18 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:# HG changeset patch
# User Devin Heitmueller 
# Date 1267577404 18000
# Node ID 8557cb6da3e71a350a538e3a0eb41126884289b9
# Parent  84b93826c0a19efa114a6808165f91390cb86daa
as102: fix licensing oversight

From: Pierrick Hascoet 

Fix a couple of files which were supposed by be relicensed as GPL but were
overlooked.

Priority: normal

Signed-off-by: Pierrick Hascoet 
Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

diff --git linux/drivers/staging/media/as102/as10x_cmd_cfg.c 
linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
--- linux/drivers/staging/media/as102/as10x_cmd_cfg.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_cfg.c
@@ -1,20 +1,21 @@
-/**
-
- \file   as10x_cmd_cfg.c
-
- \author: S. Martinelli
-
- \n
-   (c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n
-   www.abilis.com  \n
- \n
-
- \brief AS10x API, configuration services
-
-   AS10x cmd management: build command buffer, send command through
-   selected port and wait for the response when required.
-
-*/
+/*
+ * Abilis Systems Single DVB-T Receiver
+ * Copyright (C) 2008 Pierrick Hascoet 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 
 #if defined(LINUX) && defined(__KERNEL__) /* linux kernel implementation */
 #include 
diff --git linux/drivers/staging/media/as102/as10x_cmd_stream.c 
linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
--- linux/drivers/staging/media/as102/as10x_cmd_stream.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
@@ -1,22 +1,21 @@
-/**
-
- \file   as10x_cmd_stream.c
-
- \author: S. Martinelli
-
- \n
-   (c) Copyright Abilis Systems SARL 2005-2009 All rigths reserved \n
-   www.abilis.com  \n
- \n
-
- \brief AS10x CMD, stream services
-
-   AS10x CMD management: build command buffer, send command through
-   selected port and wait for the response when required.
-
-*/
-
-
+/*
+ * Abilis Systems Single DVB-T Receiver
+ * Copyright (C) 2008 Pierrick Hascoet 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 #if defined(LINUX) && defined(__KERNEL__) /* linux kernel implementation */
 #include 
 #include "as102_drv.h"
--
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: [RESEND PATCH 10/14] staging/media/as102: properly handle multiple product names

2011-10-18 Thread Piotr Chmura
On Tue, 18 Oct 2011 13:28:39 -0700
Joe Perches  wrote:

> On Tue, 2011-10-18 at 22:02 +0200, Piotr Chmura wrote:
> > Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/
> []
> > diff --git linux/drivers/staging/media/as102/as102_fe.c 
> > linuxb/drivers/staging/media/as102/as102_fe.c
> []
> > @@ -408,6 +408,8 @@
> >  
> > /* init frontend callback ops */
> > memcpy(&dvb_fe->ops, &as102_fe_ops, sizeof(struct dvb_frontend_ops));
> > +   strncpy(dvb_fe->ops.info.name, as102_dev->name,
> > +   sizeof(dvb_fe->ops.info.name));
> 
> strlcpy?
> 
> 

Can be, but not during moving from another repo.
There will be time for such fixes in kernel tree.
Am I right ?
--
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: [PATCH 0/14] staging/media/as102: new driver submission (was Re: [PATCH 1/7] Staging submission: PCTV 74e driver (as102)

2011-10-19 Thread Piotr Chmura



W dniu 19.10.2011 13:44, Mauro Carvalho Chehab pisze:

Em 19-10-2011 09:41, Javier Martinez Canillas escreveu:

On Tue, Oct 18, 2011 at 7:20 PM, Piotr Chmura  wrote:

On Tue, 18 Oct 2011 11:52:17 -0400
Devin Heitmueller  wrote:


On Tue, Oct 18, 2011 at 5:10 AM, Piotr Chmura  wrote:

Thanks for comments for all of you.

[PATCH 1-12/14] Following your guidelines i exported all changes from hg one by 
one. This way we will have all history in kernel tree.
I moved driver to staging/media and removed Kconfig/Makefile changes in parent 
directory in first patch.

Hello Piotr,

Not that I want to create more work for you, but it would appear that
your patches stripped off all the Signed-off-by lines for both myself
and Pierrick Hascoet (the developer from the hardware vendor).  You
have replaced them with "cc:" lines, which breaks the chain of
"Developer's Certificate of Origin".

When you take somebody else's patches, you need to preserve any
existing Signed-off-by lines, adding your own at the bottom of the
list.

In other words, the first patch should be:

Signed-off-by: Pierrick Hascoet
Signed-off-by: Devin Heitmueller
Signed-off-by: Piotr Chmura

instead of:

Signed-off-by: Piotr Chmura
Cc: Pierrick Hascoet
Cc: Devin Heitmueller

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

Ok, i'll resend them again.

Should I replay to every patch with something like [RESEND PATCH nn/mm]..., 
right ?

Peter

Hi Peter,

A common convention is to add the version of your patch in the subject like:

[PATCH v2 0/14] staging/media/as102: new driver submission

That way people can know that is actually a resend of a new patch-set
and not a resend of the last one.

Thanks, I'll do it this way next time.


Yes. Also, it seems that you've submitted only 12 patches of this 14 patch
series. Where are the other two missing patches?
13 and 14 were written by me, so they didn't suffer "signed-off-by" 
mistake. Do I need resend them too ?


Peter

--
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: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes

2011-10-29 Thread Piotr Chmura



W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:

On 10/18/2011 09:51 PM, Piotr Chmura wrote:

Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent  b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Devin Heitmueller
Signed-off-by: Piotr Chmura

Hi Piotr,

starting from this patch the series doesn't apply cleanly to
staging/for_v3.2 tree. Which branch is it based on ?

---
Thanks,
Sylwester

Hi Sylwester,

I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
kernel-3.1.0-git9+


All patches are working on newly created driver directory 
drivers/staging/media/as102 (exception is 13/14: staging/Makefile and 
staging/Kconfig) and they apply cleanly in my tree. Let me know why they 
doesn't on yours and i'll try to fix them.


Thanks,
Piotr

--
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: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes

2011-10-29 Thread Piotr Chmura



W dniu 29.10.2011 15:17, Piotr Chmura pisze:



W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:

On 10/18/2011 09:51 PM, Piotr Chmura wrote:
Patch taken from 
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/


Original source and comment:
# HG changeset patch
# User Devin Heitmueller
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent  b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Devin Heitmueller
Signed-off-by: Piotr Chmura

Hi Piotr,

starting from this patch the series doesn't apply cleanly to
staging/for_v3.2 tree. Which branch is it based on ?

---
Thanks,
Sylwester

Hi Sylwester,

I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
kernel-3.1.0-git9+


All patches are working on newly created driver directory 
drivers/staging/media/as102 (exception is 13/14: staging/Makefile and 
staging/Kconfig) and they apply cleanly in my tree. Let me know why 
they doesn't on yours and i'll try to fix them.

One more thing... patches starting from  4/14 in patchwork have

"To unsubscribe from this list: send the line "unsubscribe linux-media" in..."

on the end.

Isn't this making them wrong ?

Peter
--
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: [RESEND PATCH 4/14] staging/media/as102: checkpatch fixes

2011-10-29 Thread Piotr Chmura



W dniu 29.10.2011 18:14, Sylwester Nawrocki pisze:

Hi,

On 10/29/2011 03:17 PM, Piotr Chmura wrote:

W dniu 29.10.2011 12:22, Sylwester Nawrocki pisze:

On 10/18/2011 09:51 PM, Piotr Chmura wrote:

Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Devin Heitmueller
Signed-off-by: Piotr Chmura

Hi Piotr,

starting from this patch the series doesn't apply cleanly to
staging/for_v3.2 tree. Which branch is it based on ?

---
Thanks,
Sylwester

Hi Sylwester,

I'is based on
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
kernel-3.1.0-git9+

All patches are working on newly created driver directory 
drivers/staging/media/as102
(exception is 13/14: staging/Makefile and staging/Kconfig) and they apply 
cleanly in
my tree. Let me know why they doesn't on yours and i'll try to fix them.

I suspect the patch got mangled. The base tree shouldn't matter that much since
the patches are touching only the newly created directory.
With you previous patch set I'm getting an error at patch 5/11.


snawrocki@vostro:~/linux/media_tree$ git am -3 
RESEND-1-14-staging-media-as102-initial-import-from-Abilis.patch
Applying: staging/media/as102: initial import from Abilis
snawrocki@vostro:~/linux/media_tree$ git am -3 
RESEND-2-14-staging-media-as102-checkpatch-fixes.patch
Applying: staging/media/as102: checkpatch fixes
snawrocki@vostro:~/linux/media_tree$ git am -3 
RESEND-3-14-staging-media-as102-checkpatch-fixes.patch
Applying: staging/media/as102: checkpatch fixes
snawrocki@vostro:~/linux/media_tree$ git am -3 
RESEND-4-14-staging-media-as102-checkpatch-fixes.patch
Applying: staging/media/as102: checkpatch fixes
fatal: corrupt patch at line 664
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 staging/media/as102: checkpatch fixes
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

I've downloaded patches from patchwork, as expected by you:

dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i 
RESEND-4-14-staging-media-as102-checkpatch-fixes.patch

patching file drivers/staging/media/as102/as10x_cmd.c
patch:  malformed patch at line 664: To unsubscribe from this list: 
send the line "unsubscribe linux-media" in


after removing
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
from end of file:

dom@darkstar ~/src/kernel/linux.trynew $ patch -p1 -i 
RESEND-4-14-staging-media-as102-checkpatch-fixes.patch

patching file drivers/staging/media/as102/as10x_cmd.c

Works fine, so looks like footer of mailing list IS an issue here (there 
are less then 3 lines in patch because of end of file).



snawrocki@vostro:~/linux/media_tree$ git apply --verbose --reject 
RESEND-4-14-staging-media-as102-checkpatch-fixes.patch
fatal: corrupt patch at line 702
snawrocki@vostro:~/linux/media_tree$ git ll
cbcbb4b staging/media/as102: checkpatch fixes
acde12d staging/media/as102: checkpatch fixes
d47fc51 staging/media/as102: initial import from Abilis
...

You are not using git send-email to send the patches, are you ?


I'm not using git for sending patches.

Peter
--
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 v3 4/14] staging/media/as102: checkpatch fixes

2011-10-30 Thread Piotr Chmura
Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Original source and comment:
# HG changeset patch
# User Devin Heitmueller 
# Date 1267318701 18000
# Node ID 69c8f5172790784738bcc18f8301919ef3d5373f
# Parent  b91e96a07bee27c1d421b4c3702e33ee8075de83
as102: checkpatch fixes

From: Devin Heitmueller 

Fix make checkpatch issues reported against as10x_cmd.c.

Priority: normal

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 

Added missing empty lines at end of patch

Sylwester could you check if it applies cleanly now ?


diff --git linux/drivers/staging/media/as102/as10x_cmd.c 
linuxb/drivers/staging/media/as102/as10x_cmd.c
--- linux/drivers/staging/media/as102/as10x_cmd.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd.c
@@ -1,6 +1,7 @@
 /*
  * Abilis Systems Single DVB-T Receiver
  * Copyright (C) 2008 Pierrick Hascoet 
+ * Copyright (C) 2010 Devin Heitmueller 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +22,8 @@
 #include 
 #include "as102_drv.h"
 #elif defined(WIN32)
-   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)  /* win32 ddk 
implementation */
+   #if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
+  /* win32 ddk implementation */
   #include "wdm.h"
   #include "Device.h"
   #include "endian_mgmt.h" /* FIXME */
@@ -51,43 +53,42 @@
 */
 int as10x_cmd_turn_on(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid), sizeof(pcmd->body.turn_on.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_on.req));
 
-   /* fill command */
-   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
+   /* fill command */
+   pcmd->body.turn_on.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNON);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
-   phandle,
-   (uint8_t *) pcmd,
-   sizeof(pcmd->body.turn_on.req) + HEADER_SIZE,
-   (uint8_t *) prsp,
-   sizeof(prsp->body.turn_on.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+  sizeof(pcmd->body.turn_on.req) +
+  HEADER_SIZE,
+  (uint8_t *) prsp,
+  sizeof(prsp->body.turn_on.rsp) +
+  HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_TURNON_RSP);
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -98,42 +99,41 @@
 */
 int as10x_cmd_turn_off(as10x_handle_t *phandle)
 {
-   int error;
-   struct as10x_cmd_t *pcmd, *prsp;
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd,(++phandle->cmd_xid),sizeof(pcmd->body.turn_off.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.turn_off.req));
 
-   /* fill command */
-   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
+   /* fill command */
+   pcmd->body.turn_off.req.proc_id = cpu_to_le16(CONTROL_PROC_TURNOFF);
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(
phandle, (uint8_t *) pcmd,
sizeof(pcmd->body.turn_off.req) + HEADER_SIZE,
-(uint8_t *) prsp,
+   (uint8_t *) prsp,
sizeof(prsp->body.turn_off.rsp) + HEADER_SIZ

[PATCH v3 5/14] staging/media/as102: checkpatch fixes

2011-10-30 Thread Piotr Chmura
From: Devin Heitmueller 

Reformats as10x_cmd_stream.c to take it closer to linux format code.

Signed-off-by: Devin Heitmueller 
Signed-off-by: Piotr Chmura 
---

v3: added missing empty lines on end of patch.


diff --git linux/drivers/staging/media/as102/as10x_cmd_stream.c 
linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
--- linux/drivers/staging/media/as102/as10x_cmd_stream.c
+++ linuxb/drivers/staging/media/as102/as10x_cmd_stream.c
@@ -2,8 +2,6 @@
 
  \file   as10x_cmd_stream.c
 
- \version $Id$
-
  \author: S. Martinelli
 
  \n
@@ -53,57 +51,57 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_add_PID_filter(as10x_handle_t* phandle,
-struct as10x_ts_filter *filter) {
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+int as10x_cmd_add_PID_filter(as10x_handle_t *phandle,
+struct as10x_ts_filter *filter)
+{
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   ENTER();
+   ENTER();
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.add_pid_filter.req));
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.add_pid_filter.req));
 
-   /* fill command */
-   pcmd->body.add_pid_filter.req.proc_id = cpu_to_le16(CONTROL_PROC_SETFILTER);
-   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
-   pcmd->body.add_pid_filter.req.stream_type = filter->type;
+   /* fill command */
+   pcmd->body.add_pid_filter.req.proc_id =
+   cpu_to_le16(CONTROL_PROC_SETFILTER);
+   pcmd->body.add_pid_filter.req.pid = cpu_to_le16(filter->pid);
+   pcmd->body.add_pid_filter.req.stream_type = filter->type;
 
-   if(filter->idx < 16)
-   pcmd->body.add_pid_filter.req.idx = filter->idx;
-   else
-   pcmd->body.add_pid_filter.req.idx = 0xFF;
+   if (filter->idx < 16)
+   pcmd->body.add_pid_filter.req.idx = filter->idx;
+   else
+   pcmd->body.add_pid_filter.req.idx = 0xFF;
 
-   /* send command */
-   if(phandle->ops->xfer_cmd) {
-  error = phandle->ops->xfer_cmd(phandle,
-  (uint8_t *) pcmd,
-  sizeof(pcmd->body.add_pid_filter.req) + HEADER_SIZE,
-  (uint8_t *) prsp,
-  sizeof(prsp->body.add_pid_filter.rsp) + HEADER_SIZE);
-   }
-   else{
-  error = AS10X_CMD_ERROR;
-   }
+   /* send command */
+   if (phandle->ops->xfer_cmd) {
+   error = phandle->ops->xfer_cmd(phandle, (uint8_t *) pcmd,
+   sizeof(pcmd->body.add_pid_filter.req)
+   + HEADER_SIZE, (uint8_t *) prsp,
+   sizeof(prsp->body.add_pid_filter.rsp)
+   + HEADER_SIZE);
+   } else {
+   error = AS10X_CMD_ERROR;
+   }
 
-   if(error < 0) {
-  goto out;
-   }
+   if (error < 0)
+   goto out;
 
-   /* parse response */
-   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
+   /* parse response */
+   error = as10x_rsp_parse(prsp, CONTROL_PROC_SETFILTER_RSP);
 
-   if(error == 0) {
- /* Response OK -> get response data */
- filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
-   }
+   if (error == 0) {
+   /* Response OK -> get response data */
+   filter->idx = prsp->body.add_pid_filter.rsp.filter_id;
+   }
 
 out:
-   LEAVE();
-   return(error);
+   LEAVE();
+   return error;
 }
 
 /**
@@ -113,144 +111,138 @@
\return 0 when no error, < 0 in case of error.
\callgraph
 */
-int as10x_cmd_del_PID_filter(as10x_handle_t* phandle,
+int as10x_cmd_del_PID_filter(as10x_handle_t *phandle,
 uint16_t pid_value)
 {
+   int error;
+   struct as10x_cmd_t *pcmd, *prsp;
 
-   interror;
-   struct as10x_cmd_t *pcmd, *prsp;
+   ENTER();
 
-   ENTER();
+   pcmd = phandle->cmd;
+   prsp = phandle->rsp;
 
-   pcmd = phandle->cmd;
-   prsp = phandle->rsp;
+   /* prepare command */
+   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
+   sizeof(pcmd->body.del_pid_filter.req));
 
-   /* prepare command */
-   as10x_cmd_build(pcmd, (++phandle->cmd_xid),
-   sizeof(pcmd->body.del_pid_filter.req));
+   /* fill command */
+   pcmd->body.del_pid_filter.req.proc_id =
+   cpu_to_le16(CONTROL_PROC_REMOVEFILTER);
+   pcmd->body.del_pid_filter.req.pid = cpu_to_le16(pid

Re: [RESEND PATCH 1/14] staging/media/as102: initial import from Abilis

2011-10-30 Thread Piotr Chmura

W dniu 18.10.2011 21:46, Piotr Chmura pisze:

Patch taken from http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102-2/

Changes made by me:
1. Driver moved from media/dvb to staging/media
2. Removed Makefile/Kconfig - it doesn't compile in current tree

(...)

+
+/*
+ * Note:
+ * - in AS102 SNR=MER
+ *   - the SNR will be returned in linear terms, i.e. not in dB
+ *   - the accuracy equals ±2dB for a SNR range from 4dB to 30dB
+ *   - the accuracy is>2dB for SNR values outside this range
+ */


I found another issue here.
In this comment "±" is from upper ASCII (0xF1). Should I change it into 
sth. like "+/-" in this patch (1/14) or leave it and just resend without 
"Â" (wasn't there in original patch, don't know where it came from) ?


Peter

P.S. Thanks to Sylwester Nawrocki for pointing me out, that there is 
something wrong with patch 6/14, which was caused by this comment in 1/14.

--
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] dvb/as102 nBox DVB-T dongle

2011-07-20 Thread Piotr Chmura
I just bought DVB-T USB dongle for one of polish digital platform. It 
works fine with as102 driver.
Here is patch adding vendor and product ID to as102 driver taken from 
http://kernellabs.com/hg/~dheitmueller/v4l-dvb-as102.
I tested it with kernel-3.0-rc7-git7 (had to change usb_buffer_alloc() 
to usb_alloc_coherent and usb_buffer_free to usb_free_coherent() ).


patch:

diff -Nur linux/drivers/media/dvb/as102/as102_usb_drv.c 
linux-mine/drivers/media/dvb/as102/as102_usb_drv.c

--- as102/as102_usb_drv.c2011-07-20 21:37:33.924143297 +0200
+++ /usr/src/linux/drivers/media/dvb/as102/as102_usb_drv.c2011-07-20 
20:40:21.0 +0200

@@ -39,6 +39,7 @@
 static struct usb_device_id as102_usb_id_table[] = {
 { USB_DEVICE(AS102_USB_DEVICE_VENDOR_ID, AS102_USB_DEVICE_PID_0001) },
 { USB_DEVICE(PCTV_74E_USB_VID, PCTV_74E_USB_PID) },
+{ USB_DEVICE(NBOX_USB_VID, NBOX_USB_PID) },
 { USB_DEVICE(ELGATO_EYETV_DTT_USB_VID, ELGATO_EYETV_DTT_USB_PID) },
 { } /* Terminating entry */
 };
@@ -48,6 +49,7 @@
 static const char *as102_device_names[] = {
 AS102_REFERENCE_DESIGN,
 AS102_PCTV_74E,
+AS102_NBOX,
 AS102_ELGATO_EYETV_DTT_NAME,
 NULL /* Terminating entry */
 };
diff -Nur linux/drivers/media/dvb/as102/as102_usb_drv.h 
linux-mine/drivers/media/dvb/as102/as102_usb_drv.h

--- as102/as102_usb_drv.h2011-07-20 21:37:33.925143297 +0200
+++ /usr/src/linux/drivers/media/dvb/as102/as102_usb_drv.h2011-07-20 
20:39:46.0 +0200

@@ -36,6 +36,11 @@
 #define PCTV_74E_USB_VID0x2013
 #define PCTV_74E_USB_PID0x0246

+/* nBox DVB-T Stick */
+#define AS102_NBOX"nBox DVB-T Stick"
+#define NBOX_USB_VID0x0b89
+#define NBOX_USB_PID0x0007
+
 /* Elgato: EyeTV DTT Deluxe */
 #define AS102_ELGATO_EYETV_DTT_NAME"Elgato EyeTV DTT Deluxe"
 #define ELGATO_EYETV_DTT_USB_VID0x0fd9


--
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