From: Christophe Leroy <christophe.leroy@c-s.fr> To: Grant Likely <grant.likely@secretlab.ca>, Rob Herring <rob.herring@calxeda.com> Cc: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, stigge@antcom.de Subject: [PATCH] SPI: Set SPI bits per words in an OF DeviceTree SPI node Date: Wed, 7 Aug 2013 17:44:45 +0200 [thread overview] Message-ID: <201308071544.r77Fij2Y006649@localhost.localdomain> (raw) This patch allows to set up the bits per word together with all other SPI parameters in the SPI Node of the OF device tree In the node, you then have to include the 'spi-bits' property. Exemple: fpga-loader@7 { compatible = "cs,fpga-loader"; spi-max-frequency = <10000000>; reg = <7>; spi-cs-high; spi-bits = <16>; }; Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> --- linux-3.8.13/drivers/spi/spi.c 2013-05-11 22:57:46.000000000 +0200 +++ linux/drivers/spi/spi.c 2013-08-06 18:19:30.000000000 +0200 @@ -870,6 +870,11 @@ if (of_find_property(nc, "spi-3wire", NULL)) spi->mode |= SPI_3WIRE; + /* Bits per word */ + prop = of_get_property(nc, "spi-bits", &len); + if (prop && len >= sizeof(*prop)) + spi->bits_per_word = prop[0]; + /* Device speed */ prop = of_get_property(nc, "spi-max-frequency", &len); if (!prop || len < sizeof(*prop)) {
WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy-GgN8y9CXRhA@public.gmane.org> To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>, Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org> Cc: stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH] SPI: Set SPI bits per words in an OF DeviceTree SPI node Date: Wed, 7 Aug 2013 17:44:45 +0200 [thread overview] Message-ID: <201308071544.r77Fij2Y006649@localhost.localdomain> (raw) This patch allows to set up the bits per word together with all other SPI parameters in the SPI Node of the OF device tree In the node, you then have to include the 'spi-bits' property. Exemple: fpga-loader@7 { compatible = "cs,fpga-loader"; spi-max-frequency = <10000000>; reg = <7>; spi-cs-high; spi-bits = <16>; }; Signed-off-by: Christophe Leroy <christophe.leroy-GgN8y9CXRhA@public.gmane.org> --- linux-3.8.13/drivers/spi/spi.c 2013-05-11 22:57:46.000000000 +0200 +++ linux/drivers/spi/spi.c 2013-08-06 18:19:30.000000000 +0200 @@ -870,6 +870,11 @@ if (of_find_property(nc, "spi-3wire", NULL)) spi->mode |= SPI_3WIRE; + /* Bits per word */ + prop = of_get_property(nc, "spi-bits", &len); + if (prop && len >= sizeof(*prop)) + spi->bits_per_word = prop[0]; + /* Device speed */ prop = of_get_property(nc, "spi-max-frequency", &len); if (!prop || len < sizeof(*prop)) { ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
next reply other threads:[~2013-08-07 16:15 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-08-07 15:44 Christophe Leroy [this message] 2013-08-07 15:44 ` [PATCH] SPI: Set SPI bits per words in an OF DeviceTree SPI node Christophe Leroy 2013-08-07 15:54 ` Fwd: " leroy christophe 2013-08-07 16:27 ` Kumar Gala 2013-08-07 16:30 ` Fwd: " Stephen Warren 2013-08-14 13:21 ` leroy christophe 2013-08-14 16:19 ` Stephen Warren 2013-08-14 16:29 ` leroy christophe 2013-08-14 16:31 ` Stephen Warren
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=201308071544.r77Fij2Y006649@localhost.localdomain \ --to=christophe.leroy@c-s.fr \ --cc=devicetree-discuss@lists.ozlabs.org \ --cc=grant.likely@secretlab.ca \ --cc=linux-kernel@vger.kernel.org \ --cc=rob.herring@calxeda.com \ --cc=spi-devel-general@lists.sourceforge.net \ --cc=stigge@antcom.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.