Re: STMicroelectronics gyroscopes driver.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx] 
>> Sent: Thursday, November 29, 2012 10:51 AM
>> To: Denis CIOCCA
>> Cc: Jonathan Cameron; Denis Ciocca; Jonathan Cameron; Pavel Machek; linux-iio@xxxxxxxxxxxxxxx; burman.yan@xxxxxxxxx
>> 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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux