From: Fabio Estevam <festevam@gmail.com>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
NXP Linux Team <linux-imx@nxp.com>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: (EXT) Re: [PATCH 2/2] ARM: dts: imx6qdl: tqma6: minor fixes
Date: Tue, 25 Aug 2020 11:24:02 -0300 [thread overview]
Message-ID: <CAOMZO5DYrkEb_G+EYAGrc+qjSsbjRdeBUU3tJUfkU6tjgNm_7g@mail.gmail.com> (raw)
In-Reply-To: <4b7d57738ce8e2130c4740a0f3f973fbaf60a7cf.camel@ew.tq-group.com>
Hi Matthias,
On Tue, Aug 25, 2020 at 4:22 AM Matthias Schiffer
<matthias.schiffer@ew.tq-group.com> wrote:
> Hmm, unless I'm overlooking something, this is not going to work:
>
> - spi_get_gpio_descs() sets num_chipselect to the maximum of the
> num_chipselect set in the driver and the number of cs-gpios
>
> - spi_imx_probe() sets num_chipselect to 3 if not specified in the
> device tree
>
> So I think we would end up with 3 instead of 1 chipselect.
Oh, this has changed recently in 8cdcd8aeee281 ("spi: imx/fsl-lpspi:
Convert to GPIO descriptors"):
....
- } else {
- u32 num_cs;
-
- if (!of_property_read_u32(np, "num-cs", &num_cs))
- master->num_chipselect = num_cs;
- /* If not preset, default value of 1 is used */
Initially, if num-cs was not present the default value for num_chipselect was 1.
- }
+ /*
+ * Get number of chip selects from device properties. This can be
+ * coming from device tree or boardfiles, if it is not defined,
+ * a default value of 3 chip selects will be used, as all the legacy
+ * board files have <= 3 chip selects.
+ */
+ if (!device_property_read_u32(&pdev->dev, "num-cs", &val))
+ master->num_chipselect = val;
+ else
+ master->num_chipselect = 3;
Now it became 3.
I think this is a driver issue and we should fix the driver instead of
requiring to pass num-cs to the device tree.
num-cs is not even documented in the spi-imx binding.
next prev parent reply other threads:[~2020-08-25 14:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 9:10 [PATCH 1/2] ARM: dts: imx6qdl: tqma6: fix indentation Matthias Schiffer
2020-08-24 9:10 ` [PATCH 2/2] ARM: dts: imx6qdl: tqma6: minor fixes Matthias Schiffer
2020-08-24 21:36 ` Fabio Estevam
2020-08-25 7:22 ` (EXT) " Matthias Schiffer
2020-08-25 14:24 ` Fabio Estevam [this message]
2020-08-25 14:40 ` (EXT) " Matthias Schiffer
2020-08-25 17:16 ` Fabio Estevam
2020-08-26 10:32 ` (EXT) " Matthias Schiffer
2020-08-26 10:34 ` Matthias Schiffer
2020-08-26 10:59 ` Fabio Estevam
2020-08-26 11:54 ` (EXT) " Matthias Schiffer
2020-08-26 13:01 ` Fabio Estevam
2020-08-26 13:13 ` (EXT) " Matthias Schiffer
2020-08-26 13:49 ` Fabio Estevam
2020-08-27 7:31 ` Matthias Schiffer
2020-08-27 21:27 ` Fabio Estevam
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=CAOMZO5DYrkEb_G+EYAGrc+qjSsbjRdeBUU3tJUfkU6tjgNm_7g@mail.gmail.com \
--to=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.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;
as well as URLs for NNTP newsgroup(s).