All of lore.kernel.org
 help / color / mirror / Atom feed
* BMA250 support
@ 2015-09-10 15:02 Violeta Menendez Gonzalez
  2015-09-11  8:57 ` Laurentiu Palcu
  0 siblings, 1 reply; 4+ messages in thread
From: Violeta Menendez Gonzalez @ 2015-09-10 15:02 UTC (permalink / raw)
  To: linux-iio, Peter Meerwald, Laurentiu Palcu, Jonathan Cameron
  Cc: Ben Dooks, linux-kernel

Hi,

I've been taking a look at the accelerometer drivers meaning to add some
features for the chip BMA250.

I've seen that this chip is supported by the bma180 driver [1], and that
there's another driver for bmc150 [2] that supports BMA250E. Looking at
the datasheets [3][4][5] I can't really understand why it is that way,
as BMA250 and BMA250E register map looks exactly the same except for the
FIFO memory, and BMA250 doesn't look similar to BMA180 to me.

After some research on the internet and talking to Ben Dooks (who is
guiding me through this) we couldn't arrive to a conclusion as to why
this is this way. Could anyone clarify this a bit more? Could it make
sense to move support of BMA250 to bmc180 driver?

Thank you for your help

[1] drivers/iio/accel/bma180.c
[2] drivers/iio/accel/bmc150-accel.c
[3]
http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/BST-BMA250-DS002-05.pdf
[4]
http://ae-bst.resource.bosch.com/media/products/dokumente/bma250e/BST-BMA250E-DS004-06.pdf
[5]
http://irtfweb.ifa.hawaii.edu/~tcs3/jumpman/jumppc/1107-BMA180/BMA180-DataSheet-v2.5.pdf

-- 
Violeta Menéndez González    http://www.codethink.co.uk/
Software Engineer            Codethink - Providing Genius

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BMA250 support
  2015-09-10 15:02 BMA250 support Violeta Menendez Gonzalez
@ 2015-09-11  8:57 ` Laurentiu Palcu
  2015-09-15 10:16   ` Violeta Menendez Gonzalez
  0 siblings, 1 reply; 4+ messages in thread
From: Laurentiu Palcu @ 2015-09-11  8:57 UTC (permalink / raw)
  To: Violeta Menendez Gonzalez
  Cc: linux-iio, Peter Meerwald, Jonathan Cameron, Ben Dooks, linux-kernel

Hi Violeta,

On Thu, Sep 10, 2015 at 04:02:05PM +0100, Violeta Menendez Gonzalez wrote:
> Hi,
> 
> I've been taking a look at the accelerometer drivers meaning to add some
> features for the chip BMA250.
Just a heads-up, BMA250 is not recommended for new designs:
https://www.bosch-sensortec.com/en/homepage/products_3/3_axis_sensors/acceleration_sensors/acceleration_sensors_1

> 
> I've seen that this chip is supported by the bma180 driver [1], and that
> there's another driver for bmc150 [2] that supports BMA250E. Looking at
> the datasheets [3][4][5] I can't really understand why it is that way,
> as BMA250 and BMA250E register map looks exactly the same except for the
> FIFO memory, and BMA250 doesn't look similar to BMA180 to me.
> 
> After some research on the internet and talking to Ben Dooks (who is
> guiding me through this) we couldn't arrive to a conclusion as to why
> this is this way. Could anyone clarify this a bit more? Could it make
> sense to move support of BMA250 to bmc180 driver?
BMA250 and BMA250E are slightly different, register wise. However, the E
version is completely register compatible with BMC150, except the
resolution. So, adding support to it to existing bmc150_accel driver was
the logical thing to do.

I'm not sure it's worth the trouble to change bmc150_accel driver to
support BMA250 too. I would recommend to add the features you need to
the existing bmc180 driver which already supports it.

But, Peter/Jonathan will most likely show you the right path to follow!
:)

laurentiu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: BMA250 support
  2015-09-11  8:57 ` Laurentiu Palcu
@ 2015-09-15 10:16   ` Violeta Menendez Gonzalez
  2015-09-15 16:11     ` [Linux-kernel] " Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Violeta Menendez Gonzalez @ 2015-09-15 10:16 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: linux-iio, Peter Meerwald, Jonathan Cameron, Ben Dooks, linux-kernel

Hi Laurentiu,

Thank you for replying.

On 11/09/15 09:57, Laurentiu Palcu wrote:
> Hi Violeta,
> 
> On Thu, Sep 10, 2015 at 04:02:05PM +0100, Violeta Menendez Gonzalez wrote:
>> Hi,
>>
>> I've been taking a look at the accelerometer drivers meaning to add some
>> features for the chip BMA250.
> Just a heads-up, BMA250 is not recommended for new designs:
> https://www.bosch-sensortec.com/en/homepage/products_3/3_axis_sensors/acceleration_sensors/acceleration_sensors_1
> 

Yes, I'm aware, thank you. Not trying to do new designs, just porting
some features from an out-of-tree driver.

>>
>> I've seen that this chip is supported by the bma180 driver [1], and that
>> there's another driver for bmc150 [2] that supports BMA250E. Looking at
>> the datasheets [3][4][5] I can't really understand why it is that way,
>> as BMA250 and BMA250E register map looks exactly the same except for the
>> FIFO memory, and BMA250 doesn't look similar to BMA180 to me.
>>
>> After some research on the internet and talking to Ben Dooks (who is
>> guiding me through this) we couldn't arrive to a conclusion as to why
>> this is this way. Could anyone clarify this a bit more? Could it make
>> sense to move support of BMA250 to bmc180 driver?
> BMA250 and BMA250E are slightly different, register wise. However, the E
> version is completely register compatible with BMC150, except the
> resolution. So, adding support to it to existing bmc150_accel driver was
> the logical thing to do.
> 

Yes, I agree with that. All the chips in the bmc150_accel driver are
very similar. But my idea was that the BMA250 is also very similar
(register compatible) to them (except FIFO), so I wonder why the support
for the BMA250 was added to bmc180 instead of adding it directly to the
bmc150_accel driver.

> I'm not sure it's worth the trouble to change bmc150_accel driver to
> support BMA250 too. I would recommend to add the features you need to
> the existing bmc180 driver which already supports it.
> 

I thought it would be easier for me to add features to a driver where
the chips are more homogeneous. BMA250 and BMC180 don't look very
register compatible to me, so I thought it may be worth just making the
effort of changing the support first and then trying to add the features.

I'm pretty inexperienced on this, that's why I'm asking for opinion on
it, I may be missing something.

Talking to Ben Dooks he agreed with me, and suggested that it may be
worth adding support for the BMA250 to bmc150_accel for now and then
later on removing it from bma180. I may have misinterpreted something,
but unfortunately he's on holidays now. He may be able to give some
insight on this next week.

> But, Peter/Jonathan will most likely show you the right path to follow!
> :)
> 
> laurentiu
> 

Thank you :-)

-- 
Violeta Menéndez González    http://www.codethink.co.uk/
Software Engineer            Codethink - Providing Genius

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-kernel] BMA250 support
  2015-09-15 10:16   ` Violeta Menendez Gonzalez
@ 2015-09-15 16:11     ` Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2015-09-15 16:11 UTC (permalink / raw)
  To: Violeta Menendez Gonzalez
  Cc: Laurentiu Palcu, linux-iio, linux-kernel, Jonathan Cameron,
	Peter Meerwald

On Tue, 2015-09-15 at 11:16 +0100, Violeta Menendez Gonzalez wrote:
> Hi Laurentiu,
> 
> Thank you for replying.
> 
> On 11/09/15 09:57, Laurentiu Palcu wrote:
> > Hi Violeta,
> > 
> > On Thu, Sep 10, 2015 at 04:02:05PM +0100, Violeta Menendez Gonzalez wrote:
> >> Hi,
> >>
> >> I've been taking a look at the accelerometer drivers meaning to add some
> >> features for the chip BMA250.
> > Just a heads-up, BMA250 is not recommended for new designs:
> > https://www.bosch-sensortec.com/en/homepage/products_3/3_axis_sensors/acceleration_sensors/acceleration_sensors_1
> > 
> 
> Yes, I'm aware, thank you. Not trying to do new designs, just porting
> some features from an out-of-tree driver.
> 
> >>
> >> I've seen that this chip is supported by the bma180 driver [1], and that
> >> there's another driver for bmc150 [2] that supports BMA250E. Looking at
> >> the datasheets [3][4][5] I can't really understand why it is that way,
> >> as BMA250 and BMA250E register map looks exactly the same except for the
> >> FIFO memory, and BMA250 doesn't look similar to BMA180 to me.
> >>
> >> After some research on the internet and talking to Ben Dooks (who is
> >> guiding me through this) we couldn't arrive to a conclusion as to why
> >> this is this way. Could anyone clarify this a bit more? Could it make
> >> sense to move support of BMA250 to bmc180 driver?
> > BMA250 and BMA250E are slightly different, register wise. However, the E
> > version is completely register compatible with BMC150, except the
> > resolution. So, adding support to it to existing bmc150_accel driver was
> > the logical thing to do.
> > 
> 
> Yes, I agree with that. All the chips in the bmc150_accel driver are
> very similar. But my idea was that the BMA250 is also very similar
> (register compatible) to them (except FIFO), so I wonder why the support
> for the BMA250 was added to bmc180 instead of adding it directly to the
> bmc150_accel driver.

Both the bmc150_accel driver and the BMA250 support in bma180 were added
in Linux 3.18.  As they seem to have been independently developed around
the same time, neither developer could see that support for the other
version of the chip was going into a different driver.

[...]
> Talking to Ben Dooks he agreed with me, and suggested that it may be
> worth adding support for the BMA250 to bmc150_accel for now and then
> later on removing it from bma180. I may have misinterpreted something,
> but unfortunately he's on holidays now. He may be able to give some
> insight on this next week.

I think you should remove support from bma180 immediately afterward, or
at least make it conditional on !IS_ENABLED(CONFIG_BMC150_ACCEL) so that
the selection of driver for these devices isn't randomised.

Ben.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-15 16:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 15:02 BMA250 support Violeta Menendez Gonzalez
2015-09-11  8:57 ` Laurentiu Palcu
2015-09-15 10:16   ` Violeta Menendez Gonzalez
2015-09-15 16:11     ` [Linux-kernel] " Ben Hutchings

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.