From: Jonathan Cameron <jic23@kernel.org>
To: Pratik Prajapati <pratik.prajapati12@gmail.com>,
linux-iio@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: How to set Current register in IIO driver from sysfs
Date: Sun, 10 Jul 2016 15:39:15 +0100 [thread overview]
Message-ID: <0da0328b-c0a2-215e-64be-5c27aa58572f@kernel.org> (raw)
In-Reply-To: <CAHNg1Sqe4FRKSzxPsXni6xYCBLQovAYvGoeNQpzi531J6V+K0A@mail.gmail.com>
On 10/07/16 14:11, Pratik Prajapati wrote:
> Including more members.
>
> On Sat, Jul 9, 2016 at 5:22 PM, Pratik Prajapati
> <pratik.prajapati12@gmail.com> wrote:
>> Hi,
hi Pratik,
>>
>> I am trying to add support of adjusting IR led current in vcnl4000
>> driver (has IR led current register for doing the same).
This is always a bit of a 'rough' corner when it comes to what interface
to do it with. Strictly speaking this is typically just a regulator that
happens to be used for this special purpose. Sometimes they are tightly
tied together with the input and sometime (on devices with more than one)
there is no explicit linkage at all.
In this particular case we seem to actually have a high frequency modulated
LED driver so it's pretty tightly tied to this use.
>>
>> Below is what I have done till now:
>>
>> 1) Added Current channel in the vcnl4000_channels structure with
>> separate mask IIO_CHAN_INFO_RAW
>> 2) Reading the LED current register inside IIO_CURRENT case in vcnl4010_read_raw
>> 3) Writing to LED current register inside IIO_CURRENT case in vcnl4010_write_raw
>>
>> Is this the correct way of setting Current register in IIO subsystem?
That's about the best option we currently have. This is exactly how it's done
in the max44000 driver for example.
It's not an interface anyone is terribly happy with so you are welcome to
suggestion alternatives (easy to add them as an additional interface to
existing cases - which is why we haven't been that worried about ending up
with the current less than ideal interface)
The tight coupling in this particular case might justify something more
explicitly linked to the proximity channel but as noted above it's not
always that obvious (see the health/afe parts for example which are way
too flexible in my view!)
Jonathan
>>
>> Best Regards,
>> Pratik Prajapati
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" 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:[~2016-07-10 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHNg1SoX_VFcKLYTmir9=Mh-UtLjGqJ_Q3xbfyxKv+HAAQGFCg@mail.gmail.com>
2016-07-10 13:11 ` Pratik Prajapati
2016-07-10 14:39 ` Jonathan Cameron [this message]
2016-07-11 9:10 ` Pratik Prajapati
2016-07-20 21:41 ` Jonathan Cameron
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=0da0328b-c0a2-215e-64be-5c27aa58572f@kernel.org \
--to=jic23@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pratik.prajapati12@gmail.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
all inboxes | Powered by JetHome®