linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Denis CIOCCA <denis.ciocca@st.com>,
	Denis Ciocca <denis.ciocca@gmail.com>,
	Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
	Pavel Machek <pavel@denx.de>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"burman.yan@gmail.com" <burman.yan@gmail.com>
Subject: Re: STMicroelectronics gyroscopes driver.
Date: Fri, 30 Nov 2012 13:06:33 +0000	[thread overview]
Message-ID: <50B8AF59.9080906@kernel.org> (raw)
In-Reply-To: <50B88C20.4080402@metafoo.de>

On 11/30/2012 10:36 AM, Lars-Peter Clausen wrote:
> On 11/30/2012 10:13 AM, Denis CIOCCA wrote:
>> Hi Lars,
>>
>> yes you have right, the main difference between accelerometers driver and this driver is the "find and replace". :)
>> Yes, for now it is possible use the same driver for both devices, but in the next patch I will add some functionality, for example the FIFO hardware used in the gyro, ecc.
>> What do you suggest?
>>
>> In the future I will write also the drivers for the magnetometers and pressure sensors, I think the magnetometers driver is very similar to the accelerometers and magnetometers drivers, you suggest me to use the same code?
>> How it is possible to do this?
> 
> If the different device categories share some common bits and add custom
> bits on top of it, it may make sense to have a common base library module
> which implements the common bits and than have one driver per device type
> which uses the common library and implements the device type specific bits
> on top of it.
> 
> - Lars
> 
>> We can add a STMicroelectronics folder in the IIO tree to support all sensors?
We have the common directory for this sort of usage. If it makes sense stick an appropriate
folder under there (e.g. if there are a number of files).

Unless you want to hold it back, I'd suggest we merge the accelerometer driver as
is and then you do the common code stuff by refactoring that driver in tree.

If you prefer you can even merge the gyroscope driver as well then refactor them both.
Sometimes the easiest way to argue for a common library is to provide clear examples
from existing drivers in the tree.

At the end of the day I like common libraries if they cut down the code repitition
but don't make the code significantly harder to follow!

Jonathan

>>
>> Thanks
>> Best Regards,
>>
>> Denis
>>
>>
>> -----Original Message-----
>> From: Lars-Peter Clausen [mailto:lars@metafoo.de] 
>> Sent: Thursday, November 29, 2012 10:51 AM
>> To: Denis CIOCCA
>> Cc: Jonathan Cameron; Denis Ciocca; Jonathan Cameron; Pavel Machek; linux-iio@vger.kernel.org; burman.yan@gmail.com
>> Subject: Re: STMicroelectronics gyroscopes driver.
>>
>> On 11/27/2012 04:36 PM, Denis CIOCCA wrote:
>>> Hi guys,
>>>
>>> based on the driver for accelerometers, I wrote the driver for all our 
>>> last mems gyroscopes.
>>> Best regards,
>>>
>>> Denis
>>>
>>
>> How different are the gyros from the accelerometers? On a first quick glance the looks as if you took the accelerometer driver and did a search and replace on "accel" with "gyro". Can both be supported by the same driver?
>>
>> - Lars
> 

  reply	other threads:[~2012-11-30 13:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 15:39 STMicroelectronics accelerometers driver Denis CIOCCA
2012-10-08 19:14 ` Lars-Peter Clausen
2012-10-08 19:50   ` Pavel Machek
2012-10-08 20:33     ` Lars-Peter Clausen
2012-10-08 20:37       ` Jonathan Cameron
2012-10-14 15:05         ` Denis Ciocca
2012-10-14 19:08           ` Lars-Peter Clausen
2012-10-16 17:51           ` Lars-Peter Clausen
2012-10-22  9:31             ` Denis CIOCCA
2012-10-22 18:07               ` Jonathan Cameron
2012-10-22 19:37                 ` Denis Ciocca
2012-10-24 12:44                 ` Denis CIOCCA
2012-10-26 12:10                   ` Lars-Peter Clausen
2012-10-29  8:55                     ` Denis CIOCCA
2012-10-29  9:13                       ` Lars-Peter Clausen
2012-10-29 10:24                         ` Denis CIOCCA
2012-10-29 10:30                           ` Lars-Peter Clausen
2012-10-29 10:38                             ` Denis CIOCCA
2012-10-31 14:27                             ` Denis CIOCCA
2012-10-31 16:40                               ` Lars-Peter Clausen
2012-10-31 20:33                                 ` Jonathan Cameron
2012-11-04 10:09                                 ` Denis Ciocca
2012-11-05 21:28                                   ` Jonathan Cameron
2012-11-06 11:11                                     ` Denis CIOCCA
2012-11-12 17:10                                       ` Denis CIOCCA
2012-11-12 18:48                                         ` Jonathan Cameron
2012-11-13 15:38                                           ` Denis CIOCCA
2012-11-18 13:20                                             ` Jonathan Cameron
2012-11-23 16:10                                               ` Denis CIOCCA
2012-11-24 16:23                                                 ` Jonathan Cameron
2012-11-26 16:57                                                   ` Denis CIOCCA
2012-11-27 11:52                                                   ` Denis CIOCCA
2012-11-29  9:46                                                     ` Lars-Peter Clausen
2012-11-27 15:36                                                   ` STMicroelectronics gyroscopes driver Denis CIOCCA
2012-11-29  9:51                                                     ` Lars-Peter Clausen
2012-11-30  9:13                                                       ` Denis CIOCCA
2012-11-30 10:36                                                         ` Lars-Peter Clausen
2012-11-30 13:06                                                           ` Jonathan Cameron [this message]
2012-12-03 16:40                                                             ` STMicroelectronics driver Denis CIOCCA
2012-12-03 19:01                                                               ` Lars-Peter Clausen
2012-11-19 13:00                                             ` STMicroelectronics accelerometers driver Lars-Peter Clausen
2012-11-06 11:14                                     ` Denis CIOCCA

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B8AF59.9080906@kernel.org \
    --to=jic23@kernel.org \
    --cc=burman.yan@gmail.com \
    --cc=denis.ciocca@gmail.com \
    --cc=denis.ciocca@st.com \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pavel@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).