Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-30 Thread Pavan Savoy
Matti/Hans,

--- On Mon, 30/8/10, Matti J. Aaltonen  wrote:

> From: Matti J. Aaltonen 
> Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.
> To: "ext Hans Verkuil" 
> Cc: "ext Pavan Savoy" , "Mauro Carvalho Chehab" 
> , "linux-media@vger.kernel.org" 
> , "Valentin Eduardo (Nokia-MS/Helsinki)" 
> , petri.karh...@nokia.com
> Date: Monday, 30 August, 2010, 5:14 PM
> Hello.
> 
> On Sat, 2010-08-28 at 11:29 +0200, ext Hans Verkuil wrote:
> > On Thursday, August 26, 2010 09:39:45 Matti J.
> Aaltonen wrote:
> > > Hi.
> > > 
> > > On Wed, 2010-08-25 at 23:20 +0200, ext Pavan
> Savoy wrote:
> > > > 
> > > > > I'm sorry for not answering to you
> earlier. But I don't
> > > > > have my own
> > > > > public repository. But to create the
> whole thing is
> > > > > extremely simple:
> > > > > just take the current mainline tree and
> apply my patches on
> > > > > top of it...
> > > > 
> > > > Yep, that I can do, the reason I asked for
> was, we've pushed a few patches of our own for WL1283 over
> shared transport/UART (Not HCI-VS, but I2C like commands,
> packed in a CH8 protocol format).
> > > > The FM register set in both chip are a
> match, with only transport being the difference (i2c vs.
> UART).
> > > > Also we have the Tx version of driver ready
> too, it just needs a bit of cleanup and more conformance to
> already existing V4L2 TX Class..
> > > > 
> > > > So I was wondering, although there is no
> problem with WL1273 with I2C and WL1283 with UART being
> there on the kernel (whenever that happens), but it would be
> way more cooler if the transport was say abstracted out ..
> > > > 
> > > > what do you say? just an idea...
> > > 
> > > I think it's a good idea. And the WL1273 ship can
> also used with a UART
> > > connection, we just chose I2C when the driver
> development started etc...
> > 
> > Making a completely bus-independent driver is actually
> possible. It would require
> > that the driver uses the subdev API
> (include/media/v4l2-subdev.h). Any register
> > read or writes can be done by calling the v4l2_device
> notify() callback and the
> > bridge/host driver can then translate the callback to
> either i2c or uart read
> > or writes.
> > 
> > Both v4l2_device and v4l2_subdev structs are
> completely abstract structs (i.e.
> > they do not rely on any particular bus), so it should
> be possible to implement
> > this.
> > 
> > I had this scenario in the back of my mind when I
> designed these APIs, but this
> > would be the first driver where this would actually
> apply to.
> > 
> 
> That sounds interesting. I think that after the driver gets
> accepted in
> its current form we can start to work according to the
> above scenario...

Please have a look at the patches at
http://www.mail-archive.com/linux-media@vger.kernel.org/msg21477.html

which are for Wl128x/UART transport.

also here's a tree where the other set of patches would come from,
http://git.omapzoom.org/?p=kernel/omap.git;a=tree;f=drivers/misc/ti-st;h=028ff4a739d7b59b94d0c613b5ef510ff338b65d;hb=refs/heads/p-android-omap-2.6.32

We are trying to make the drivers listed above conform to other V4L2 drivers 
and then post patches.

Please comment ...
Thanks in advance...

> Cheers,
> Matti
> 
> 
> 
> 
> 
> 
> 


--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-30 Thread Matti J. Aaltonen
Hello.

On Sat, 2010-08-28 at 11:29 +0200, ext Hans Verkuil wrote:
> On Thursday, August 26, 2010 09:39:45 Matti J. Aaltonen wrote:
> > Hi.
> > 
> > On Wed, 2010-08-25 at 23:20 +0200, ext Pavan Savoy wrote:
> > > 
> > > > I'm sorry for not answering to you earlier. But I don't
> > > > have my own
> > > > public repository. But to create the whole thing is
> > > > extremely simple:
> > > > just take the current mainline tree and apply my patches on
> > > > top of it...
> > > 
> > > Yep, that I can do, the reason I asked for was, we've pushed a few 
> > > patches of our own for WL1283 over shared transport/UART (Not HCI-VS, but 
> > > I2C like commands, packed in a CH8 protocol format).
> > > The FM register set in both chip are a match, with only transport being 
> > > the difference (i2c vs. UART).
> > > Also we have the Tx version of driver ready too, it just needs a bit of 
> > > cleanup and more conformance to already existing V4L2 TX Class..
> > > 
> > > So I was wondering, although there is no problem with WL1273 with I2C and 
> > > WL1283 with UART being there on the kernel (whenever that happens), but 
> > > it would be way more cooler if the transport was say abstracted out ..
> > > 
> > > what do you say? just an idea...
> > 
> > I think it's a good idea. And the WL1273 ship can also used with a UART
> > connection, we just chose I2C when the driver development started etc...
> 
> Making a completely bus-independent driver is actually possible. It would 
> require
> that the driver uses the subdev API (include/media/v4l2-subdev.h). Any 
> register
> read or writes can be done by calling the v4l2_device notify() callback and 
> the
> bridge/host driver can then translate the callback to either i2c or uart read
> or writes.
> 
> Both v4l2_device and v4l2_subdev structs are completely abstract structs (i.e.
> they do not rely on any particular bus), so it should be possible to implement
> this.
> 
> I had this scenario in the back of my mind when I designed these APIs, but 
> this
> would be the first driver where this would actually apply to.
> 

That sounds interesting. I think that after the driver gets accepted in
its current form we can start to work according to the above scenario...

Cheers,
Matti






--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-28 Thread Hans Verkuil
On Thursday, August 26, 2010 09:39:45 Matti J. Aaltonen wrote:
> Hi.
> 
> On Wed, 2010-08-25 at 23:20 +0200, ext Pavan Savoy wrote:
> > 
> > > I'm sorry for not answering to you earlier. But I don't
> > > have my own
> > > public repository. But to create the whole thing is
> > > extremely simple:
> > > just take the current mainline tree and apply my patches on
> > > top of it...
> > 
> > Yep, that I can do, the reason I asked for was, we've pushed a few patches 
> > of our own for WL1283 over shared transport/UART (Not HCI-VS, but I2C like 
> > commands, packed in a CH8 protocol format).
> > The FM register set in both chip are a match, with only transport being the 
> > difference (i2c vs. UART).
> > Also we have the Tx version of driver ready too, it just needs a bit of 
> > cleanup and more conformance to already existing V4L2 TX Class..
> > 
> > So I was wondering, although there is no problem with WL1273 with I2C and 
> > WL1283 with UART being there on the kernel (whenever that happens), but it 
> > would be way more cooler if the transport was say abstracted out ..
> > 
> > what do you say? just an idea...
> 
> I think it's a good idea. And the WL1273 ship can also used with a UART
> connection, we just chose I2C when the driver development started etc...

Making a completely bus-independent driver is actually possible. It would 
require
that the driver uses the subdev API (include/media/v4l2-subdev.h). Any register
read or writes can be done by calling the v4l2_device notify() callback and the
bridge/host driver can then translate the callback to either i2c or uart read
or writes.

Both v4l2_device and v4l2_subdev structs are completely abstract structs (i.e.
they do not rely on any particular bus), so it should be possible to implement
this.

I had this scenario in the back of my mind when I designed these APIs, but this
would be the first driver where this would actually apply to.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-26 Thread Matti J. Aaltonen
Hi.

On Wed, 2010-08-25 at 23:20 +0200, ext Pavan Savoy wrote:
> 
> > I'm sorry for not answering to you earlier. But I don't
> > have my own
> > public repository. But to create the whole thing is
> > extremely simple:
> > just take the current mainline tree and apply my patches on
> > top of it...
> 
> Yep, that I can do, the reason I asked for was, we've pushed a few patches of 
> our own for WL1283 over shared transport/UART (Not HCI-VS, but I2C like 
> commands, packed in a CH8 protocol format).
> The FM register set in both chip are a match, with only transport being the 
> difference (i2c vs. UART).
> Also we have the Tx version of driver ready too, it just needs a bit of 
> cleanup and more conformance to already existing V4L2 TX Class..
> 
> So I was wondering, although there is no problem with WL1273 with I2C and 
> WL1283 with UART being there on the kernel (whenever that happens), but it 
> would be way more cooler if the transport was say abstracted out ..
> 
> what do you say? just an idea...

I think it's a good idea. And the WL1273 ship can also used with a UART
connection, we just chose I2C when the driver development started etc...

B.R.
Matti A.


--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-25 Thread Pavan Savoy


--- On Thu, 19/8/10, Matti J. Aaltonen  wrote:

> From: Matti J. Aaltonen 
> Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.
> To: "ext Pavan Savoy" 
> Cc: "Mauro Carvalho Chehab" , 
> "linux-media@vger.kernel.org" , 
> "hverk...@xs4all.nl" , "Valentin Eduardo 
> (Nokia-MS/Helsinki)" 
> Date: Thursday, 19 August, 2010, 12:35 PM
> Hello.
> 
> 
> On Wed, 2010-08-18 at 20:14 +0200, ext Pavan Savoy wrote:
> > --- On Wed, 7/7/10, Pavan Savoy 
> wrote:
> > > 
> > > From: Pavan Savoy 
> > > Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio:
> MFD driver for the FM radio.
> > > To: "Matti J. Aaltonen" ,
> "Mauro Carvalho Chehab" 
> > > Cc: linux-media@vger.kernel.org,
> hverk...@xs4all.nl,
> eduardo.valen...@nokia.com,
> "pavan savoy" 
> > > Date: Wednesday, 7 July, 2010, 10:51 AM
> > >
> > > --- On Tue, 6/7/10, Mauro Carvalho Chehab 
> > > wrote:
> > >
> > > > From: Mauro Carvalho Chehab 
> > > > Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM
> Radio: MFD
> > > driver for the FM radio.
> > > > To: "Matti J. Aaltonen" 
> > > > Cc: linux-media@vger.kernel.org,
> > > hverk...@xs4all.nl,
> > > eduardo.valen...@nokia.com
> > > > Date: Tuesday, 6 July, 2010, 8:04 AM
> > > > Em 04-06-2010 07:34, Matti J.
> > > > Aaltonen escreveu:
> > > > > This is a parent driver for two child
> drivers:
> > > the
> > > > V4L2 driver and
> > > > > the ALSA codec driver. The MFD part
> provides the
> > > I2C
> > > > communication
> > > > > to the device and a couple of functions
> that are
> > > > called from both
> > > > > children.
> > >
> > > Where can I have a look at the whole code ? As in
> some
> > > local tree, where all codes are put up ?
> > > Basically, we have a V4L2 driver for WL128x
> (using TTY as
> > > transport) and plan to push them soon ...
> > >
> > > This would be a nice input ...
> > 
> > Anywhere I can have a look at the whole code?
> > We are trying to push out V4L2 drivers for FM on 128x,
> and intend to use several V4L2 new ioctls which you have
> defined (_BAND_) being one of them.
> > 
> > Also we plan to push FM Tx of it too.. TX_CLASS from
> V4L2 has most of the ioctls and plan to introduce the rest.
> 
> I'm sorry for not answering to you earlier. But I don't
> have my own
> public repository. But to create the whole thing is
> extremely simple:
> just take the current mainline tree and apply my patches on
> top of it...

Yep, that I can do, the reason I asked for was, we've pushed a few patches of 
our own for WL1283 over shared transport/UART (Not HCI-VS, but I2C like 
commands, packed in a CH8 protocol format).
The FM register set in both chip are a match, with only transport being the 
difference (i2c vs. UART).
Also we have the Tx version of driver ready too, it just needs a bit of cleanup 
and more conformance to already existing V4L2 TX Class..

So I was wondering, although there is no problem with WL1273 with I2C and 
WL1283 with UART being there on the kernel (whenever that happens), but it 
would be way more cooler if the transport was say abstracted out ..

what do you say? just an idea...

> Best Regards,
> Matti
> 
> > 
> > >
> > > > > Signed-off-by: Matti J. Aaltonen 
> > > > > ---
> > > > >  drivers/mfd/Kconfig
> > > >      |    6 +
> > > > >  drivers/mfd/Makefile
> > > >     |    2 +
> > > > >  drivers/mfd/wl1273-core.c
> > > >    |  616
> > > > +++
> > > > >  include/linux/mfd/wl1273-core.h
> |  326
> > > > +
> > > > >  4 files changed, 950
> insertions(+), 0
> > > > deletions(-)
> > > > >  create mode 100644
> drivers/mfd/wl1273-core.c
> > > > >  create mode 100644
> > > > include/linux/mfd/wl1273-core.h
> > > > >
> > > > > diff --git a/drivers/mfd/Kconfig
> > > > b/drivers/mfd/Kconfig
> > > > > index 413576a..5998a94 100644
> > > > > --- a/drivers/mfd/Kconfig
> > > > > +++ b/drivers/mfd/Kconfig
> > > > > @@ -135,6 +135,12 @@ config
> TWL4030_CODEC
> > > > >      select MFD_CORE
> > > > >      default n
> > >

Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-19 Thread Matti J. Aaltonen
Hello.


On Wed, 2010-08-18 at 20:14 +0200, ext Pavan Savoy wrote:
> --- On Wed, 7/7/10, Pavan Savoy  wrote:
> > 
> > From: Pavan Savoy 
> > Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM 
> > radio.
> > To: "Matti J. Aaltonen" , "Mauro Carvalho 
> > Chehab" 
> > Cc: linux-media@vger.kernel.org, hverk...@xs4all.nl, 
> > eduardo.valen...@nokia.com, "pavan savoy" 
> > Date: Wednesday, 7 July, 2010, 10:51 AM
> >
> > --- On Tue, 6/7/10, Mauro Carvalho Chehab 
> > wrote:
> >
> > > From: Mauro Carvalho Chehab 
> > > Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD
> > driver for the FM radio.
> > > To: "Matti J. Aaltonen" 
> > > Cc: linux-media@vger.kernel.org,
> > hverk...@xs4all.nl,
> > eduardo.valen...@nokia.com
> > > Date: Tuesday, 6 July, 2010, 8:04 AM
> > > Em 04-06-2010 07:34, Matti J.
> > > Aaltonen escreveu:
> > > > This is a parent driver for two child drivers:
> > the
> > > V4L2 driver and
> > > > the ALSA codec driver. The MFD part provides the
> > I2C
> > > communication
> > > > to the device and a couple of functions that are
> > > called from both
> > > > children.
> >
> > Where can I have a look at the whole code ? As in some
> > local tree, where all codes are put up ?
> > Basically, we have a V4L2 driver for WL128x (using TTY as
> > transport) and plan to push them soon ...
> >
> > This would be a nice input ...
> 
> Anywhere I can have a look at the whole code?
> We are trying to push out V4L2 drivers for FM on 128x, and intend to use 
> several V4L2 new ioctls which you have defined (_BAND_) being one of them.
> 
> Also we plan to push FM Tx of it too.. TX_CLASS from V4L2 has most of the 
> ioctls and plan to introduce the rest.

I'm sorry for not answering to you earlier. But I don't have my own
public repository. But to create the whole thing is extremely simple:
just take the current mainline tree and apply my patches on top of it...

Best Regards,
Matti

> 
> >
> > > > Signed-off-by: Matti J. Aaltonen 
> > > > ---
> > > >  drivers/mfd/Kconfig
> > >  |6 +
> > > >  drivers/mfd/Makefile
> > > |2 +
> > > >  drivers/mfd/wl1273-core.c
> > >|  616
> > > +++
> > > >  include/linux/mfd/wl1273-core.h |  326
> > > +
> > > >  4 files changed, 950 insertions(+), 0
> > > deletions(-)
> > > >  create mode 100644 drivers/mfd/wl1273-core.c
> > > >  create mode 100644
> > > include/linux/mfd/wl1273-core.h
> > > >
> > > > diff --git a/drivers/mfd/Kconfig
> > > b/drivers/mfd/Kconfig
> > > > index 413576a..5998a94 100644
> > > > --- a/drivers/mfd/Kconfig
> > > > +++ b/drivers/mfd/Kconfig
> > > > @@ -135,6 +135,12 @@ config TWL4030_CODEC
> > > >  select MFD_CORE
> > > >  default n
> > > >
> > > > +config WL1273_CORE
> > > > +bool
> > > > +depends on I2C
> > > > +select MFD_CORE
> > > > +default n
> > > > +
> > > >  config MFD_TMIO
> > > >  bool
> > > >  default n
> > > > diff --git a/drivers/mfd/Makefile
> > > b/drivers/mfd/Makefile
> > > > index 78295d6..46e611d 100644
> > > > --- a/drivers/mfd/Makefile
> > > > +++ b/drivers/mfd/Makefile
> > > > @@ -30,6 +30,8 @@
> > > obj-$(CONFIG_TWL4030_CORE)+= twl-core.o
> > > twl4030-irq.o twl6030-irq.o
> > > >  obj-$(CONFIG_TWL4030_POWER)+=
> > > twl4030-power.o
> > > >  obj-$(CONFIG_TWL4030_CODEC)+=
> > > twl4030-codec.o
> > > >
> > > > +obj-$(CONFIG_WL1273_CORE)+=
> > > wl1273-core.o
> > > > +
> > > >  obj-$(CONFIG_MFD_MC13783)+=
> > > mc13783-core.o
> > > >
> > > >  obj-$(CONFIG_MFD_CORE)
> > > += mfd-core.o
> > > > diff --git a/drivers/mfd/wl1273-core.c
> > > b/drivers/mfd/wl1273-core.c
> > > > new file mode 100644
> > > > index 000..6c7dbba
> > > > --- /dev/null
> > > > +++ b/drivers/mfd/wl1273-core.c
> > > > @@ -0,0 +1,616 @@
> > > > +/*
> > > > + * MFD driver for wl1273 FM radio and audio
> > codec
&g

Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-08-18 Thread Pavan Savoy

--- On Wed, 7/7/10, Pavan Savoy  wrote:

> From: Pavan Savoy 
> Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.
> To: "Matti J. Aaltonen" , "Mauro Carvalho Chehab" 
> 
> Cc: linux-media@vger.kernel.org, hverk...@xs4all.nl, 
> eduardo.valen...@nokia.com, "pavan savoy" 
> Date: Wednesday, 7 July, 2010, 10:51 AM
> 
> --- On Tue, 6/7/10, Mauro Carvalho Chehab 
> wrote:
> 
> > From: Mauro Carvalho Chehab 
> > Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD
> driver for the FM radio.
> > To: "Matti J. Aaltonen" 
> > Cc: linux-media@vger.kernel.org,
> hverk...@xs4all.nl,
> eduardo.valen...@nokia.com
> > Date: Tuesday, 6 July, 2010, 8:04 AM
> > Em 04-06-2010 07:34, Matti J.
> > Aaltonen escreveu:
> > > This is a parent driver for two child drivers:
> the
> > V4L2 driver and
> > > the ALSA codec driver. The MFD part provides the
> I2C
> > communication
> > > to the device and a couple of functions that are
> > called from both
> > > children.
> 
> Where can I have a look at the whole code ? As in some
> local tree, where all codes are put up ?
> Basically, we have a V4L2 driver for WL128x (using TTY as
> transport) and plan to push them soon ...
> 
> This would be a nice input ...

Anywhere I can have a look at the whole code?
We are trying to push out V4L2 drivers for FM on 128x, and intend to use 
several V4L2 new ioctls which you have defined (_BAND_) being one of them.

Also we plan to push FM Tx of it too.. TX_CLASS from V4L2 has most of the 
ioctls and plan to introduce the rest.

> 
> > > Signed-off-by: Matti J. Aaltonen 
> > > ---
> > >  drivers/mfd/Kconfig       
> >      |    6 +
> > >  drivers/mfd/Makefile       
> >     |    2 +
> > >  drivers/mfd/wl1273-core.c   
> >    |  616
> > +++
> > >  include/linux/mfd/wl1273-core.h |  326
> > +
> > >  4 files changed, 950 insertions(+), 0
> > deletions(-)
> > >  create mode 100644 drivers/mfd/wl1273-core.c
> > >  create mode 100644
> > include/linux/mfd/wl1273-core.h
> > > 
> > > diff --git a/drivers/mfd/Kconfig
> > b/drivers/mfd/Kconfig
> > > index 413576a..5998a94 100644
> > > --- a/drivers/mfd/Kconfig
> > > +++ b/drivers/mfd/Kconfig
> > > @@ -135,6 +135,12 @@ config TWL4030_CODEC
> > >      select MFD_CORE
> > >      default n
> > >  
> > > +config WL1273_CORE
> > > +    bool
> > > +    depends on I2C
> > > +    select MFD_CORE
> > > +    default n
> > > +
> > >  config MFD_TMIO
> > >      bool
> > >      default n
> > > diff --git a/drivers/mfd/Makefile
> > b/drivers/mfd/Makefile
> > > index 78295d6..46e611d 100644
> > > --- a/drivers/mfd/Makefile
> > > +++ b/drivers/mfd/Makefile
> > > @@ -30,6 +30,8 @@
> > obj-$(CONFIG_TWL4030_CORE)    += twl-core.o
> > twl4030-irq.o twl6030-irq.o
> > >  obj-$(CONFIG_TWL4030_POWER)    +=
> > twl4030-power.o
> > >  obj-$(CONFIG_TWL4030_CODEC)    +=
> > twl4030-codec.o
> > >  
> > > +obj-$(CONFIG_WL1273_CORE)    +=
> > wl1273-core.o
> > > +
> > >  obj-$(CONFIG_MFD_MC13783)    +=
> > mc13783-core.o
> > >  
> > >  obj-$(CONFIG_MFD_CORE)   
> >     += mfd-core.o
> > > diff --git a/drivers/mfd/wl1273-core.c
> > b/drivers/mfd/wl1273-core.c
> > > new file mode 100644
> > > index 000..6c7dbba
> > > --- /dev/null
> > > +++ b/drivers/mfd/wl1273-core.c
> > > @@ -0,0 +1,616 @@
> > > +/*
> > > + * MFD driver for wl1273 FM radio and audio
> codec
> > submodules.
> > > + *
> > > + * Author:    Matti Aaltonen 
> > > + *
> > > + * Copyright:   (C) 2010 Nokia
> > 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 h

Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-07-19 Thread m7aalton
Hello and

thanks for the comments Mauro... One quick comment:

On Tue, 2010-07-06 at 04:34 +0200, ext Mauro Carvalho Chehab wrote:
> > + core->rx_frequency =
> > + bands[core->band].bottom_frequency +
> > + freq * 50;
> > +
> > + /*
> > +  *  The driver works better with this msleep,
> > +  *  the documentation doesn't mention it.
> > +  */
> > + msleep(10);
> 
> 
> msleep on an irq handler? You shouldn't be doing it! You're not allowed to 
> sleep
> during IRQ time. Kernel can panic here. You'll probably need to defer work and
> handle it outside irq time.


This is not the IRQ handler, this is the irq thread function.

> > +
> > + r = request_threaded_irq(client->irq, NULL,
> > +  wl1273_fm_irq_thread_handler,
> > +  IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
> > +  "wl1273-fm", core);


B.R.
Matti A.


--
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 v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-07-09 Thread Hans Verkuil
Hi Matti,

My apologies for the long delay in reviewing. But here is (finally!) my
review of this code.

On Friday 04 June 2010 12:34:20 Matti J. Aaltonen wrote:
> This is a parent driver for two child drivers: the V4L2 driver and
> the ALSA codec driver. The MFD part provides the I2C communication
> to the device and a couple of functions that are called from both
> children.
> 
> Signed-off-by: Matti J. Aaltonen 
> ---
>  drivers/mfd/Kconfig |6 +
>  drivers/mfd/Makefile|2 +
>  drivers/mfd/wl1273-core.c   |  616 
> +++
>  include/linux/mfd/wl1273-core.h |  326 +
>  4 files changed, 950 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/wl1273-core.c
>  create mode 100644 include/linux/mfd/wl1273-core.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 413576a..5998a94 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -135,6 +135,12 @@ config TWL4030_CODEC
>   select MFD_CORE
>   default n
>  
> +config WL1273_CORE
> + bool
> + depends on I2C
> + select MFD_CORE
> + default n
> +
>  config MFD_TMIO
>   bool
>   default n
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 78295d6..46e611d 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -30,6 +30,8 @@ obj-$(CONFIG_TWL4030_CORE)  += twl-core.o twl4030-irq.o 
> twl6030-irq.o
>  obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
>  obj-$(CONFIG_TWL4030_CODEC)  += twl4030-codec.o
>  
> +obj-$(CONFIG_WL1273_CORE)+= wl1273-core.o
> +
>  obj-$(CONFIG_MFD_MC13783)+= mc13783-core.o
>  
>  obj-$(CONFIG_MFD_CORE)   += mfd-core.o
> diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
> new file mode 100644
> index 000..6c7dbba
> --- /dev/null
> +++ b/drivers/mfd/wl1273-core.c
> @@ -0,0 +1,616 @@
> +/*
> + * MFD driver for wl1273 FM radio and audio codec submodules.
> + *
> + * Author:   Matti Aaltonen 
> + *
> + * Copyright:   (C) 2010 Nokia 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., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#undef DEBUG
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define DRIVER_DESC "WL1273 FM Radio Core"
> +
> +#define WL1273_IRQ_MASK   (WL1273_FR_EVENT   |   \
> +   WL1273_POW_ENB_EVENT)
> +
> +static const struct band_info bands[] = {
> + /* USA & Europe */
> + {
> + .bottom_frequency   = 87500,
> + .top_frequency  = 108000,
> + .band   = V4L2_FM_BAND_OTHER,
> + },
> + /* Japan */
> + {
> + .bottom_frequency   = 76000,
> + .top_frequency  = 9,
> + .band   = V4L2_FM_BAND_JAPAN,
> + },
> +};
> +
> +/*
> + * static unsigned char radio_band - Band
> + *
> + * The bands are 0=Japan, 1=USA-Europe. USA-Europe is the default.
> + */
> +static unsigned char radio_band = 1;
> +module_param(radio_band, byte, 0);
> +MODULE_PARM_DESC(radio_band, "Band: 0=Japan, 1=USA-Europe*");
> +
> +/*
> + * static unsigned int rds_buf - the number of RDS buffer blocks used.
> + *
> + * The default number is 100.
> + */
> +static unsigned int rds_buf = 100;
> +module_param(rds_buf, uint, 0);
> +MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*");
> +
> +int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value)
> +{
> + struct i2c_client *client = core->i2c_dev;
> + u8 b[2];
> + int r;
> +
> + r = i2c_smbus_read_i2c_block_data(client, reg, 2, b);
> + if (r != 2) {
> + dev_err(&client->dev, "%s: Read: %d fails.\n", __func__, reg);
> + return -EREMOTEIO;
> + }
> +
> + *value = (u16)b[0] << 8 | b[1];
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(wl1273_fm_read_reg);
> +
> +int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param)
> +{
> + struct i2c_client *client = core->i2c_dev;
> + u8 buf[] = { (param >> 8) & 0xff, param & 0xff };
> + int r;
> +
> + r = i2c_smbus_write_i2c_block_data(client, cmd, 2, buf);
> + if (r) {
> + dev_err(&client->dev, "%s: Cmd: %d fails.\n", __func_

Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-07-06 Thread Pavan Savoy

--- On Tue, 6/7/10, Mauro Carvalho Chehab  wrote:

> From: Mauro Carvalho Chehab 
> Subject: Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.
> To: "Matti J. Aaltonen" 
> Cc: linux-media@vger.kernel.org, hverk...@xs4all.nl, 
> eduardo.valen...@nokia.com
> Date: Tuesday, 6 July, 2010, 8:04 AM
> Em 04-06-2010 07:34, Matti J.
> Aaltonen escreveu:
> > This is a parent driver for two child drivers: the
> V4L2 driver and
> > the ALSA codec driver. The MFD part provides the I2C
> communication
> > to the device and a couple of functions that are
> called from both
> > children.

Where can I have a look at the whole code ? As in some local tree, where all 
codes are put up ?
Basically, we have a V4L2 driver for WL128x (using TTY as transport) and plan 
to push them soon ...

This would be a nice input ...


> > Signed-off-by: Matti J. Aaltonen 
> > ---
> >  drivers/mfd/Kconfig       
>      |    6 +
> >  drivers/mfd/Makefile       
>     |    2 +
> >  drivers/mfd/wl1273-core.c   
>    |  616
> +++
> >  include/linux/mfd/wl1273-core.h |  326
> +
> >  4 files changed, 950 insertions(+), 0
> deletions(-)
> >  create mode 100644 drivers/mfd/wl1273-core.c
> >  create mode 100644
> include/linux/mfd/wl1273-core.h
> > 
> > diff --git a/drivers/mfd/Kconfig
> b/drivers/mfd/Kconfig
> > index 413576a..5998a94 100644
> > --- a/drivers/mfd/Kconfig
> > +++ b/drivers/mfd/Kconfig
> > @@ -135,6 +135,12 @@ config TWL4030_CODEC
> >      select MFD_CORE
> >      default n
> >  
> > +config WL1273_CORE
> > +    bool
> > +    depends on I2C
> > +    select MFD_CORE
> > +    default n
> > +
> >  config MFD_TMIO
> >      bool
> >      default n
> > diff --git a/drivers/mfd/Makefile
> b/drivers/mfd/Makefile
> > index 78295d6..46e611d 100644
> > --- a/drivers/mfd/Makefile
> > +++ b/drivers/mfd/Makefile
> > @@ -30,6 +30,8 @@
> obj-$(CONFIG_TWL4030_CORE)    += twl-core.o
> twl4030-irq.o twl6030-irq.o
> >  obj-$(CONFIG_TWL4030_POWER)    +=
> twl4030-power.o
> >  obj-$(CONFIG_TWL4030_CODEC)    +=
> twl4030-codec.o
> >  
> > +obj-$(CONFIG_WL1273_CORE)    +=
> wl1273-core.o
> > +
> >  obj-$(CONFIG_MFD_MC13783)    +=
> mc13783-core.o
> >  
> >  obj-$(CONFIG_MFD_CORE)   
>     += mfd-core.o
> > diff --git a/drivers/mfd/wl1273-core.c
> b/drivers/mfd/wl1273-core.c
> > new file mode 100644
> > index 000..6c7dbba
> > --- /dev/null
> > +++ b/drivers/mfd/wl1273-core.c
> > @@ -0,0 +1,616 @@
> > +/*
> > + * MFD driver for wl1273 FM radio and audio codec
> submodules.
> > + *
> > + * Author:    Matti Aaltonen 
> > + *
> > + * Copyright:   (C) 2010 Nokia
> 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., 51 Franklin St, Fifth Floor,
> Boston, MA
> > + * 02110-1301 USA
> > + *
> > + */
> > +
> > +#undef DEBUG
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define DRIVER_DESC "WL1273 FM Radio Core"
> > +
> > +#define
> WL1273_IRQ_MASK (WL1273_FR_EVENT   
>     |    \
> > +       
>       WL1273_POW_ENB_EVENT)
> > +
> > +static const struct band_info bands[] = {
> > +    /* USA & Europe */
> > +    {
> > +       
> .bottom_frequency    = 87500,
> > +       
> .top_frequency        =
> 108000,
> > +       
> .band       
>     = V4L2_FM_BAND_OTHER,
> > +    },
> > +    /* Japan */
> > +    {
> > +       
> .bottom_frequency    = 76000,
> > +       
> .top_frequency        =
> 9,
> > +       
&

Re: [PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-07-05 Thread Mauro Carvalho Chehab
Em 04-06-2010 07:34, Matti J. Aaltonen escreveu:
> This is a parent driver for two child drivers: the V4L2 driver and
> the ALSA codec driver. The MFD part provides the I2C communication
> to the device and a couple of functions that are called from both
> children.
> 
> Signed-off-by: Matti J. Aaltonen 
> ---
>  drivers/mfd/Kconfig |6 +
>  drivers/mfd/Makefile|2 +
>  drivers/mfd/wl1273-core.c   |  616 
> +++
>  include/linux/mfd/wl1273-core.h |  326 +
>  4 files changed, 950 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mfd/wl1273-core.c
>  create mode 100644 include/linux/mfd/wl1273-core.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 413576a..5998a94 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -135,6 +135,12 @@ config TWL4030_CODEC
>   select MFD_CORE
>   default n
>  
> +config WL1273_CORE
> + bool
> + depends on I2C
> + select MFD_CORE
> + default n
> +
>  config MFD_TMIO
>   bool
>   default n
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 78295d6..46e611d 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -30,6 +30,8 @@ obj-$(CONFIG_TWL4030_CORE)  += twl-core.o twl4030-irq.o 
> twl6030-irq.o
>  obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
>  obj-$(CONFIG_TWL4030_CODEC)  += twl4030-codec.o
>  
> +obj-$(CONFIG_WL1273_CORE)+= wl1273-core.o
> +
>  obj-$(CONFIG_MFD_MC13783)+= mc13783-core.o
>  
>  obj-$(CONFIG_MFD_CORE)   += mfd-core.o
> diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
> new file mode 100644
> index 000..6c7dbba
> --- /dev/null
> +++ b/drivers/mfd/wl1273-core.c
> @@ -0,0 +1,616 @@
> +/*
> + * MFD driver for wl1273 FM radio and audio codec submodules.
> + *
> + * Author:   Matti Aaltonen 
> + *
> + * Copyright:   (C) 2010 Nokia 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., 51 Franklin St, Fifth Floor, Boston, MA
> + * 02110-1301 USA
> + *
> + */
> +
> +#undef DEBUG
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define DRIVER_DESC "WL1273 FM Radio Core"
> +
> +#define WL1273_IRQ_MASK   (WL1273_FR_EVENT   |   \
> +   WL1273_POW_ENB_EVENT)
> +
> +static const struct band_info bands[] = {
> + /* USA & Europe */
> + {
> + .bottom_frequency   = 87500,
> + .top_frequency  = 108000,
> + .band   = V4L2_FM_BAND_OTHER,
> + },
> + /* Japan */
> + {
> + .bottom_frequency   = 76000,
> + .top_frequency  = 9,
> + .band   = V4L2_FM_BAND_JAPAN,
> + },
> +};
> +
> +/*
> + * static unsigned char radio_band - Band
> + *
> + * The bands are 0=Japan, 1=USA-Europe. USA-Europe is the default.
> + */
> +static unsigned char radio_band = 1;
> +module_param(radio_band, byte, 0);
> +MODULE_PARM_DESC(radio_band, "Band: 0=Japan, 1=USA-Europe*");
> +
> +/*
> + * static unsigned int rds_buf - the number of RDS buffer blocks used.
> + *
> + * The default number is 100.
> + */
> +static unsigned int rds_buf = 100;
> +module_param(rds_buf, uint, 0);
> +MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*");
> +
> +int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value)
> +{
> + struct i2c_client *client = core->i2c_dev;
> + u8 b[2];
> + int r;
> +
> + r = i2c_smbus_read_i2c_block_data(client, reg, 2, b);
> + if (r != 2) {
> + dev_err(&client->dev, "%s: Read: %d fails.\n", __func__, reg);
> + return -EREMOTEIO;
> + }
> +
> + *value = (u16)b[0] << 8 | b[1];
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(wl1273_fm_read_reg);
> +
> +int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param)
> +{
> + struct i2c_client *client = core->i2c_dev;
> + u8 buf[] = { (param >> 8) & 0xff, param & 0xff };
> + int r;
> +
> + r = i2c_smbus_write_i2c_block_data(client, cmd, 2, buf);
> + if (r) {
> + dev_err(&client->dev, "%s: Cmd: %d fails.\n", __func__, cmd);
> + return r;
> + }
> +
> + return 0;
> +}
> +EXPORT_SYMBOL(wl1273_fm_write_cmd);
> 

[PATCH v4 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio.

2010-06-04 Thread Matti J. Aaltonen
This is a parent driver for two child drivers: the V4L2 driver and
the ALSA codec driver. The MFD part provides the I2C communication
to the device and a couple of functions that are called from both
children.

Signed-off-by: Matti J. Aaltonen 
---
 drivers/mfd/Kconfig |6 +
 drivers/mfd/Makefile|2 +
 drivers/mfd/wl1273-core.c   |  616 +++
 include/linux/mfd/wl1273-core.h |  326 +
 4 files changed, 950 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mfd/wl1273-core.c
 create mode 100644 include/linux/mfd/wl1273-core.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 413576a..5998a94 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -135,6 +135,12 @@ config TWL4030_CODEC
select MFD_CORE
default n
 
+config WL1273_CORE
+   bool
+   depends on I2C
+   select MFD_CORE
+   default n
+
 config MFD_TMIO
bool
default n
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 78295d6..46e611d 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -30,6 +30,8 @@ obj-$(CONFIG_TWL4030_CORE)+= twl-core.o twl4030-irq.o 
twl6030-irq.o
 obj-$(CONFIG_TWL4030_POWER)+= twl4030-power.o
 obj-$(CONFIG_TWL4030_CODEC)+= twl4030-codec.o
 
+obj-$(CONFIG_WL1273_CORE)  += wl1273-core.o
+
 obj-$(CONFIG_MFD_MC13783)  += mc13783-core.o
 
 obj-$(CONFIG_MFD_CORE) += mfd-core.o
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
new file mode 100644
index 000..6c7dbba
--- /dev/null
+++ b/drivers/mfd/wl1273-core.c
@@ -0,0 +1,616 @@
+/*
+ * MFD driver for wl1273 FM radio and audio codec submodules.
+ *
+ * Author: Matti Aaltonen 
+ *
+ * Copyright:   (C) 2010 Nokia 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#undef DEBUG
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define DRIVER_DESC "WL1273 FM Radio Core"
+
+#define WL1273_IRQ_MASK (WL1273_FR_EVENT   |   \
+ WL1273_POW_ENB_EVENT)
+
+static const struct band_info bands[] = {
+   /* USA & Europe */
+   {
+   .bottom_frequency   = 87500,
+   .top_frequency  = 108000,
+   .band   = V4L2_FM_BAND_OTHER,
+   },
+   /* Japan */
+   {
+   .bottom_frequency   = 76000,
+   .top_frequency  = 9,
+   .band   = V4L2_FM_BAND_JAPAN,
+   },
+};
+
+/*
+ * static unsigned char radio_band - Band
+ *
+ * The bands are 0=Japan, 1=USA-Europe. USA-Europe is the default.
+ */
+static unsigned char radio_band = 1;
+module_param(radio_band, byte, 0);
+MODULE_PARM_DESC(radio_band, "Band: 0=Japan, 1=USA-Europe*");
+
+/*
+ * static unsigned int rds_buf - the number of RDS buffer blocks used.
+ *
+ * The default number is 100.
+ */
+static unsigned int rds_buf = 100;
+module_param(rds_buf, uint, 0);
+MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*");
+
+int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value)
+{
+   struct i2c_client *client = core->i2c_dev;
+   u8 b[2];
+   int r;
+
+   r = i2c_smbus_read_i2c_block_data(client, reg, 2, b);
+   if (r != 2) {
+   dev_err(&client->dev, "%s: Read: %d fails.\n", __func__, reg);
+   return -EREMOTEIO;
+   }
+
+   *value = (u16)b[0] << 8 | b[1];
+
+   return 0;
+}
+EXPORT_SYMBOL(wl1273_fm_read_reg);
+
+int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param)
+{
+   struct i2c_client *client = core->i2c_dev;
+   u8 buf[] = { (param >> 8) & 0xff, param & 0xff };
+   int r;
+
+   r = i2c_smbus_write_i2c_block_data(client, cmd, 2, buf);
+   if (r) {
+   dev_err(&client->dev, "%s: Cmd: %d fails.\n", __func__, cmd);
+   return r;
+   }
+
+   return 0;
+}
+EXPORT_SYMBOL(wl1273_fm_write_cmd);
+
+int wl1273_fm_write_data(struct wl1273_core *core, u8 *data, u16 len)
+{
+   struct i2c_client *client = core->i2c_dev;
+   struct i2c_msg msg[1];
+   int r;
+
+   msg[0].addr = client->addr;
+   msg[0].flags = 0;
+   msg[0].buf = data;
+   msg[0].len = len;
+