From: Grant Likely <grant.likely@secretlab.ca>
To: Federico Vaga <federico.vaga@gmail.com>
Cc: spi-devel-general@lists.sourceforge.net,
linux-kernel@vger.kernel.org,
Federico Vaga <federico.vaga@gmail.com>
Subject: Re: [PATCH RFC] spidev.c: add sysfs attributes for SPI configuration
Date: Wed, 19 Dec 2012 15:09:25 +0000 [thread overview]
Message-ID: <20121219150925.8262E3E0AD7@localhost> (raw)
In-Reply-To: <1353777608-24934-1-git-send-email-federico.vaga@gmail.com>
On Sat, 24 Nov 2012 18:20:08 +0100, Federico Vaga <federico.vaga@gmail.com> wrote:
> This patch introduce the use of the sysfs attribute for the spidev
> configuration. This avoid the user to have a specific program which does
> ioctl() on spidev. The user can easily does cat (to read) and echo (to
> write) on the sysfs file and configure SPI.
>
> The patch exports the following attributes: bits-per-word, lsb-first,
> mode and speed-hz.
>
> Example:
> # cat /sys/bus/spi/devices/spi1.0/speed-hz
> 500000
> # echo 450000 > /sys/bus/spi/devices/spi1.0/speed-hz
> # dmesg | tail -n 4
> spidev spi1.0: DEactivate 60, mr 000f0011
> spidev spi1.0: setup: 449447 Hz bpw 8 mode 0x0 -> csr0 0000dd02
> spidev spi1.0: setup mode 0, 8 bits/w, 450000 Hz max --> 0
> spidev spi1.0: 450000 Hz (max)
>
> Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Not a good idea. sysfs is not a good place for operational interfaces.
Please use the spi character devices for direct manipulation of the SPI
configuration.
g.
next prev parent reply other threads:[~2012-12-19 15:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-24 17:20 [PATCH RFC] spidev.c: add sysfs attributes for SPI configuration Federico Vaga
2012-12-19 15:09 ` Grant Likely [this message]
2012-12-20 15:30 ` Federico Vaga
2012-12-22 9:47 ` Grant Likely
2012-12-22 11:21 ` Federico Vaga
2012-12-22 18:29 ` Greg KH
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=20121219150925.8262E3E0AD7@localhost \
--to=grant.likely@secretlab.ca \
--cc=federico.vaga@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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).