From: Guenter Roeck <linux@roeck-us.net>
To: Octavian Purdila <octavian.purdila@intel.com>
Cc: Mark Roszko <mark.roszko@gmail.com>,
linux-i2c <linux-i2c@vger.kernel.org>,
linux-api@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
Johan Hovold <johan@kernel.org>, Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [RFC PATCH 3/3] i2c: show and change bus frequency via sysfs
Date: Sun, 12 Oct 2014 10:06:37 -0700 [thread overview]
Message-ID: <20141012170637.GA12591@roeck-us.net> (raw)
In-Reply-To: <CAE1zotL4Pb5etHzakCxeDLvZR112XGGaHomZ_dbh=AQVc0wvPg@mail.gmail.com>
On Sun, Oct 12, 2014 at 12:32:56PM +0300, Octavian Purdila wrote:
> On Sat, Oct 11, 2014 at 11:14 PM, Mark Roszko <mark.roszko@gmail.com> wrote:
>
> > This seems limiting to arches with peripherals that can support a range of
> > frequencies rather than fixed numbers.
> > Also it creates some portability quirkiness between platforms when all the
> > i2c bus drivers have different supported freq lists and you have to match
> > exactly the right frequency. I.e. one guy does 60khz but another only has
> > 80khz.
>
> Sorry, I don't understand your points here. If this limitations exists
> they are not introduced by this patch. This patch just exposes the
> frequency so that it can be read or changed in userspace.
>
> > Another issue is in systems where you have i2c devices on the same bus as
> > the sysfs user space driver. User space could set a bus frequency that
> > prevents operation with a system i2c device.
>
> Changing the frequency is limited to root. Also, bus drivers do not
> have to implement set_freq if it is thought not to be safe.
>
> On a different not, I have noticed that a fixed set of frequencies
> might not be the best API, since multiple drivers rather support a
> rather large set of frequencies in a range. A better API might be to
> expose a min-max range and let the bus driver adjust the requested
> frequency. I will follow up with a second version that does that.
As two separate sysfs attributes, maybe ? sysfs is supposed to provide
one value per attribute.
For the patch itself, I would find it better if you used is_visible to
determine if the new attributes should be visible (and/or writable) instead
of returning -EOPNOTSUPP.
Guenter
next prev parent reply other threads:[~2014-10-12 17:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-09 20:07 [RFC PATCH 0/3] i2c: show and change bus frequency via sysfs Octavian Purdila
[not found] ` <1412885235-14026-1-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-09 20:07 ` [RFC PATCH 1/3] i2c: document the existing i2c sysfs ABI Octavian Purdila
2014-10-09 20:07 ` [RFC PATCH 2/3] i2c: document struct i2c_adapter Octavian Purdila
2014-10-09 20:07 ` [RFC PATCH 3/3] i2c: show and change bus frequency via sysfs Octavian Purdila
[not found] ` <CAJjB1qKQ0ND2CeF=Npahn0r19WjdTwc7D3Th7PLnn0FJxHa_KQ@mail.gmail.com>
[not found] ` <CAJjB1qKQ0ND2CeF=Npahn0r19WjdTwc7D3Th7PLnn0FJxHa_KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-12 9:32 ` Octavian Purdila
2014-10-12 17:06 ` Guenter Roeck [this message]
[not found] ` <20141012170637.GA12591-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-10-13 10:32 ` Octavian Purdila
2014-10-14 1:53 ` Mark Roszko
[not found] ` <CAJjB1qJsmFebE2u_wMe2gdrQYcEwY1-yDLpufK97EXjEoR6omQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-14 9:24 ` Octavian Purdila
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=20141012170637.GA12591@roeck-us.net \
--to=linux@roeck-us.net \
--cc=johan@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.roszko@gmail.com \
--cc=octavian.purdila@intel.com \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).