linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* adding hmc5883 driver
@ 2012-04-17 20:51 Marek Belisko
  2012-04-18  8:45 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Belisko @ 2012-04-17 20:51 UTC (permalink / raw)
  To: linux-iio

Hi,

I'm owner gta04 board which have hmc5883 compass.
I'm currently using hmc5843 iio staging driver with some hacks
(difference is only
for range and rate values) which is working fine. I would like ask for
opinion how to properly
add new device.

IMO options are:
1. add hmc5883 to DEVICE_TABLE with some flags and then use proper values for
one or another device (possibly rename driver to hmc58x3)

2. separate common functions from existing driver and use custom setup
for hmc5843
and hmc5883.

Is there another way which I overlooked?

Thanks,

marek

-- 
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com

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

* Re: adding hmc5883 driver
  2012-04-17 20:51 adding hmc5883 driver Marek Belisko
@ 2012-04-18  8:45 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-04-18  8:45 UTC (permalink / raw)
  To: Marek Belisko; +Cc: linux-iio

On 4/17/2012 9:51 PM, Marek Belisko wrote:
> Hi,
>
> I'm owner gta04 board which have hmc5883 compass.
> I'm currently using hmc5843 iio staging driver with some hacks
> (difference is only
> for range and rate values) which is working fine. I would like ask for
> opinion how to properly
> add new device.
>
> IMO options are:
> 1. add hmc5883 to DEVICE_TABLE with some flags and then use proper values for
> one or another device (possibly rename driver to hmc58x3)
Don't rename the driver.  Convention is the driver is named after the 
first device it supports.
Nothing stops it supporting lots more.  See the adc/max1363 for a big 
example.
Wild card naming goes horribly wrong from time to time as marketting 
departments like
to name their products in illogical ways.

Otherwise, this is probably the best option given they sound pretty similar.
>
> 2. separate common functions from existing driver and use custom setup
> for hmc5843
> and hmc5883.
One driver sounds more sensible in this case.
>
> Is there another way which I overlooked?
>
> Thanks,
>
> marek
>


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

end of thread, other threads:[~2012-04-18  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 20:51 adding hmc5883 driver Marek Belisko
2012-04-18  8:45 ` Jonathan Cameron

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