From: Jonathan Cameron <jic23@cam.ac.uk>
To: Eric Andersson <eric.andersson@unixphere.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, zhengguang.guo@bosch-sensortec.com,
stefan.nilsson@unixphere.com,
Albert Zhang <xu.zhang@bosch-sensortec.com>
Subject: Re: [PATCH v3 1/1] input: add driver for Bosch Sensortec's BMA150 accelerometer
Date: Fri, 15 Jul 2011 09:41:34 +0100 [thread overview]
Message-ID: <4E1FFD3E.7090103@cam.ac.uk> (raw)
In-Reply-To: <20110715082316.5A4792C03C24@bmail01.one.com>
On 07/15/11 09:23, Eric Andersson wrote:
>>> + values represent the range given as +/- G.
>>> + Possible values are: 2, 4, 8.
>>> +
>>> + Reading: returns the current acceleration range.
>>> +
>>> + Writing: sets a new acceleration range.
>>
>> Same comment as last time - these values are not discoverable so it
>> should set the nearest bigger range.
>
> And same answer as last time - The values can be retreived by doing a:
> cat range. This whole idea comes from a review comment that Jonathan Cameron
> gave on your bma023 driver [1].
Needs documenting. Right now there is no mention of that here.
> If we could agree on how these values should be represented I will be glad
> to fix it! Dmitry, any preferences?
>
> [1] http://www.spinics.net/lists/linux-input/msg14271.html
>
>>> + for (i = 0, ret = 0; i < ARRAY_SIZE(bw_val); i++)
>>> + ret += sprintf(buf + ret,
>>> + (bw_val[i].reg == bw) ? "[%d] " : "%d ",
>>> + bw_val[i].value);
>>
>> sysfs nodes should really be single values
>
> Once again it's a previous comment from Jonathan [1]. Please specify how
> you want this and I'll fix it.
Yes in general to the single value, but this is a pretty common syntax for
choosing one of a set. Got to indicate it somehow and it's either this or
a list of available ones in a separate attribute. There was an LWN article
on this a while back that lays out the options very clearly http://lwn.net/Articles/378884/
>
>>> +static const struct i2c_device_id bma150_id[] = {
>>> + { "bma150", 0 },
>>> + { "smb380", 0 },
>>
>> bma023 ?
>
> As mentioned earlier bma023 is not an official product name from Bosch Sensortec. Hence,
> there will be no datasheet available or references from Bosch Sensortec. IMHO it would be
> confusing to add it.
Just ignore the marketing and add it anyway :)
>
>> It also doesn't expose the thresholds or support interrupts which the
>> one I posted did.
>
> We were told by Bosch S that the interrupt is triggered every 333 us (data ready) which would
> pretty much flood the irq handler.
Somewhat quick, but maybe still worth having... Just use a one shot threaded interrupt and it
will at least run safely even if it isn't keeping up with all of them. Alan, do you have a device
that has frequency control on chip? (very unusual not to see this on an accelerometer).
> However, if this is stopping the patch we can add it. Would it be acceptable to have a driver
> that supports both a polling and irq driven setup, e.g. by checking if the .irq is non zero?
Yes: common situation. See the recent kionix driver for an example.
You definitely want the theshold stuff from Alan's driver though.
>
>> So while its better it still seems incomplete - its certainly nowhere
>> near where it can replace the one I posted months ago and doesn't seem
>> to
>> be making any headway.
>>
>> Dmitry shall I repost the intel one - at this point I think it would
>> be a
>> better starting point as it supports more features, interrupts and the
>> like although it's not perfect either.
>
> My hope is that we can sort out the differences before I post v4. Dmitry, if you have time
> could you please give an objective review of the patch?
>
> Best regards,
> Eric
>
> http://www.unixphere.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2011-07-15 8:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 21:56 [PATCH v3 0/1] " Eric Andersson
2011-07-14 21:56 ` [PATCH v3 1/1] " Eric Andersson
2011-07-14 22:40 ` Alan Cox
2011-07-15 8:23 ` Eric Andersson
2011-07-15 8:41 ` Jonathan Cameron [this message]
2011-07-15 11:00 ` Eric Andersson
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=4E1FFD3E.7090103@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dmitry.torokhov@gmail.com \
--cc=eric.andersson@unixphere.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stefan.nilsson@unixphere.com \
--cc=xu.zhang@bosch-sensortec.com \
--cc=zhengguang.guo@bosch-sensortec.com \
/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
Powered by JetHome