From: andi@etezian.org (Andi Shyti)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] spi: do not fail if the CS line is not connected
Date: Fri, 17 Jun 2016 20:36:22 +0900 [thread overview]
Message-ID: <20160617113622.GA10760@jack.zhora.eu> (raw)
In-Reply-To: <20160617104725.GC26099@sirena.org.uk>
Hi Mark,
> > Some SPI connected devices do not have any CS line connected as
> > some devices are alway enabled. Indeed, until now, a common
> > workaround was to assign to num_chipselect a -1 value or 255
> > (num_chipselect is unsigned).
> >
> > In this case do not fail and defer to the SPI device drivers the
> > responsibility to check whether the num-cs is '0'.
>
> A SPI controller always has one chip seelct, it may not be controllable
> but it's at least logically present.
This is true, but there are cases where the CS is not connected
and this case needs to be treated separately to allow the device
to work.
This is the case of:
./drivers/spi/spi-mpc52xx-psc.c:391: master->num_chipselect = 255;
./drivers/spi/spi-oc-tiny.c:256: master->num_chipselect = 255;
and
./drivers/spi/spi-pxa2xx-pci.c:64: .num_chipselect = -1,
./drivers/spi/spi-bcm2835aux.c:436: master->num_chipselect = -1;
that in my opinion make even less sense. The latter is completely
broken, as num_chipselect is an u16 variable. Because of this I
had to do the same in a driver that I will send next (and perhaps
it will be rejected).
So, IMHO, it's better to not be that strong on num_chipselect
being non zero, as there are cases where the CS _line_ is not
connected.
Andi
next prev parent reply other threads:[~2016-06-17 11:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 7:57 [PATCH 0/5] SPI CS line logical change and s3c64xx code rework Andi Shyti
2016-06-17 7:57 ` [PATCH 1/5] spi: do not fail if the CS line is not connected Andi Shyti
2016-06-17 10:47 ` Mark Brown
2016-06-17 11:36 ` Andi Shyti [this message]
2016-06-17 12:28 ` Mark Brown
2016-06-19 6:09 ` Andi Shyti
2016-06-26 12:48 ` Mark Brown
2016-06-27 10:57 ` Andi Shyti
2016-06-27 13:06 ` Mark Brown
2016-06-27 14:08 ` Andi Shyti
2016-06-17 7:57 ` [PATCH 2/5] spi: s3c64xx: group the CS signalling writes in a single function Andi Shyti
2016-06-30 12:15 ` Applied "spi: s3c64xx: group the CS signalling writes in a single function" to the spi tree Mark Brown
2016-06-17 7:57 ` [PATCH 3/5] spi: s3c64xx: consider the case where the CS line is not connected Andi Shyti
2016-06-17 7:57 ` [PATCH 4/5] spi: s3c64xx: do not configure the device twice Andi Shyti
2016-06-30 12:15 ` Applied "spi: s3c64xx: do not configure the device twice" to the spi tree Mark Brown
2016-06-17 7:57 ` [PATCH 5/5] spi: s3c63xx: simplify if statement in prepare_transfer function Andi Shyti
2016-06-30 12:15 ` Applied "spi: s3c64xx: simplify if statement in prepare_transfer function" to the spi tree Mark Brown
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=20160617113622.GA10760@jack.zhora.eu \
--to=andi@etezian.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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