Re: Gigabyte 8300

2010-09-02 Thread Joel Wiramu Pauling
What sort of afatech chip?

af9035 are not supported at all. Only af9015's which are in the older devices.

On 3 September 2010 12:55, Dagur Ammendrup  wrote:
> Hi,
>
> I bought a Gigabyte U8300 today which is a hybrid USB tuner. These are
> the specifications according to the manufacturer:
>
> Analog: TVPAL / SECAM / NTSC
> Decoder chip: Conexant CX23102
> Digital TV: DVB-T
> Interface: USB 2.0
> Others Support: Microsoft® Windows 2000, XP, MCE and Windows Vista MCE
> / Win 7 32/ 64bits
> Remote sensor Interface: IR
> Tuner: NXP TDA18271
>
> Now I know that the decoder chip is supported in other USB sticks but
> mine is not recognised. Here is my lsusb output:
>
> Bus 001 Device 004: ID 1b80:d416 Afatech
>
> And here is the dmesg info I get when I plug it in:
>
> [ 2981.693805] usb 1-2: USB disconnect, address 2
> [ 2991.760091] usb 1-2: new high speed USB device using ehci_hcd and address 4
> [ 2991.916044] usb 1-2: configuration #1 chosen from 1 choice
>
>
> Is there anyone out there who might be interested in adding support
> for this (or guide me through it)?
>
>
> thanks,
> Dagur
> --
> 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


Re: cx23885: Message Signaled Interrupts issue

2010-09-02 Thread Igor M. Liplianin
В сообщении от 3 сентября 2010 04:36:09 автор Andy Walls написал:
> On Tue, 2010-08-31 at 01:22 +0300, Igor M. Liplianin wrote:
> > I was wondering, if someone tried 2.6.36-rc kernels with PCIe MSI
> > enabled. With TeVii s470 after rmmod cx23885 && insmod cx23885 then szap
> > some channel I have 'No irq handler for vector' message. After reboot
> > it's OK.
> > I think it's A/V core interrupts involved.
> 
> Hmm.  A/V core interrupts aren't turned on for IR by default for the
> TeVii S470 (you have to use a module option to turn on the IR for the
> TeVii S470).  I can't recall if Steven's changes enabled A/V core
> interrupts.
No, his changes not enabled A/V core interrupts.
BTW, the same code works properly without MSI. 

> 
> I'll have to look sometime this weekend, if the hurricane doesn't knock
> out the electricity.
> 
> Regards,
> Andy
> 
> > i...@useri:~$ szap -l10750 bridge-tv -p
> > reading channels from file '/home/igor/.szap/channels.conf'
> > zapping to 5 'bridge-tv':
> > sat 1, frequency = 12303 MHz H, symbolrate 2750, vpid = 0x0134, apid
> > = 0x0100 sid = 0x003b using '/dev/dvb/adapter0/frontend0' and
> > '/dev/dvb/adapter0/demux0'
> > 
> > Message from sysl...@localhost at Tue Aug 31 00:55:32 2010 ...
> > localhost kernel: do_IRQ: 1.137 No irq handler for vector (irq -1)
> > 
> > Message from sysl...@localhost at Tue Aug 31 00:55:33 2010 ...
> > localhost kernel: do_IRQ: 0.137 No irq handler for vector (irq -1)
> > 
> > Message from sysl...@localhost at Tue Aug 31 00:55:34 2010 ...
> > localhost kernel: do_IRQ: 1.137 No irq handler for vector (irq -1)
> > 
> > Message from sysl...@localhost at Tue Aug 31 00:55:35 2010 ...
> > localhost kernel: do_IRQ: 0.137 No irq handler for vector (irq -1)
> > 
> > 
> > It is similar issue with NetUP DVB-S2 , but CI involved through GPIO
> > interrupts. Compro e650f works well, though it uses neither A/V core
> > interrupts nor GPIO interrupts.

-- 
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
--
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: cx23885: Message Signaled Interrupts issue

2010-09-02 Thread Andy Walls
On Tue, 2010-08-31 at 01:22 +0300, Igor M. Liplianin wrote:
> I was wondering, if someone tried 2.6.36-rc kernels with PCIe MSI enabled.
> With TeVii s470 after rmmod cx23885 && insmod cx23885 then szap some channel 
> I have 'No irq 
> handler for vector' message. After reboot it's OK.
> I think it's A/V core interrupts involved.

Hmm.  A/V core interrupts aren't turned on for IR by default for the
TeVii S470 (you have to use a module option to turn on the IR for the
TeVii S470).  I can't recall if Steven's changes enabled A/V core
interrupts.

I'll have to look sometime this weekend, if the hurricane doesn't knock
out the electricity.

Regards,
Andy

> i...@useri:~$ szap -l10750 bridge-tv -p
> reading channels from file '/home/igor/.szap/channels.conf'
> zapping to 5 'bridge-tv':
> sat 1, frequency = 12303 MHz H, symbolrate 2750, vpid = 0x0134, apid = 
> 0x0100 sid = 0x003b
> using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
> 
> Message from sysl...@localhost at Tue Aug 31 00:55:32 2010 ...
> localhost kernel: do_IRQ: 1.137 No irq handler for vector (irq -1)
> 
> Message from sysl...@localhost at Tue Aug 31 00:55:33 2010 ...
> localhost kernel: do_IRQ: 0.137 No irq handler for vector (irq -1)
> 
> Message from sysl...@localhost at Tue Aug 31 00:55:34 2010 ...
> localhost kernel: do_IRQ: 1.137 No irq handler for vector (irq -1)
> 
> Message from sysl...@localhost at Tue Aug 31 00:55:35 2010 ...
> localhost kernel: do_IRQ: 0.137 No irq handler for vector (irq -1)
> 
> 
> It is similar issue with NetUP DVB-S2 , but CI involved through GPIO 
> interrupts.
> Compro e650f works well, though it uses neither A/V core interrupts nor GPIO 
> interrupts.
> 
> 


--
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: cx23885: Support for IR-Remote on boad TBV-6920

2010-09-02 Thread Andy Walls
On Mon, 2010-08-30 at 23:26 +0200, Simon Waid wrote:
> Hello!
> 
> I am trying to get the remote control of my DVB 6920 (cx23885) to work. 
> 
> I found out that the wiring of the sensor is the same as on the TiVii
> S470, so there is little work to be done. Unfortunately, the IR part of
> cx23885 driver inside the kernel is buggy. You fixed that, right? Could
> you please give me access to your current cx23885 driver? 

I wrote the CX2388[58] integrated IR controller portion of the cx23885
IR driver changes.

They are in media_tree.git on the staging/v2.6.36 branch:

http://git.linuxtv.org/media_tree.git?a=shortlog;h=refs/heads/staging/v2.6.36

Note that Igor experienced continual interrupts with the IR on the TeVii
S470, but I didn't have a problem with the HVR-1250.  So the IR for the
TeVii S470 is disabled by default and can be re-enabled with a module
option. /sbin/modinfo cx23885

You can use the code snippets for the S470 and build IR support for your
card, provided it has a CX23885 chip, and see what happens.  If your
card has a CX23888 chip, you'll have to use some IR setup code similar
to what the Hauppauge cards used.


I still have more work to do on the cx23885 integrated IR, but it should
be good enough for now.  If you have a CX23885 chip, be prepared for
continual interrupts to make your system unusable: blacklist the cx23885
module in /etc/modprobe.conf before testing.

Regards,
Andy

> Best regards,
> Simon Waid


--
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] gspca_cpia1: Add lamp control for Intel Play QX3 microscope

2010-09-02 Thread Andy Walls
# HG changeset patch
# User Andy Walls 
# Date 1283475832 14400
# Node ID 0d251a2976b46e11cc817207de191896718b93a3
# Parent  a4c762698bcb138982b81cf59e5bc4b7155866a9
gspca_cpia1: Add lamp cotrol for Intel Play QX3 microscope

From: Andy Walls 

Add a v4l2 control to get the lamp control code working for the Intel Play
QX3 microscope.  My daughter in middle school thought it was cool, and is now
examining the grossest specimens she can find.

Priority: normal

Signed-off-by: Andy Walls 

diff -r a4c762698bcb -r 0d251a2976b4 linux/drivers/media/video/gspca/cpia1.c
--- a/linux/drivers/media/video/gspca/cpia1.c   Wed Aug 25 16:13:54 2010 -0300
+++ b/linux/drivers/media/video/gspca/cpia1.c   Thu Sep 02 21:03:52 2010 -0400
@@ -333,8 +333,8 @@
} format;
struct {/* Intel QX3 specific data */
u8 qx3_detected;/* a QX3 is present */
-   u8 toplight;/* top light lit , R/W */
-   u8 bottomlight; /* bottom light lit, R/W */
+   u8 toplamp; /* top lamp lit , R/W */
+   u8 bottomlamp;  /* bottom lamp lit, R/W */
u8 button;  /* snapshot button pressed (R/O) */
u8 cradled; /* microscope is in cradle (R/O) */
} qx3;
@@ -373,6 +373,8 @@
 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
 static int sd_setcomptarget(struct gspca_dev *gspca_dev, __s32 val);
 static int sd_getcomptarget(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_setlamps(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_getlamps(struct gspca_dev *gspca_dev, __s32 *val);
 
 static const struct ctrl sd_ctrls[] = {
{
@@ -447,6 +449,20 @@
.set = sd_setcomptarget,
.get = sd_getcomptarget,
},
+   {
+   {
+#define V4L2_CID_LAMPS (V4L2_CID_PRIVATE_BASE+1)
+   .id  = V4L2_CID_LAMPS,
+   .type= V4L2_CTRL_TYPE_MENU,
+   .name= "Lamps",
+   .minimum = 0,
+   .maximum = 3,
+   .step= 1,
+   .default_value = 0,
+   },
+   .set = sd_setlamps,
+   .get = sd_getlamps,
+   },
 };
 
 static const struct v4l2_pix_format mode[] = {
@@ -766,8 +782,8 @@
params->compressionTarget.targetQ = 5; /* From windows driver */
 
params->qx3.qx3_detected = 0;
-   params->qx3.toplight = 0;
-   params->qx3.bottomlight = 0;
+   params->qx3.toplamp = 0;
+   params->qx3.bottomlamp = 0;
params->qx3.button = 0;
params->qx3.cradled = 0;
 }
@@ -1059,17 +1075,16 @@
  0, sd->params.streamStartLine, 0, 0);
 }
 
-#if 0 /* Currently unused */ /* keep */
-static int command_setlights(struct gspca_dev *gspca_dev)
+static int command_setlamps(struct gspca_dev *gspca_dev)
 {
struct sd *sd = (struct sd *) gspca_dev;
-   int ret, p1, p2;
+   int ret, p;
 
if (!sd->params.qx3.qx3_detected)
return 0;
 
-   p1 = (sd->params.qx3.bottomlight == 0) << 1;
-   p2 = (sd->params.qx3.toplight == 0) << 3;
+   p  = (sd->params.qx3.toplamp== 0) ? 0x8 : 0;
+   p |= (sd->params.qx3.bottomlamp == 0) ? 0x2 : 0;
 
ret = do_command(gspca_dev, CPIA_COMMAND_WriteVCReg,
 0x90, 0x8F, 0x50, 0);
@@ -1077,9 +1092,8 @@
return ret;
 
return do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, 2, 0,
- p1 | p2 | 0xE0, 0);
+ p | 0xE0, 0);
 }
-#endif
 
 static int set_flicker(struct gspca_dev *gspca_dev, int on, int apply)
 {
@@ -1932,6 +1946,27 @@
return 0;
 }
 
+static int sd_setlamps(struct gspca_dev *gspca_dev, __s32 val)
+{
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   sd->params.qx3.toplamp= (val & 0x2) ? 1 : 0;
+   sd->params.qx3.bottomlamp = (val & 0x1) ? 1 : 0;
+
+   if (sd->params.qx3.qx3_detected)
+   return command_setlamps(gspca_dev);
+
+   return 0;
+}
+
+static int sd_getlamps(struct gspca_dev *gspca_dev, __s32 *val)
+{
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   *val = (sd->params.qx3.toplamp << 1) | (sd->params.qx3.bottomlamp << 0);
+   return 0;
+}
+
 static int sd_querymenu(struct gspca_dev *gspca_dev,
struct v4l2_querymenu *menu)
 {
@@ -1959,6 +1994,22 @@
return 0;
}
break;
+   case V4L2_CID_LAMPS:
+   switch (menu->index) {
+   case 0:
+   strcpy((char *) menu->name, "Off");
+   return 0;
+   case 1:
+   strcpy((char *) menu->name, "Bottom");
+   return 0;
+   case 2:
+   strcpy((char *) menu->name, "Top")

Gigabyte 8300

2010-09-02 Thread Dagur Ammendrup
Hi,

I bought a Gigabyte U8300 today which is a hybrid USB tuner. These are
the specifications according to the manufacturer:

Analog: TVPAL / SECAM / NTSC
Decoder chip: Conexant CX23102
Digital TV: DVB-T
Interface: USB 2.0
Others Support: Microsoft® Windows 2000, XP, MCE and Windows Vista MCE
/ Win 7 32/ 64bits
Remote sensor Interface: IR
Tuner: NXP TDA18271

Now I know that the decoder chip is supported in other USB sticks but
mine is not recognised. Here is my lsusb output:

Bus 001 Device 004: ID 1b80:d416 Afatech

And here is the dmesg info I get when I plug it in:

[ 2981.693805] usb 1-2: USB disconnect, address 2
[ 2991.760091] usb 1-2: new high speed USB device using ehci_hcd and address 4
[ 2991.916044] usb 1-2: configuration #1 chosen from 1 choice


Is there anyone out there who might be interested in adding support
for this (or guide me through it)?


thanks,
Dagur
--
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 6/7] IR: extend ir_raw_event and do refactoring

2010-09-02 Thread David Härdeman
On Fri, Sep 03, 2010 at 12:20:54AM +0300, Maxim Levitsky wrote:
> Also in the future I think I should make the
> ir_raw_event_store_with_filter the default submit function for all
> drivers, and then I could drop that silly '_with_filter" thing
> (Couldn't think for a better name for this function...)

I agree. Perhaps it would even be possible to merge 
ir_raw_event_store_with_filter and ir_raw_event_store. The automatic 
merger of consecutive pulse-pulse events or space-space events should 
help simplify some drivers...

> > Wouldn't DEFINE_RAW_EVENT(ev); be more in line with the kernel 
> > coding style? (cf. DEFINE_MUTEX, DEFINE_SPINLOCK, etc).
> Of course, nothing against that.

DEFINE_RC_RAW_EVENT() is probably better by the way...

-- 
David Härdeman
--
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 6/7] IR: extend ir_raw_event and do refactoring

2010-09-02 Thread Maxim Levitsky
On Thu, 2010-09-02 at 22:56 +0200, David Härdeman wrote: 
> On Mon, Aug 30, 2010 at 11:52:26AM +0300, Maxim Levitsky wrote:
> > Add new event types for timeout & carrier report
> > Move timeout handling from ir_raw_event_store_with_filter to
> > ir-lirc-codec, where it is really needed.
> 
> Yes, but it still might make more sense to keep the timeout handling in 
> ir_raw_event_store_with_filter so that all decoders get the same data 
> from rc-core?
I don't want any timeouts in rc-core. There is just an IR packet that
starts optionally with a reset and ends with a timeout bit.
I have also nothing against renaming reset/timeout to start/stop.

rc-core really shouldn't care about consistent pulse/space ordering.
Its lirc that needs it.

Also in the future I think I should make the
ir_raw_event_store_with_filter the default submit function for all
drivers, and then I could drop that silly '_with_filter" thing
(Couldn't think for a better name for this function...)

> 
> > Now lirc bridge ensures proper gap handling.
> > Extend lirc bridge for carrier & timeout reports
> > 
> > Note: all new ir_raw_event variables now should be initialized
> > like that:
> > struct ir_raw_event ev = ir_new_event;
> 
> Wouldn't DEFINE_RAW_EVENT(ev); be more in line with the kernel coding 
> style? (cf. DEFINE_MUTEX, DEFINE_SPINLOCK, etc).
Of course, nothing against that.


Best regards,
Maxim Levitsky

--
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 6/7] IR: extend ir_raw_event and do refactoring

2010-09-02 Thread David Härdeman
On Mon, Aug 30, 2010 at 11:52:26AM +0300, Maxim Levitsky wrote:
> Add new event types for timeout & carrier report
> Move timeout handling from ir_raw_event_store_with_filter to
> ir-lirc-codec, where it is really needed.

Yes, but it still might make more sense to keep the timeout handling in 
ir_raw_event_store_with_filter so that all decoders get the same data 
from rc-core?

> Now lirc bridge ensures proper gap handling.
> Extend lirc bridge for carrier & timeout reports
> 
> Note: all new ir_raw_event variables now should be initialized
> like that:
> struct ir_raw_event ev = ir_new_event;

Wouldn't DEFINE_RAW_EVENT(ev); be more in line with the kernel coding 
style? (cf. DEFINE_MUTEX, DEFINE_SPINLOCK, etc).

-- 
David Härdeman
--
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/5] rc-core: ir-core to rc-core conversion

2010-09-02 Thread David Härdeman
On Thu, Sep 02, 2010 at 10:29:50PM +0200, David Härdeman wrote:
> This is my current patch queue, the main change is to make struct rc_dev
> the primary interface for rc drivers and to abstract away the fact that
> there's an input device lurking in there somewhere. The first three
> patches in the set are preparations for the change.

And I forgot to mention it, but the patches are now against media_tree, 
branch staging/v2.6.37...

-- 
David Härdeman
--
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/5] imon: split mouse events to a separate input dev

2010-09-02 Thread David Härdeman
This is a stab at separating the mouse (and front panel/knob) events
out to a separate input device. This is necessary in preparation for
the next patch which makes the rc-core input dev opaque to rc
drivers.

I can't verify the correctness of the patch beyond the fact that it
compiles without warnings. The driver has resisted most of my
attempts at understanding it properly...for example, the double calls
to le64_to_cpu() and be64_to_cpu() which are applied in
imon_incoming_packet() and imon_panel_key_lookup() would amount
to a bswab64() call, irregardless of the cpu endianness, and I think
the code wouldn't have worked on a big-endian machine...

Signed-off-by: David Härdeman 
---
 drivers/media/IR/imon.c |  261 +++
 1 files changed, 150 insertions(+), 111 deletions(-)

diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index c185422..e1e0ca1 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -121,21 +121,27 @@ struct imon_context {
u16 vendor; /* usb vendor ID */
u16 product;/* usb product ID */
 
-   struct input_dev *idev; /* input device for remote */
+   struct input_dev *rdev; /* input device for remote */
+   struct input_dev *idev; /* input device for front panel/knob and
+* remote (fake) mouse
+*/
struct input_dev *touch;/* input device for touchscreen */
 
u32 kc; /* current input keycode */
u32 last_keycode;   /* last reported input keycode */
+   u32 rc_scancode;/* the computed remote scancode */
+   u8 rc_toggle;   /* the computed remote toggle */
u64 ir_type;/* iMON or MCE (RC6) IR protocol? */
-   u8 mce_toggle_bit;  /* last mce toggle bit */
bool release_code;  /* some keys send a release code */
 
u8 display_type;/* store the display type */
bool pad_mouse; /* toggle kbd(0)/mouse(1) mode */
 
+   char name_rdev[128];/* rc device name */
+   char phys_rdev[64]; /* rc device phys path */
+
char name_idev[128];/* input device name */
char phys_idev[64]; /* input device phys path */
-   struct timer_list itimer;   /* input device timer, need for rc6 */
 
char name_touch[128];   /* touch screen name */
char phys_touch[64];/* touch screen phys path */
@@ -956,17 +962,6 @@ static void usb_tx_callback(struct urb *urb)
 }
 
 /**
- * mce/rc6 keypresses have no distinct release code, use timer
- */
-static void imon_mce_timeout(unsigned long data)
-{
-   struct imon_context *ictx = (struct imon_context *)data;
-
-   input_report_key(ictx->idev, ictx->last_keycode, 0);
-   input_sync(ictx->idev);
-}
-
-/**
  * report touchscreen input
  */
 static void imon_touch_display_timeout(unsigned long data)
@@ -1006,9 +1001,6 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
ir_proto_packet[0] = 0x01;
pad_mouse = false;
-   init_timer(&ictx->itimer);
-   ictx->itimer.data = (unsigned long)ictx;
-   ictx->itimer.function = imon_mce_timeout;
break;
case IR_TYPE_UNKNOWN:
case IR_TYPE_OTHER:
@@ -1147,20 +1139,21 @@ static int stabilize(int a, int b, u16 timeout, u16 
threshold)
return result;
 }
 
-static u32 imon_remote_key_lookup(struct imon_context *ictx, u32 hw_code)
+static u32 imon_remote_key_lookup(struct imon_context *ictx, u32 scancode)
 {
-   u32 scancode = be32_to_cpu(hw_code);
u32 keycode;
u32 release;
bool is_release_code = false;
 
/* Look for the initial press of a button */
-   keycode = ir_g_keycode_from_table(ictx->idev, scancode);
+   keycode = ir_g_keycode_from_table(ictx->rdev, scancode);
+   ictx->rc_toggle = 0x0;
+   ictx->rc_scancode = scancode;
 
/* Look for the release of a button */
if (keycode == KEY_RESERVED) {
release = scancode & ~0x4000;
-   keycode = ir_g_keycode_from_table(ictx->idev, release);
+   keycode = ir_g_keycode_from_table(ictx->rdev, release);
if (keycode != KEY_RESERVED)
is_release_code = true;
}
@@ -1170,9 +1163,8 @@ static u32 imon_remote_key_lookup(struct imon_context 
*ictx, u32 hw_code)
return keycode;
 }
 
-static u32 imon_mce_key_lookup(struct imon_context *ictx, u32 hw_code)
+static u32 imon_mce_key_lookup(struct imon_context *ictx, u32 scancode)
 {
-   u32 scancode = be32_to_cpu(hw_code);
u32 keycode;
 
 #define MCE_

[PATCH 2/5] rc-core: remove remaining users of the ir-functions keyhandlers

2010-09-02 Thread David Härdeman
This patch removes the remaining usages of the ir_input_nokey() and
ir_input_keydown() functions provided by drivers/media/IR/ir-functions.c
by using the corresponding functionality in rc-core directly instead.

Signed-off-by: David Härdeman 
---
 drivers/media/IR/ir-functions.c |   98 ++-
 drivers/media/IR/rc-core.c  |  115 ---
 drivers/media/video/bt8xx/bttv-input.c  |   27 ++
 drivers/media/video/bt8xx/bttvp.h   |1 
 drivers/media/video/cx18/cx18-i2c.c |1 
 drivers/media/video/cx88/cx88-input.c   |   24 ++
 drivers/media/video/ir-kbd-i2c.c|   14 ---
 drivers/media/video/ivtv/ivtv-i2c.c |3 -
 drivers/media/video/saa7134/saa7134-input.c |   50 ++--
 drivers/staging/tm6000/tm6000-input.c   |   12 +--
 include/media/ir-common.h   |   30 +--
 include/media/ir-core.h |2 
 include/media/ir-kbd-i2c.h  |4 -
 13 files changed, 131 insertions(+), 250 deletions(-)

diff --git a/drivers/media/IR/ir-functions.c b/drivers/media/IR/ir-functions.c
index db591e4..5fb7d0c 100644
--- a/drivers/media/IR/ir-functions.c
+++ b/drivers/media/IR/ir-functions.c
@@ -1,7 +1,7 @@
 /*
- *
- * some common structs and functions to handle infrared remotes via
- * input layer ...
+ * some common functions to handle infrared remote protocol decoding for
+ * drivers which have not yet been (or can't be) converted to use the
+ * regular protocol decoders...
  *
  * (c) 2003 Gerd Knorr  [SuSE Labs]
  *
@@ -31,67 +31,6 @@
 MODULE_AUTHOR("Gerd Knorr  [SuSE Labs]");
 MODULE_LICENSE("GPL");
 
-static int repeat = 1;
-module_param(repeat, int, 0444);
-MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)");
-
-/* -- 
*/
-
-static void ir_input_key_event(struct input_dev *dev, struct ir_input_state 
*ir)
-{
-   if (KEY_RESERVED == ir->keycode) {
-   printk(KERN_INFO "%s: unknown key: key=0x%02x down=%d\n",
-  dev->name, ir->ir_key, ir->keypressed);
-   return;
-   }
-   IR_dprintk(1,"%s: key event code=%d down=%d\n",
-   dev->name,ir->keycode,ir->keypressed);
-   input_report_key(dev,ir->keycode,ir->keypressed);
-   input_sync(dev);
-}
-
-/* -- 
*/
-
-int ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
- const u64 ir_type)
-{
-   ir->ir_type = ir_type;
-
-   if (repeat)
-   set_bit(EV_REP, dev->evbit);
-
-   return 0;
-}
-EXPORT_SYMBOL_GPL(ir_input_init);
-
-
-void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir)
-{
-   if (ir->keypressed) {
-   ir->keypressed = 0;
-   ir_input_key_event(dev,ir);
-   }
-}
-EXPORT_SYMBOL_GPL(ir_input_nokey);
-
-void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir,
- u32 ir_key)
-{
-   u32 keycode = ir_g_keycode_from_table(dev, ir_key);
-
-   if (ir->keypressed && ir->keycode != keycode) {
-   ir->keypressed = 0;
-   ir_input_key_event(dev,ir);
-   }
-   if (!ir->keypressed) {
-   ir->ir_key  = ir_key;
-   ir->keycode = keycode;
-   ir->keypressed = 1;
-   ir_input_key_event(dev,ir);
-   }
-}
-EXPORT_SYMBOL_GPL(ir_input_keydown);
-
 /* -- 
*/
 /* extract mask bits out of data and pack them into the result */
 u32 ir_extract_bits(u32 data, u32 mask)
@@ -284,7 +223,7 @@ void ir_rc5_timer_end(unsigned long data)
 {
struct card_ir *ir = (struct card_ir *)data;
struct timeval tv;
-   unsigned long current_jiffies, timeout;
+   unsigned long current_jiffies;
u32 gap;
u32 rc5 = 0;
 
@@ -325,32 +264,11 @@ void ir_rc5_timer_end(unsigned long data)
u32 toggle = RC5_TOGGLE(rc5);
u32 instr = RC5_INSTR(rc5);
 
-   /* Good code, decide if repeat/repress */
-   if (toggle != RC5_TOGGLE(ir->last_rc5) ||
-   instr != RC5_INSTR(ir->last_rc5)) {
-   IR_dprintk(1, "ir-common: instruction %x, 
toggle %x\n", instr,
-   toggle);
-   ir_input_nokey(ir->dev, &ir->ir);
-   ir_input_keydown(ir->dev, &ir->ir, instr);
-   }
-
-   /* Set/reset key-up timer */
-   timeout = current_jiffies +
- msecs_to_jiffies(ir->rc5_key_timeout);
-   mod_timer(&ir->timer_keyup, timeout);
-
-   /* Save code for repeat test */
-  

[PATCH 0/5] rc-core: ir-core to rc-core conversion

2010-09-02 Thread David Härdeman
This is my current patch queue, the main change is to make struct rc_dev
the primary interface for rc drivers and to abstract away the fact that
there's an input device lurking in there somewhere. The first three
patches in the set are preparations for the change.

I've also converted winbond-cir over to rc-core.

Given the changes, these patches touch every single driver. Obviously I
haven't tested them all due to a lack of hardware (I have made sure that
all drivers compile without any warnings and I have tested the end result
on mceusb and winbond-cir hardware).

---

David Härdeman (5):
  rc-code: merge and rename ir-core
  rc-core: remove remaining users of the ir-functions keyhandlers
  imon: split mouse events to a separate input dev
  rc-core: make struct rc_dev the primary interface for rc drivers
  rc-core: convert winbond-cir


 drivers/input/misc/Kconfig  |   18 
 drivers/input/misc/Makefile |1 
 drivers/input/misc/winbond-cir.c| 1608 ---
 drivers/media/IR/Kconfig|   17 
 drivers/media/IR/Makefile   |4 
 drivers/media/IR/ene_ir.c   |  121 +-
 drivers/media/IR/ene_ir.h   |3 
 drivers/media/IR/imon.c |  267 +++-
 drivers/media/IR/ir-core-priv.h |   26 
 drivers/media/IR/ir-functions.c |   98 --
 drivers/media/IR/ir-jvc-decoder.c   |   13 
 drivers/media/IR/ir-keytable.c  |  565 -
 drivers/media/IR/ir-lirc-codec.c|  111 +-
 drivers/media/IR/ir-nec-decoder.c   |   15 
 drivers/media/IR/ir-raw-event.c |  379 --
 drivers/media/IR/ir-rc5-decoder.c   |   13 
 drivers/media/IR/ir-rc6-decoder.c   |   17 
 drivers/media/IR/ir-sony-decoder.c  |   11 
 drivers/media/IR/ir-sysfs.c |  340 --
 drivers/media/IR/mceusb.c   |   93 +-
 drivers/media/IR/rc-core.c  | 1316 ++
 drivers/media/IR/rc-map.c   |  107 --
 drivers/media/IR/streamzap.c|   75 +
 drivers/media/IR/winbond-cir.c  |  934 
 drivers/media/dvb/dm1105/dm1105.c   |   40 -
 drivers/media/dvb/dvb-usb/dib0700.h |2 
 drivers/media/dvb/dvb-usb/dib0700_core.c|   11 
 drivers/media/dvb/dvb-usb/dib0700_devices.c |  116 +-
 drivers/media/dvb/dvb-usb/dvb-usb-remote.c  |   78 +
 drivers/media/dvb/dvb-usb/dvb-usb.h |   12 
 drivers/media/dvb/mantis/mantis_common.h|4 
 drivers/media/dvb/mantis/mantis_input.c |   74 +
 drivers/media/dvb/siano/smscoreapi.c|2 
 drivers/media/dvb/siano/smsir.c |   52 -
 drivers/media/dvb/siano/smsir.h |3 
 drivers/media/dvb/ttpci/budget-ci.c |   49 -
 drivers/media/video/bt8xx/bttv-input.c  |   68 -
 drivers/media/video/bt8xx/bttvp.h   |1 
 drivers/media/video/cx18/cx18-i2c.c |1 
 drivers/media/video/cx23885/cx23885-input.c |   64 +
 drivers/media/video/cx23885/cx23885.h   |3 
 drivers/media/video/cx88/cx88-input.c   |   86 +
 drivers/media/video/em28xx/em28xx-input.c   |   72 +
 drivers/media/video/ir-kbd-i2c.c|   39 -
 drivers/media/video/ivtv/ivtv-i2c.c |3 
 drivers/media/video/saa7134/saa7134-input.c |  122 +-
 drivers/staging/tm6000/tm6000-input.c   |   97 +-
 include/media/ir-common.h   |   33 -
 include/media/ir-core.h |  193 +--
 include/media/ir-kbd-i2c.h  |6 
 50 files changed, 3171 insertions(+), 4212 deletions(-)
 delete mode 100644 drivers/input/misc/winbond-cir.c
 delete mode 100644 drivers/media/IR/ir-keytable.c
 delete mode 100644 drivers/media/IR/ir-raw-event.c
 delete mode 100644 drivers/media/IR/ir-sysfs.c
 create mode 100644 drivers/media/IR/rc-core.c
 delete mode 100644 drivers/media/IR/rc-map.c
 create mode 100644 drivers/media/IR/winbond-cir.c

-- 
David Härdeman
--
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] Support or LME2510(C) DM04/QQBOX USB DVB-S BOXES.

2010-09-02 Thread tvbox
DM04/QQBOX DVB-S USB BOX with LME2510C+SHARP:BS2F7HZ7395 or 
LME2510+LGTDQT-P001F tuner.

patch also requires patches.

140351 Support for Sharp IX2505V (marked B0017) DVB-S silicon tuner

140361 STV0288 Incorrect bit sample for Vitterbi status.

These patches should be applied to v4l-dvb-a4c762698bcb.

Patch 116279 also needs to be applied.

Signed-off-by: Malcolm Priestley 


diff --git a/Documentation/dvb/get_dvb_firmware 
b/Documentation/dvb/get_dvb_firmware
index 239cbdb..f9f8b50 100755
--- a/Documentation/dvb/get_dvb_firmware
+++ b/Documentation/dvb/get_dvb_firmware
@@ -26,7 +26,8 @@ use IO::Handle;
"dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004",
"or51211", "or51132_qam", "or51132_vsb", "bluebird",
"opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718",
-   "af9015", "ngene");
+   "af9015", "ngene", "lme2510_lg", "lme2510c_s7395",
+   "lme2510c_s7395_old");
 
 # Check args
 syntax() if (scalar(@ARGV) != 1);
@@ -567,6 +568,48 @@ sub ngene {
 "$file1, $file2";
 }
 
+sub lme2510_lg {
+my $sourcefile = "LMEBDA_DVBS.sys";
+my $hash = "fc6017ad01e79890a97ec53bea157ed2";
+my $outfile = "dvb-usb-lme2510-lg.fw";
+my $hasho = "caa065d5fdbd2c09ad57b399bbf55cad";
+
+checkstandard();
+
+verify($sourcefile, $hash);
+extract($sourcefile, 4168, 3841, $outfile);
+verify($outfile, $hasho);
+$outfile;
+}
+
+sub lme2510c_s7395 {
+my $sourcefile = "US2A0D.sys";
+my $hash = "b0155a8083fb822a3bd47bc360e74601";
+my $outfile = "dvb-usb-lme2510c-s7395.fw";
+my $hasho = "3a3cf1aeebd17b6ddc04cebe131e94cf";
+
+checkstandard();
+
+verify($sourcefile, $hash);
+extract($sourcefile, 37248, 3720, $outfile);
+verify($outfile, $hasho);
+$outfile;
+}
+
+sub lme2510c_s7395_old {
+my $sourcefile = "LMEBDA_DVBS7395C.sys";
+my $hash = "7572ae0eb9cdf91baabd7c0ba9e09b31";
+my $outfile = "dvb-usb-lme2510c-s7395.fw";
+my $hasho = "90430c5b435eb5c6f88fd44a9d950674";
+
+checkstandard();
+
+verify($sourcefile, $hash);
+extract($sourcefile, 4208, 3881, $outfile);
+verify($outfile, $hasho);
+$outfile;
+}
+
 # ---
 # Utilities
 
diff --git a/Documentation/dvb/lmedm04.txt b/Documentation/dvb/lmedm04.txt
new file mode 100644
index 000..4bde457
--- /dev/null
+++ b/Documentation/dvb/lmedm04.txt
@@ -0,0 +1,55 @@
+To extract firmware for the DM04/QQBOX you need to copy the
+following file(s) to this directory.
+
+for DM04+/QQBOX LME2510C (Sharp 7395 Tuner)
+---
+
+The Sharp 7395 driver can be found in windows/system32/driver
+
+US2A0D.sys (dated 17 Mar 2009)
+
+
+and run
+./get_dvb_firmware lme2510c_s7395
+
+   will produce
+   dvb-usb-lme2510c-s7395.fw
+
+An alternative but older firmware can be found on the driver
+disk DVB-S_EN_3.5A in BDADriver/driver
+
+LMEBDA_DVBS7395C.sys (dated 18 Jan 2008)
+
+and run
+./get_dvb_firmware lme2510c_s7395_old
+
+   will produce
+   dvb-usb-lme2510c-s7395.fw
+
+
+
+The LG firmware can be found on the driver
+disk DM04+_5.1A[LG] in BDADriver/driver
+
+for DM04 LME2510 (LG Tuner)
+---
+
+LMEBDA_DVBS.sys (dated 13 Nov 2007)
+
+and run
+./get_dvb_firmware lme2510_lg
+
+   will produce
+   dvb-usb-lme2510-lg.fw
+
+
+Other LG firmware can be extracted manually from US280D.sys
+only found in windows/system32/driver.
+However, this firmware does not run very well under Windows
+or with the Linux driver.
+
+dd if=US280D.sys ibs=1 skip=36856 count=3976 of=dvb-usb-lme2510-lg.fw
+
+-
+
+Copy the firmware file(s) to /lib/firmware
diff --git a/drivers/media/IR/keymaps/Makefile 
b/drivers/media/IR/keymaps/Makefile
index 86d3d1f..14f20de 100644
--- a/drivers/media/IR/keymaps/Makefile
+++ b/drivers/media/IR/keymaps/Makefile
@@ -38,6 +38,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
rc-kworld-315u.o \
rc-kworld-plus-tv-analog.o \
rc-lirc.o \
+   rc-lme2510.o \
rc-manli.o \
rc-msi-tvanywhere.o \
rc-msi-tvanywhere-plus.o \
diff --git a/drivers/media/IR/keymaps/rc-lme2510.c 
b/drivers/media/IR/keymaps/rc-lme2510.c
new file mode 100644
index 000..40dcf0b
--- /dev/null
+++ b/drivers/media/IR/keymaps/rc-lme2510.c
@@ -0,0 +1,68 @@
+/* LME2510 remote control
+ *
+ *
+ * Copyright (C) 2010 Malcolm Priestley (tvbox...@gmail.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */

media entities and other stuff

2010-09-02 Thread Laurent Epinat

Hello All

I'm a new on media and camera things.

I try to use the isp cam port on omap3550 with media framework

we had a tvp5150 connected on isp port through the parallele interface on own 
custom board.
I had ported the tvp5150 driver on media framework like im046 and 8et8ek8,
and I'm quiet lost

questions:
The node /dev/media0 is used only the parameters ?
if yes do i need to configure and how to do it (the media-ctl is not easy to 
used)

and the video frame comes from /dev/video2
(I try to capture the frame comes from CCDC output) ?


Il try (tvp5150 -> CCDC in, and try to read CCDC out I not sure about my 
thinking)

 ./media-ctl -l 16:0'->'5:0[1]

and the  entity 16 changed

- entity 16: tvp5150 3-005d (1 pad, 1 link)
 type V4L2 subdev subtype Unknown
pad0: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CCDC':pad0 [ACTIVE]


if I'm right
I can't understand how it works exactly and what appended on the different 
symptom

The format.pix strcture is empty after called VIDIOC_G_FORMAT ?

If I force the size in the code it's ok for that ioctl
but I can't swith the stream on,

Unable to start streaming: 32


in the isp_video_validate_pipeline() the
isp_video_remote_subdev() return null ptr

of cause, in media_entity_remote_pad(), it check
MEDIA_LINK_FLAG_ACTIVE and in my case, is not active,

because, in func isp_register_entities()
the flag is set to 0 on case ISP_INTERFACE_PARALLEL:



here my media topologie

Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Device topology
- entity 1: OMAP3 ISP CCP2 (2 pads, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/subdev0
pad0: Input [unknown 0x0]
pad1: Output [unknown 0x0]
-> 'OMAP3 ISP CCDC':pad0 []

- entity 2: OMAP3 ISP CCP2 input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video0
pad0: Output
-> 'OMAP3 ISP CCP2':pad0 []

- entity 3: OMAP3 ISP CSI2a (2 pads, 2 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CSI2a output':pad0 []
-> 'OMAP3 ISP CCDC':pad0 []

- entity 4: OMAP3 ISP CSI2a output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video1
pad0: Input

- entity 5: OMAP3 ISP CCDC (3 pads, 6 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CCDC output':pad0 []
-> 'OMAP3 ISP resizer':pad0 []
pad2: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP preview':pad0 []
-> 'OMAP3 ISP AEWB':pad0 []
-> 'OMAP3 ISP AF':pad0 []
-> 'OMAP3 ISP histogram':pad0 []

- entity 6: OMAP3 ISP CCDC output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video2
pad0: Input

- entity 7: OMAP3 ISP preview (2 pads, 2 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP preview output':pad0 []
-> 'OMAP3 ISP resizer':pad0 []

- entity 8: OMAP3 ISP preview input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video3
pad0: Output
-> 'OMAP3 ISP preview':pad0 []

- entity 9: OMAP3 ISP preview output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video4
pad0: Input

- entity 10: OMAP3 ISP resizer (2 pads, 1 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP resizer output':pad0 []

- entity 11: OMAP3 ISP resizer input (1 pad, 1 link)
 type Node subtype V4L
 device node name /dev/video5
pad0: Output
-> 'OMAP3 ISP resizer':pad0 []

- entity 12: OMAP3 ISP resizer output (1 pad, 0 link)
 type Node subtype V4L
 device node name /dev/video6
pad0: Input

- entity 13: OMAP3 ISP AEWB (1 pad, 0 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node


- entity 14: OMAP3 ISP AF (1 pad, 0 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node


- entity 15: OMAP3 ISP histogram (1 pad, 0 link)
 typ

[cron job] v4l-dvb daily build 2.6.26 and up: ERRORS

2010-09-02 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Thu Sep  2 19:00:06 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15138:a4c762698bcb
git master:   f6760aa024199cfbce564311dc4bc4d47b6fb349
git media-master: 1c1371c2fe53ded8ede3a0404c9415fbf3321328
gcc version:  i686-linux-gcc (GCC) 4.4.3
host hardware:x86_64
host os:  2.6.32.5

linux-2.6.32.6-armv5: ERRORS
linux-2.6.33-armv5: OK
linux-2.6.34-armv5: WARNINGS
linux-2.6.35.3-armv5: WARNINGS
linux-2.6.36-rc2-armv5: ERRORS
linux-2.6.32.6-armv5-davinci: ERRORS
linux-2.6.33-armv5-davinci: WARNINGS
linux-2.6.34-armv5-davinci: WARNINGS
linux-2.6.35.3-armv5-davinci: WARNINGS
linux-2.6.36-rc2-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: ERRORS
linux-2.6.33-armv5-ixp: WARNINGS
linux-2.6.34-armv5-ixp: WARNINGS
linux-2.6.35.3-armv5-ixp: WARNINGS
linux-2.6.36-rc2-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: ERRORS
linux-2.6.33-armv5-omap2: WARNINGS
linux-2.6.34-armv5-omap2: WARNINGS
linux-2.6.35.3-armv5-omap2: WARNINGS
linux-2.6.36-rc2-armv5-omap2: ERRORS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: ERRORS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.36-rc2-i686: ERRORS
linux-2.6.32.6-m32r: ERRORS
linux-2.6.33-m32r: OK
linux-2.6.34-m32r: WARNINGS
linux-2.6.35.3-m32r: WARNINGS
linux-2.6.36-rc2-m32r: ERRORS
linux-2.6.32.6-mips: ERRORS
linux-2.6.33-mips: WARNINGS
linux-2.6.34-mips: WARNINGS
linux-2.6.35.3-mips: WARNINGS
linux-2.6.36-rc2-mips: ERRORS
linux-2.6.32.6-powerpc64: ERRORS
linux-2.6.33-powerpc64: WARNINGS
linux-2.6.34-powerpc64: WARNINGS
linux-2.6.35.3-powerpc64: WARNINGS
linux-2.6.36-rc2-powerpc64: ERRORS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: ERRORS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
linux-2.6.36-rc2-x86_64: ERRORS
linux-git-Module.symvers: ERRORS
linux-git-armv5: ERRORS
linux-git-armv5-davinci: ERRORS
linux-git-armv5-ixp: ERRORS
linux-git-armv5-omap2: ERRORS
linux-git-i686: ERRORS
linux-git-m32r: ERRORS
linux-git-mips: ERRORS
linux-git-powerpc64: ERRORS
linux-git-x86_64: ERRORS
spec: ERRORS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

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

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


media entities and other stuff (2)

2010-09-02 Thread Laurent Epinat

Hello All

I'm a new on media and camera things.

I try to use the isp cam port on omap3550 with media framework

we had a tvp5150 connected on isp port through the parallele interface on own 
custom board.
I had ported the tvp5150 driver on media framework like im046 and 8et8ek8,
and I'm quiet lost

questions:
The node /dev/media0 is used only the parameters ?
if yes do i need to configure and how to do it (the media-ctl is not easy to 
used)

and the video frame comes from /dev/video2
(I try to capture the frame comes from CCDC output) ?


Il try (tvp5150 -> CCDC in, and try to read CCDC out I not sure about my 
thinking)

 ./media-ctl -l 16:0'->'5:0[1]

and the  entity 16 changed

- entity 16: tvp5150 3-005d (1 pad, 1 link)
 type V4L2 subdev subtype Unknown
pad0: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CCDC':pad0 [ACTIVE]


if I'm right
I can't understand how it works exactly and what appended on the different 
symptom

The format.pix strcture is empty after called VIDIOC_G_FORMAT ?

If I force the size in the code it's ok for that ioctl
but I can't swith the stream on,

Unable to start streaming: 32


in the isp_video_validate_pipeline() the
isp_video_remote_subdev() return null ptr

of cause, in media_entity_remote_pad(), it check
MEDIA_LINK_FLAG_ACTIVE and in my case, is not active,

because, in func isp_register_entities()
the flag is set to 0 on case ISP_INTERFACE_PARALLEL:


I missed something !
I don't know what can you help me



here my media topologie

Opening media device /dev/media0
Enumerating entities
Found 16 entities
Enumerating pads and links
Device topology
- entity 1: OMAP3 ISP CCP2 (2 pads, 1 link)
type V4L2 subdev subtype Unknown
device node name /dev/subdev0
pad0: Input [unknown 0x0]
pad1: Output [unknown 0x0]
-> 'OMAP3 ISP CCDC':pad0 []

- entity 2: OMAP3 ISP CCP2 input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video0
pad0: Output
-> 'OMAP3 ISP CCP2':pad0 []

- entity 3: OMAP3 ISP CSI2a (2 pads, 2 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CSI2a output':pad0 []
-> 'OMAP3 ISP CCDC':pad0 []

- entity 4: OMAP3 ISP CSI2a output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video1
pad0: Input

- entity 5: OMAP3 ISP CCDC (3 pads, 6 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP CCDC output':pad0 []
-> 'OMAP3 ISP resizer':pad0 []
pad2: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP preview':pad0 []
-> 'OMAP3 ISP AEWB':pad0 []
-> 'OMAP3 ISP AF':pad0 []
-> 'OMAP3 ISP histogram':pad0 []

- entity 6: OMAP3 ISP CCDC output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video2
pad0: Input

- entity 7: OMAP3 ISP preview (2 pads, 2 links)
type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP preview output':pad0 []
-> 'OMAP3 ISP resizer':pad0 []

- entity 8: OMAP3 ISP preview input (1 pad, 1 link)
type Node subtype V4L
device node name /dev/video3
pad0: Output
-> 'OMAP3 ISP preview':pad0 []

- entity 9: OMAP3 ISP preview output (1 pad, 0 link)
type Node subtype V4L
device node name /dev/video4
pad0: Input

- entity 10: OMAP3 ISP resizer (2 pads, 1 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node

pad1: Output v4l2_subdev_open: Failed to open subdev device node

-> 'OMAP3 ISP resizer output':pad0 []

- entity 11: OMAP3 ISP resizer input (1 pad, 1 link)
 type Node subtype V4L
 device node name /dev/video5
pad0: Output
-> 'OMAP3 ISP resizer':pad0 []

- entity 12: OMAP3 ISP resizer output (1 pad, 0 link)
 type Node subtype V4L
 device node name /dev/video6
pad0: Input

- entity 13: OMAP3 ISP AEWB (1 pad, 0 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node


- entity 14: OMAP3 ISP AF (1 pad, 0 link)
 type V4L2 subdev subtype Unknown
pad0: Input v4l2_subdev_open: Failed to open subdev device node


- entity

[RFC/PATCH 7/8] drivers:staging:ti-st: Link FM TX module API with FM V4L2 module

2010-09-02 Thread raja_mani
From: Raja Mani 

 Add FM TX API calls in FM V4L2 module which will internally link to V4L2
 subsystem. It includes ,

 1) Support for set/get modulator attributes and extended control.
 2) fm_v4l2_vidioc_s_ctrl ()
 + added support for V4L2_CID_TUNE_POWER_LEVEL,
   V4L2_CID_TUNE_PREEMPHASIS, V4L2_CID_FM_BAND,
   V4L2_CID_TUNE_ANTENNA_CAPACITOR
 3) fm_v4l2_vidioc_g_ctrl ()
 + added support for V4L2_CID_TUNE_PREEMPHASIS, V4L2_CID_FM_BAND

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/staging/ti-st/fmdrv_v4l2.c |  243 ---
 1 files changed, 222 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/ti-st/fmdrv_v4l2.c 
b/drivers/staging/ti-st/fmdrv_v4l2.c
index c546a0f..d76344e 100644
--- a/drivers/staging/ti-st/fmdrv_v4l2.c
+++ b/drivers/staging/ti-st/fmdrv_v4l2.c
@@ -30,8 +30,7 @@
 #include "fmdrv_v4l2.h"
 #include "fmdrv_common.h"
 #include "fmdrv_rx.h"
-/* TODO: Enable when FM TX is supported */
-/* #include "fmdrv_tx.h" */
+#include "fmdrv_tx.h"
 
 #ifndef DEBUG
 #ifdef pr_info
@@ -134,9 +133,8 @@ static ssize_t fm_v4l2_fops_write(struct file *file, const 
char __user * buf,
   ret, rds.text_type, rds.text, rds.af_freq);
 
fmdev = video_drvdata(file);
-   /* TODO: Enable when FM TX is supported */
-   /* fm_tx_set_radio_text(fmdev, rds.text, rds.text_type); */
-   /* fm_tx_set_af(fmdev, rds.af_freq); */
+   fm_tx_set_radio_text(fmdev, rds.text, rds.text_type);
+   fm_tx_set_af(fmdev, rds.af_freq);
 
return 0;
 }
@@ -257,6 +255,9 @@ static int fm_v4l2_vidioc_g_ctrl(struct file *file, void 
*priv,
int ret = -EINVAL;
unsigned short curr_vol;
unsigned char curr_mute_mode;
+   unsigned char region;
+   unsigned char afreq;
+   short threshold;
struct fmdrv_ops *fmdev;
 
fmdev = video_drvdata(file);
@@ -274,16 +275,48 @@ static int fm_v4l2_vidioc_g_ctrl(struct file *file, void 
*priv,
goto exit;
ctrl->value = curr_vol;
break;
+   case V4L2_CID_FM_BAND:
+   if (fmdev->curr_fmmode != FM_MODE_RX)
+   break;
+   ret = fm_rx_get_region(fmdev, ®ion);
+   if (ret < 0)
+   break;
+   if (region == FM_BAND_EUROPE_US)
+   ctrl->value = V4L2_FM_BAND_OTHER;
+   else
+   ctrl->value = V4L2_FM_BAND_JAPAN;
+   break;
+   case V4L2_CID_RSSI_THRESHOLD:
+   ret = fm_rx_get_rssi_threshold(fmdev, &threshold);
+   if (ret == 0)
+   ctrl->value = threshold;
+   break;
+   case V4L2_CID_TUNE_AF:
+   ret = fm_rx_get_af_switch(fmdev, &afreq);
+   if (ret == 0)
+   ctrl->value = afreq;
+   break;
+   case V4L2_CID_TUNE_PREEMPHASIS:
+   ctrl->value = fmdev->tx_data.preemph;
+   break;
}
 
 exit:
return ret;
 }
 
+/* Change the value of specified control.
+ * V4L2_CID_TUNE_POWER_LEVEL: Application will specify power level value in
+ * units of dB/uV, whereas range and step are specific to FM chip. For TI's WL
+ * chips, convert application specified power level value to chip specific
+ * value by substracting it with 122. Refer to TI FM data sheet for details.
+ */
 static int fm_v4l2_vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
 {
int ret = -EINVAL;
+   unsigned int emph_filter;
+   unsigned char region;
struct fmdrv_ops *fmdev;
 
fmdev = video_drvdata(file);
@@ -291,17 +324,61 @@ static int fm_v4l2_vidioc_s_ctrl(struct file *file, void 
*priv,
switch (ctrl->id) {
case V4L2_CID_AUDIO_MUTE:   /* set mute */
ret = fmc_set_mute_mode(fmdev, (unsigned char)ctrl->value);
-   if (ret < 0)
-   goto exit;
break;
case V4L2_CID_AUDIO_VOLUME: /* set volume */
ret = fm_rx_set_volume(fmdev, (unsigned short)ctrl->value);
-   if (ret < 0)
-   goto exit;
+   break;
+   case V4L2_CID_TUNE_POWER_LEVEL: /* set TX power level - ext control */
+   if (ctrl->value >= FM_PWR_LVL_LOW &&
+   ctrl->value <= FM_PWR_LVL_HIGH) {
+   ctrl->value = FM_PWR_LVL_HIGH - ctrl->value;
+   ret = fm_tx_set_pwr_lvl(fmdev,
+   (unsigned char)ctrl->value);
+   } else
+   ret = -ERANGE;
+   break;
+   case V4L2_CID_FM_BAND:
+   if (ctrl->value < V4L2_FM_BAND_OTHER ||
+   ctrl->value > V4L2_FM_BAND_JAPAN) {
+   ret = -ERANGE;
+   break;
+

[RFC/PATCH 5/8] drivers:staging:ti-st: Code cleanup in FM Common module

2010-09-02 Thread raja_mani
From: Raja Mani 

Code cleanup and bug fixes in TI FM Common module.
 1) Remove fmc_get_region() API (since it moved to FM RX module)
 2) Mute/Umute fix ( As v4l2 spec, MUTE_ON should 1 and MUTE_OFF should be 0)
 3) Support for FM TX Antenna Impedance configuration.

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/staging/ti-st/fmdrv_common.c |   39 +
 drivers/staging/ti-st/fmdrv_common.h |   23 ++-
 2 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/ti-st/fmdrv_common.c 
b/drivers/staging/ti-st/fmdrv_common.c
index 8152031..ec502b0 100644
--- a/drivers/staging/ti-st/fmdrv_common.c
+++ b/drivers/staging/ti-st/fmdrv_common.c
@@ -38,8 +38,7 @@
 #include "fmdrv_common.h"
 #include "st.h"
 #include "fmdrv_rx.h"
-/* TODO: Enable when FM TX is supported */
-/* #include "fmdrv_tx.h" */
+#include "fmdrv_tx.h"
 
 #ifndef DEBUG
 #ifdef pr_info
@@ -188,6 +187,8 @@ static struct fm_reg_table fm_reg_info[] = {
{0x51, REG_RD, "MS_GET"},
{0x52, REG_WR, "PS_SCROLL_SPEED_SET"},
{0x52, REG_RD, "PS_SCROLL_SPEED_GET"},
+   {0x57, REG_WR, "ANT_IMP_SET"},
+   {0x57, REG_RD, "ANT_IMP_GET"},
 };
 
 /* Region info */
@@ -1507,9 +1508,8 @@ int fmc_set_frequency(struct fmdrv_ops *fmdev, unsigned 
int freq_to_set)
break;
 
case FM_MODE_TX:
-   /* TODO: Enable when FM TX is supported */
-   /* ret = fm_tx_set_frequency(fmdev, freq_to_set); */
-   /* break; */
+   ret = fm_tx_set_frequency(fmdev, freq_to_set);
+   break;
 
default:
ret = -EINVAL;
@@ -1548,13 +1548,6 @@ exit:
return ret;
 }
 
-/* Returns current band index (0-Europe/US; 1-Japan) */
-int fmc_get_region(struct fmdrv_ops *fmdev, unsigned char *region)
-{
-   *region = fmdev->rx.region.region_index;
-   return 0;
-}
-
 int fmc_set_region(struct fmdrv_ops *fmdev, unsigned char region_to_set)
 {
int ret;
@@ -1565,9 +1558,8 @@ int fmc_set_region(struct fmdrv_ops *fmdev, unsigned char 
region_to_set)
break;
 
case FM_MODE_TX:
-   /* TODO: Enable when FM TX is supported */
-   /* ret = fm_tx_set_region(fmdev, region_to_set); */
-   /* break; */
+   ret = fm_tx_set_region(fmdev, region_to_set);
+   break;
 
default:
ret = -EINVAL;
@@ -1585,9 +1577,8 @@ int fmc_set_mute_mode(struct fmdrv_ops *fmdev, unsigned 
char mute_mode_toset)
break;
 
case FM_MODE_TX:
-   /* TODO: Enable when FM TX is supported */
-   /* ret = fm_tx_set_mute_mode(fmdev, mute_mode_toset); */
-   /* break; */
+   ret = fm_tx_set_mute_mode(fmdev, mute_mode_toset);
+   break;
 
default:
ret = -EINVAL;
@@ -1605,9 +1596,8 @@ int fmc_set_stereo_mono(struct fmdrv_ops *fmdev, unsigned 
short mode)
break;
 
case FM_MODE_TX:
-   /* TODO: Enable when FM TX is supported */
-   /* ret = fm_tx_set_stereo_mono(fmdev, mode); */
-   /* break; */
+   ret = fm_tx_set_stereo_mono(fmdev, mode);
+   break;
 
default:
ret = -EINVAL;
@@ -1625,9 +1615,8 @@ int fmc_set_rds_mode(struct fmdrv_ops *fmdev, unsigned 
char rds_en_dis)
break;
 
case FM_MODE_TX:
-   /* TODO: Enable when FM TX is supported */
-   /* ret = fm_tx_set_rds_mode(fmdev, rds_en_dis); */
-   /* break; */
+   ret = fm_tx_set_rds_mode(fmdev, rds_en_dis);
+   break;
 
default:
ret = -EINVAL;
@@ -2101,6 +2090,8 @@ static int __init fm_drv_init(void)
 
fmdev->irq_info.fm_int_handlers = g_IntHandlerTable;
fmdev->curr_fmmode = FM_MODE_OFF;
+   fmdev->tx_data.pwr_lvl = FM_PWR_LVL_DEF;
+   fmdev->tx_data.preemph = FM_TX_PREEMPH_50US;
goto exit;
 
 rel_rdsbuf:
diff --git a/drivers/staging/ti-st/fmdrv_common.h 
b/drivers/staging/ti-st/fmdrv_common.h
index 7fb55f3..9f60c2c 100644
--- a/drivers/staging/ti-st/fmdrv_common.h
+++ b/drivers/staging/ti-st/fmdrv_common.h
@@ -173,6 +173,8 @@ enum fm_reg_index {
MS_GET,
PS_SCROLL_SPEED_SET,
PS_SCROLL_SPEED_GET,
+   IMP_SET,
+   IMP_GET,
 
FM_REG_MAX_ENTRIES
 };
@@ -300,8 +302,8 @@ struct bts_action_delay {
 #define FM_RX_VOLUME_GAIN_STEP 0x370
 
 /* Mute modes */
-#define FM_MUTE_ON 0
-#defineFM_MUTE_OFF 1
+#define FM_MUTE_OFF0
+#defineFM_MUTE_ON  1
 #defineFM_MUTE_ATTENUATE   2
 
 #define FM_RX_MUTE_UNMUTE_MODE 0x00
@@ -432,6 +434,23 @@ struct bts_action_delay {
 #define FM_DEFAULT_RX_VOLUME   10
 #define FM_DEFAULT_RSSI_THRESHOLD  3
 
+/* Range for TX power level in units for dB/uV */
+#define 

[RFC/PATCH 4/8] drivers:staging:ti-st: Move get region func to FM RX module.

2010-09-02 Thread raja_mani
From: Raja Mani 

fm_rx_get_region() API is specific to FM RX module, So
moving this from FM Common module to FM RX module.

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/staging/ti-st/fmdrv_rx.c |7 +++
 drivers/staging/ti-st/fmdrv_rx.h |1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/ti-st/fmdrv_rx.c b/drivers/staging/ti-st/fmdrv_rx.c
index a9df59f..1213927 100644
--- a/drivers/staging/ti-st/fmdrv_rx.c
+++ b/drivers/staging/ti-st/fmdrv_rx.c
@@ -319,6 +319,13 @@ int fm_rx_get_currband_lowhigh_freq(struct fmdrv_ops 
*fmdev,
return 0;
 }
 
+/* Returns current band index (0-Europe/US; 1-Japan) */
+int fm_rx_get_region(struct fmdrv_ops *fmdev, unsigned char *region)
+{
+   *region = fmdev->rx.region.region_index;
+   return 0;
+}
+
 /* Sets band (0-Europe/US; 1-Japan) */
 int fm_rx_set_region(struct fmdrv_ops *fmdev,
unsigned char region_to_set)
diff --git a/drivers/staging/ti-st/fmdrv_rx.h b/drivers/staging/ti-st/fmdrv_rx.h
index 2ca3eda..e89a175 100644
--- a/drivers/staging/ti-st/fmdrv_rx.h
+++ b/drivers/staging/ti-st/fmdrv_rx.h
@@ -51,6 +51,7 @@ int fm_rx_get_rssi_threshold(struct fmdrv_ops *, short*);
 int fm_rx_get_rfdepend_softmute(struct fmdrv_ops *, unsigned char*);
 int fm_rx_get_deemphasis_mode(struct fmdrv_ops *, unsigned short*);
 int fm_rx_get_af_switch(struct fmdrv_ops *, unsigned char *);
+int fm_rx_get_region(struct fmdrv_ops*, unsigned char*);
 
 #endif
 
-- 
1.5.6.3

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


[RFC/PATCH 8/8] drivers:staging:ti-st: Include FM TX module in Makefile

2010-09-02 Thread raja_mani
From: Raja Mani 

 Update Makefile to include FM TX module (fmdrv_tx) for
 the compilation.

Signed-off-by: Raja Mani 
---
 drivers/staging/ti-st/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/ti-st/Makefile b/drivers/staging/ti-st/Makefile
index e6af3f1..bd29c83 100644
--- a/drivers/staging/ti-st/Makefile
+++ b/drivers/staging/ti-st/Makefile
@@ -6,4 +6,4 @@ obj-$(CONFIG_TI_ST) += st_drv.o
 st_drv-objs:= st_core.o st_kim.o st_ll.o
 obj-$(CONFIG_ST_BT)+= bt_drv.o
 obj-$(CONFIG_ST_FM)+= fm_drv.o
-fm_drv-objs:= fmdrv_common.o fmdrv_rx.o fmdrv_v4l2.o
+fm_drv-objs:= fmdrv_common.o fmdrv_rx.o fmdrv_tx.o 
fmdrv_v4l2.o
-- 
1.5.6.3

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


[RFC/PATCH 3/8] drivers:staging:ti-st: Sources for FM TX

2010-09-02 Thread raja_mani
From: Raja Mani 

This has implementation of FM TX functionality (for Wl127x and WL128x
chip) which are listed below,

1) frequency set.
2) stereo/nono mode selection.
3) RDS config.
4) mute/unmute mode config.
5) power level config.
6) preemphasis filter config, etc.

This will work on top of TI Shared Transport driver. It communicates with
TI FM V4L2 module and TI FM Common module to perform the actual FM TX operation.

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/staging/ti-st/fmdrv_tx.c |  391 ++
 drivers/staging/ti-st/fmdrv_tx.h |   37 
 2 files changed, 428 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/ti-st/fmdrv_tx.c
 create mode 100644 drivers/staging/ti-st/fmdrv_tx.h

diff --git a/drivers/staging/ti-st/fmdrv_tx.c b/drivers/staging/ti-st/fmdrv_tx.c
new file mode 100644
index 000..55bf89a
--- /dev/null
+++ b/drivers/staging/ti-st/fmdrv_tx.c
@@ -0,0 +1,391 @@
+/*
+ *  FM Driver for Connectivity chip of Texas Instruments.
+ *  This sub-module of FM driver implements FM TX functionality.
+ *
+ *  Copyright (C) 2010 Texas Instruments
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include 
+#include "fmdrv.h"
+#include "fmdrv_common.h"
+#include "fmdrv_tx.h"
+
+int fm_tx_set_stereo_mono(struct fmdrv_ops *fmdev, unsigned short mode)
+{
+   unsigned short payload;
+   int ret = 0;
+
+   if (fmdev->curr_fmmode != FM_MODE_TX) {
+   ret = -EPERM;
+   goto exit;
+   }
+   if (fmdev->tx_data.aud_mode == mode)
+   goto exit;
+
+   pr_debug("stereo mode: %d", (int)mode);
+
+   /* Set Stereo/Mono mode */
+   FM_STORE_LE16_TO_BE16(payload, (1 - mode));
+   ret = fmc_send_cmd(fmdev, MONO_SET, &payload, sizeof(payload),
+   &fmdev->maintask_completion, NULL, NULL);
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   fmdev->tx_data.aud_mode = mode;
+exit:
+   return ret;
+}
+
+static int __set_rds_text(struct fmdrv_ops *fmdev, unsigned char *rds_text)
+{
+   unsigned short payload;
+   int ret;
+
+   ret = fmc_send_cmd(fmdev, RDS_DATA_SET, rds_text, strlen(rds_text),
+   &fmdev->maintask_completion, NULL, NULL);
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   /* Scroll mode */
+   FM_STORE_LE16_TO_BE16(payload, (unsigned short)0x1);
+   ret = fmc_send_cmd(fmdev, DISPLAY_MODE_SET, &payload, sizeof(payload),
+   &fmdev->maintask_completion, NULL, NULL);
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   return 0;
+}
+
+static int __set_rds_data_mode(struct fmdrv_ops *fmdev, unsigned char mode)
+{
+   unsigned short payload;
+   int ret;
+
+   /* Setting unique PI TODO: how unique? */
+   FM_STORE_LE16_TO_BE16(payload, (unsigned short)0xcafe);
+   ret = fmc_send_cmd(fmdev, PI_SET, &payload, sizeof(payload),
+   &fmdev->maintask_completion, NULL, NULL);
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   /* Set decoder id */
+   FM_STORE_LE16_TO_BE16(payload, (unsigned short)0xa);
+   ret = fmc_send_cmd(fmdev, DI_SET, &payload, sizeof(payload),
+   &fmdev->maintask_completion, NULL, NULL);
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   /* TODO: RDS_MODE_GET? */
+   return 0;
+}
+
+static int __set_rds_len(struct fmdrv_ops *fmdev, unsigned char type,
+   unsigned short len)
+{
+   unsigned short payload;
+   int ret;
+
+   len |= type << 8;
+   FM_STORE_LE16_TO_BE16(payload, len);
+   ret = fmc_send_cmd(fmdev, LENGHT_SET, &payload, sizeof(payload),
+   &fmdev->maintask_completion, NULL, NULL);
+
+   FM_CHECK_SEND_CMD_STATUS(ret);
+
+   /* TODO: LENGHT_GET? */
+   return 0;
+}
+
+int fm_tx_set_rds_mode(struct fmdrv_ops *fmdev, unsigned char rds_en_dis)
+{
+   unsigned short payload;
+   int ret;
+   unsigned char rds_text[] = "Zoom2\n";
+
+   if (fmdev->curr_fmmode != FM_MODE_TX)
+   return -EPERM;
+
+   pr_debug("rds_en_dis:%d(E:%d, D:%d)", rds_en_dis,
+  FM_RDS_ENABLE, FM_RDS_DISABLE);
+
+   if (rds_en_dis == FM_RDS_ENABLE) {
+   /* Set RDS length */
+   __set_rds_len(fmdev, 0, strlen(rds_te

[RFC/PATCH 6/8] drivers:staging:ti-st: Extend FM TX global data structure.

2010-09-02 Thread raja_mani
From: Raja Mani 

 Add new members in FM TX global data structure (struct fmtx_data)
 to track current Audio mode, Reemphasis and Region setting in TX mode.

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/staging/ti-st/fmdrv.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/ti-st/fmdrv.h b/drivers/staging/ti-st/fmdrv.h
index d560570..f8a4ce3 100644
--- a/drivers/staging/ti-st/fmdrv.h
+++ b/drivers/staging/ti-st/fmdrv.h
@@ -173,6 +173,7 @@ struct fm_rx {
 struct tx_rds {
unsigned char text_type;
unsigned char text[25];
+   unsigned char flag;
unsigned int af_freq;
 };
 /*
@@ -187,6 +188,9 @@ struct fmtx_data {
unsigned char pwr_lvl;
unsigned char xmit_state;
unsigned char audio_io;
+   unsigned char region;
+   unsigned short aud_mode;
+   unsigned int preemph;
unsigned long tx_frq;
struct tx_rds rds;
 };
-- 
1.5.6.3

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


[RFC/PATCH 2/8] include:linux:videodev2: Define new CIDs for FM RX ctls

2010-09-02 Thread raja_mani
From: Raja Mani 

Extend V4L2 CID list to support
   1) FM RX Tuner controls
   2) FM band
   3) RSSI Threshold
   4) Alternative Frequency

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 include/linux/videodev2.h |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 7c99acf..2798137 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -964,6 +964,7 @@ struct v4l2_writeback_ioctl_data {
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
 #define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
+#define V4L2_CTRL_CLASS_FM_RX 0x009c   /* FM Tuner control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id) & 0x0fffUL)
@@ -1362,6 +1363,23 @@ enum v4l2_preemphasis {
 #define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 
113)
 #define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 114)
 
+/* FM Tuner class control IDs */
+#define V4L2_CID_FM_RX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_RX | 0x900)
+#define V4L2_CID_FM_RX_CLASS   (V4L2_CTRL_CLASS_FM_RX | 1)
+
+#define V4L2_CID_FM_BAND   (V4L2_CID_FM_RX_CLASS_BASE + 1)
+enum v4l2_fm_band {
+   V4L2_FM_BAND_OTHER  = 0,
+   V4L2_FM_BAND_JAPAN  = 1,
+   V4L2_FM_BAND_OIRT   = 2
+};
+#define V4L2_CID_RSSI_THRESHOLD
(V4L2_CID_FM_RX_CLASS_BASE + 2)
+#define V4L2_CID_TUNE_AF   (V4L2_CID_FM_RX_CLASS_BASE + 3)
+enum v4l2_tune_af {
+   V4L2_FM_AF_OFF  = 0,
+   V4L2_FM_AF_ON   = 1
+};
+
 /*
  * T U N I N G
  */
-- 
1.5.6.3

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


[RFC/PATCH 0/8] Add FM TX support for TI WL127x and TI WL128x.

2010-09-02 Thread raja_mani
From: Raja Mani 

  This is second set patches for TI FM driver. This adds FM TX support 
  for TI WL128x and TI Wl127x chipsets. Also , extends V4L2 control IDs (CID)
  to support few FM RX features.

  First set of TI FM driver patches are submitted for review in linux-media 
  & LKML and available under this link:

   http://www.spinics.net/lists/linux-media/msg22096.html
   http://lkml.org/lkml/2010/8/13/122

  TI FM driver makes use of TI Shared Transport (solution for BT/FM/GPS combo 
chip)
  and Shared Transport driver is available in mainline kernel staging 
  directory (/drivers/staging/ti-st).
   
Raja Mani (8):
  drivers:media:video: Adding new CIDs for FM RX ctls
  include:linux:videodev2: Define new CIDs for FM RX ctls
  drivers:staging:ti-st: Sources for FM TX
  drivers:staging:ti-st: Move get region func to FM RX module.
  drivers:staging:ti-st: Code cleanup in FM Common module
  drivers:staging:ti-st: Extend FM TX global data structure.
  drivers:staging:ti-st: Link FM TX module API with FM V4L2 module
  drivers:staging:ti-st: Include FM TX module in Makefile

 drivers/media/video/v4l2-common.c|   16 ++
 drivers/staging/ti-st/Makefile   |2 +-
 drivers/staging/ti-st/fmdrv.h|4 +
 drivers/staging/ti-st/fmdrv_common.c |   39 ++--
 drivers/staging/ti-st/fmdrv_common.h |   23 ++-
 drivers/staging/ti-st/fmdrv_rx.c |7 +
 drivers/staging/ti-st/fmdrv_rx.h |1 +
 drivers/staging/ti-st/fmdrv_tx.c |  391 ++
 drivers/staging/ti-st/fmdrv_tx.h |   37 
 drivers/staging/ti-st/fmdrv_v4l2.c   |  243 +++--
 include/linux/videodev2.h|   18 ++
 11 files changed, 733 insertions(+), 48 deletions(-)
 create mode 100644 drivers/staging/ti-st/fmdrv_tx.c
 create mode 100644 drivers/staging/ti-st/fmdrv_tx.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


[RFC/PATCH 1/8] drivers:media:video: Adding new CIDs for FM RX ctls

2010-09-02 Thread raja_mani
From: Raja Mani 

Add support for the following new Control IDs (CID)
   V4L2_CID_FM_RX_CLASS- FM RX Tuner controls
   V4L2_CID_FM_BAND- FM band
   V4L2_CID_RSSI_THRESHOLD - RSSI Threshold
   V4L2_CID_TUNE_AF- Alternative Frequency

Signed-off-by: Raja Mani 
Signed-off-by: Pramodh AG 
---
 drivers/media/video/v4l2-common.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-common.c 
b/drivers/media/video/v4l2-common.c
index 4e53b0b..33c3037 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -354,6 +354,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
"75 useconds",
NULL,
};
+   static const char *fm_band[] = {
+   "87.5 - 108. MHz",
+   "76. - 90. MHz, Japan",
+   "65. - 74. MHz, OIRT",
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -394,6 +400,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return colorfx;
case V4L2_CID_TUNE_PREEMPHASIS:
return tune_preemphasis;
+   case V4L2_CID_FM_BAND:
+   return fm_band;
default:
return NULL;
}
@@ -520,6 +528,10 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_TUNE_PREEMPHASIS: return "Pre-emphasis settings";
case V4L2_CID_TUNE_POWER_LEVEL: return "Tune Power Level";
case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return "Tune Antenna Capacitor";
+   case V4L2_CID_FM_RX_CLASS:  return "FM Radio Tuner Controls";
+   case V4L2_CID_FM_BAND:  return "FM Band";
+   case V4L2_CID_RSSI_THRESHOLD:   return "RSSI Threshold";
+   case V4L2_CID_TUNE_AF:  return "Alternative Frequency";
 
default:
return NULL;
@@ -585,6 +597,9 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
case V4L2_CID_TUNE_PREEMPHASIS:
+   case V4L2_CID_FM_BAND:
+   case V4L2_CID_RSSI_THRESHOLD:
+   case V4L2_CID_TUNE_AF:
qctrl->type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
@@ -596,6 +611,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
case V4L2_CID_FM_TX_CLASS:
+   case V4L2_CID_FM_RX_CLASS:
qctrl->type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
-- 
1.5.6.3

--
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/2] mfd: Add timberdale video-in driver to timberdale

2010-09-02 Thread Richard Röjfors
This patch defines platform data for the video-in driver
and adds it to all configurations of timberdale.

Signed-off-by: Richard Röjfors 
---
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index ac59950..52a651b 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -40,6 +40,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
@@ -238,7 +239,24 @@ static const __devinitconst struct resource 
timberdale_uartlite_resources[] = {
},
 };
 
-static const __devinitconst struct resource timberdale_radio_resources[] = {
+static __devinitdata struct i2c_board_info timberdale_adv7180_i2c_board_info = 
{
+   /* Requires jumper JP9 to be off */
+   I2C_BOARD_INFO("adv7180", 0x42 >> 1),
+   .irq = IRQ_TIMBERDALE_ADV7180
+};
+
+static __devinitdata struct timb_video_platform_data
+   timberdale_video_platform_data = {
+   .dma_channel = DMA_VIDEO_RX,
+   .i2c_adapter = 0,
+   .encoder = {
+   .module_name = "adv7180",
+   .info = &timberdale_adv7180_i2c_board_info
+   }
+};
+
+static const __devinitconst struct resource
+timberdale_radio_resources[] = {
{
.start  = RDSOFFSET,
.end= RDSEND,
@@ -272,6 +290,18 @@ static __devinitdata struct timb_radio_platform_data
}
 };
 
+static const __devinitconst struct resource timberdale_video_resources[] = {
+   {
+   .start  = LOGIWOFFSET,
+   .end= LOGIWEND,
+   .flags  = IORESOURCE_MEM,
+   },
+   /*
+   note that the "frame buffer" is located in DMA area
+   starting at 0x120
+   */
+};
+
 static __devinitdata struct timb_dma_platform_data timb_dma_platform_data = {
.nr_channels = 10,
.channels = {
@@ -372,6 +402,13 @@ static __devinitdata struct mfd_cell 
timberdale_cells_bar0_cfg0[] = {
.data_size = sizeof(timberdale_gpio_platform_data),
},
{
+   .name = "timb-video",
+   .num_resources = ARRAY_SIZE(timberdale_video_resources),
+   .resources = timberdale_video_resources,
+   .platform_data = &timberdale_video_platform_data,
+   .data_size = sizeof(timberdale_video_platform_data),
+   },
+   {
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
@@ -430,6 +467,13 @@ static __devinitdata struct mfd_cell 
timberdale_cells_bar0_cfg1[] = {
.resources = timberdale_mlogicore_resources,
},
{
+   .name = "timb-video",
+   .num_resources = ARRAY_SIZE(timberdale_video_resources),
+   .resources = timberdale_video_resources,
+   .platform_data = &timberdale_video_platform_data,
+   .data_size = sizeof(timberdale_video_platform_data),
+   },
+   {
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
@@ -478,6 +522,13 @@ static __devinitdata struct mfd_cell 
timberdale_cells_bar0_cfg2[] = {
.data_size = sizeof(timberdale_gpio_platform_data),
},
{
+   .name = "timb-video",
+   .num_resources = ARRAY_SIZE(timberdale_video_resources),
+   .resources = timberdale_video_resources,
+   .platform_data = &timberdale_video_platform_data,
+   .data_size = sizeof(timberdale_video_platform_data),
+   },
+   {
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
@@ -521,6 +572,13 @@ static __devinitdata struct mfd_cell 
timberdale_cells_bar0_cfg3[] = {
.data_size = sizeof(timberdale_gpio_platform_data),
},
{
+   .name = "timb-video",
+   .num_resources = ARRAY_SIZE(timberdale_video_resources),
+   .resources = timberdale_video_resources,
+   .platform_data = &timberdale_video_platform_data,
+   .data_size = sizeof(timberdale_video_platform_data),
+   },
+   {
.name = "timb-radio",
.num_resources = ARRAY_SIZE(timberdale_radio_resources),
.resources = timberdale_radio_resources,
diff --git a/drivers/mfd/timberdale.h b/drivers/mfd/timberdale.h
index c11bf6e..4412acd 100644
--- a/drivers/mfd/timberdale.h
+++ b/drivers/mfd/timberdale.h
@@ -23,7 +23,7 @@
 #ifndef MFD_TIMBERDALE_H
 #define MFD_TIMBERDALE_H
 
-#define DRV_VERSION"0.2"
+#define DRV_VERSION"0.3"
 
 /* This driver only support versions >= 3.8 and < 4.0  */
 #define TIMB_SUPPORTED_MAJOR   3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kern

[RESEND][PATCH 1/2] media: Add timberdale video-in driver

2010-09-02 Thread Richard Röjfors
This patch adds the timberdale video-in driver.

The video IP of timberdale delivers the video data via DMA.
The driver uses the DMA api to handle DMA transfers, and make use
of the V4L2 video buffers to handle buffers against user space.

If available the driver uses an encoder to get/set the video standard

Signed-off-by: Richard Röjfors 
---
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index f6e4d04..1afbe26 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -734,6 +734,15 @@ config VIDEO_HEXIUM_GEMINI
  To compile this driver as a module, choose M here: the
  module will be called hexium_gemini.
 
+config VIDEO_TIMBERDALE
+   tristate "Support for timberdale Video In/LogiWIN"
+   depends on VIDEO_V4L2 && I2C
+   select TIMB_DMA
+   select VIDEO_ADV7180
+   select VIDEOBUF_DMA_CONTIG
+   ---help---
+   Add support for the Video In peripherial of the timberdale FPGA.
+
 source "drivers/media/video/cx88/Kconfig"
 
 source "drivers/media/video/cx23885/Kconfig"
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 40f98fb..c93af35 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -109,6 +109,7 @@ obj-$(CONFIG_VIDEO_CPIA2) += cpia2/
 obj-$(CONFIG_VIDEO_MXB) += mxb.o
 obj-$(CONFIG_VIDEO_HEXIUM_ORION) += hexium_orion.o
 obj-$(CONFIG_VIDEO_HEXIUM_GEMINI) += hexium_gemini.o
+obj-$(CONFIG_VIDEO_TIMBERDALE) += timblogiw.o
 
 obj-$(CONFIG_VIDEOBUF_GEN) += videobuf-core.o
 obj-$(CONFIG_VIDEOBUF_DMA_SG) += videobuf-dma-sg.o
diff --git a/drivers/media/video/timblogiw.c b/drivers/media/video/timblogiw.c
new file mode 100644
index 000..1ccc620
--- /dev/null
+++ b/drivers/media/video/timblogiw.c
@@ -0,0 +1,877 @@
+/*
+ * timblogiw.c timberdale FPGA LogiWin Video In driver
+ * Copyright (c) 2009-2010 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+/* Supports:
+ * Timberdale FPGA LogiWin Video In
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DRIVER_NAME"timb-video"
+
+#define TIMBLOGIWIN_NAME   "Timberdale Video-In"
+#define TIMBLOGIW_VERSION_CODE 0x04
+
+#define TIMBLOGIW_LINES_PER_DESC   44
+#define TIMBLOGIW_MAX_VIDEO_MEM16
+
+#define TIMBLOGIW_VIDEO_FORMAT V4L2_PIX_FMT_UYVY
+
+#define TIMBLOGIW_HAS_DECODER(lw)  (lw->pdata.encoder.module_name)
+
+
+struct timblogiw {
+   struct video_device video_dev;
+   struct v4l2_device  v4l2_dev; /* mutual exclusion */
+   struct mutexlock;
+   struct device   *dev;
+   struct timb_video_platform_data pdata;
+   struct v4l2_subdev  *sd_enc;/* encoder */
+   boolopened;
+};
+
+struct timblogiw_tvnorm {
+   v4l2_std_id std;
+   u16 width;
+   u16 height;
+   u8  fps;
+};
+
+struct timblogiw_fh {
+   struct videobuf_queue   vb_vidq;
+   struct timblogiw_tvnorm const   *cur_norm;
+   struct list_headcapture;
+   struct dma_chan *chan;
+   spinlock_t  queue_lock; /* mutual exclusion */
+   unsigned intframe_count;
+};
+
+struct timblogiw_buffer {
+   /* common v4l buffer stuff -- must be first */
+   struct videobuf_buffer  vb;
+   struct scatterlist  sg[16];
+   dma_cookie_tcookie;
+   struct timblogiw_fh *fh;
+};
+
+const struct timblogiw_tvnorm timblogiw_tvnorms[] = {
+   {
+   .std= V4L2_STD_PAL,
+   .width  = 720,
+   .height = 576,
+   .fps= 25
+   },
+   {
+   .std= V4L2_STD_NTSC,
+   .width  = 720,
+   .height = 480,
+   .fps= 26
+   }
+};
+
+static int timblogiw_bytes_per_line(const struct timblogiw_tvnorm *norm)
+{
+   return norm->width * 2;
+}
+
+
+static int timblogiw_frame_size(const struct timblogiw_tvnorm *norm)
+{
+   return norm->height * timblogiw_bytes_per_line(norm

[RESEND][PATCH 0/2] media, mfd: Add timberdale video-in driver

2010-09-02 Thread Richard Röjfors
To follow are two patches.

The first adds the timberdale video-in driver to the media tree.

The second adds it to the timberdale MFD driver.

Samuel and Mauro hope you can support and solve the potential merge
issue between your two trees.

Thanks
--Richard

--
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/RFCv4 0/6] The Contiguous Memory Allocator framework

2010-09-02 Thread KAMEZAWA Hiroyuki
On Fri, 27 Aug 2010 17:16:39 +0900
KAMEZAWA Hiroyuki  wrote:

> On Thu, 26 Aug 2010 18:36:24 +0900
> Minchan Kim  wrote:
> 
> > On Thu, Aug 26, 2010 at 1:30 PM, KAMEZAWA Hiroyuki
> >  wrote:
> > > On Thu, 26 Aug 2010 13:06:28 +0900
> > > Minchan Kim  wrote:
> > >
> > >> On Thu, Aug 26, 2010 at 12:44 PM, KAMEZAWA Hiroyuki
> > >>  wrote:
> > >> > On Thu, 26 Aug 2010 11:50:17 +0900
> > >> > KAMEZAWA Hiroyuki  wrote:
> > >> >
> > >> >> 128MB...too big ? But it's depend on config.
> > >> >>
> > >> >> IBM's ppc guys used 16MB section, and recently, a new interface to 
> > >> >> shrink
> > >> >> the number of /sys files are added, maybe usable.
> > >> >>
> > >> >> Something good with this approach will be you can create "cma" memory
> > >> >> before installing driver.
> > >> >>
> > >> >> But yes, complicated and need some works.
> > >> >>
> > >> > Ah, I need to clarify what I want to say.
> > >> >
> > >> > With compaction, it's helpful, but you can't get contiguous memory 
> > >> > larger
> > >> > than MAX_ORDER, I think. To get memory larger than MAX_ORDER on demand,
> > >> > memory hot-plug code has almost all necessary things.
> > >>
> > >> True. Doesn't patch's idea of Christoph helps this ?
> > >> http://lwn.net/Articles/200699/
> > >>
> > >
> > > yes, I think so. But, IIRC,  it's own purpose of Chirstoph's work is
> > > for removing zones. please be careful what's really necessary.
> > 
> > Ahh. Sorry for missing point.
> > You're right. The patch can't help our problem.
> > 
> > How about changing following this?
> > The thing is MAX_ORDER is static. But we want to avoid too big
> > MAX_ORDER of whole zones to support devices which requires big
> > allocation chunk.
> > So let's add MAX_ORDER into each zone and then, each zone can have
> > different max order.
> > For example, while DMA[32], NORMAL, HIGHMEM can have normal size 11,
> > MOVABLE zone could have a 15.
> > 
> > This approach has a big side effect?
> > 
> 
> Hm...need to check hard coded MAX_ORDER usages...I don't think
> side-effect is big. Hmm. But I think enlarging MAX_ORDER isn't an
> important thing. A code which strips contiguous chunks of pages from
> buddy allocator is a necessaty thing, as..
> 
> What I can think of at 1st is...
> ==
>   int steal_pages(unsigned long start_pfn, unsigned long end_pfn)
>   {
>   /* Be careful mutal execution with memory hotplug, because 
> reusing code */
> 
>   split [start_pfn, end_pfn) to pageblock_order
>   
>   for each pageblock in the range {
>   Mark this block as MIGRATE_ISOLATE
>   try-to-free pages in the range or
>   migrate pages in the range to somewhere.
>   /* Here all pages in the range are on buddy allocator
>   and free and never be allocated by anyone else. */
>   }
> 
>   please see __rmqueue_fallback(). it selects migration-type at 
> 1st.
>   Then, if you can pass start_migratetype of MIGLATE_ISOLATE,
>   you can automatically strip all MIGRATE_ISOLATE pages from 
> free_area[].
> 
>   return chunk of pages.
>   }
> ==
> 

Here is a rough code for this.
I'm sorry I can't have time to show enough good code. Maybe this cannot be
compiled. But you may be able to see what can be done with memory hotplug
or compaction code. I'll brush this up if someone has interest.
==


This is a code for creating isolated memory block of contiguous pages.

find_isolate_contig_block(unsigned long hint, unsigned long size)

will retrun [start, start+size] of isolated pages 
 - start > hint,
 - no memory holes within it.
 - page allocator will never touch pages within the range.

Of course, this can fail. This code makes use of memory-hotunplug's code.
But yes, you can think of reusing compaction codes. This is an example.
Not compiled at all...please don't see details.

---
 mm/isolation.c |  236 +
 1 file changed, 236 insertions(+)

Index: kametest/mm/isolation.c
===
--- /dev/null
+++ kametest/mm/isolation.c
@@ -0,0 +1,233 @@
+struct page_range {
+   unsigned long base, end, pages;
+};
+
+int __get_contig_block(unsigned long pfn, unsigned long nr_pages, void *arg)
+{
+   struct page_range *blockinfo = arg;
+
+   if (nr_pages > blockinfo->pages) {
+   blockinfo->base = pfn;
+   blockinfo->end = pfn + nr_pages;
+   return 1;
+   }
+   return 0;
+}
+
+
+unsigned long __find_contig_block(unsigned long base,
+   unsigned long end, unsigned long pages)
+{
+   unsigned long pfn, tmp, index;
+   struct page_range blockinfo;
+   int ret;
+
+   /* Skip memory holes */
+retry:
+   blockinfo.base = base;
+   blockinfo.end = end;
+   blockinfo.pages = pages;
+   ret = walk_system_ra