From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Simek Subject: Re: [PATCH v2 2/2] devicetree: Add devicetree bindings documentation for Cadence SPI Date: Fri, 04 Apr 2014 13:16:59 +0200 Message-ID: <533E94AB.6060400@monstr.eu> References: <1396523431-14519-1-git-send-email-harinik@xilinx.com> <1396523431-14519-2-git-send-email-harinik@xilinx.com> <20140403213446.GB14763@sirena.org.uk> Reply-To: monstr@monstr.eu Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Cdw5EfFCIsanNVDpkgvWw1A791LJUAXmi" Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org To: Geert Uytterhoeven Cc: Harini Katakam , Mark Brown , Grant Likely , Rob Herring , Pawel Moll , Mark Rutland , "ijc+devicetree@hellion.org.uk" , Kumar Gala , linux-spi , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" List-Id: devicetree@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Cdw5EfFCIsanNVDpkgvWw1A791LJUAXmi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/04/2014 10:09 AM, Geert Uytterhoeven wrote: > Hi Harini, >=20 > On Fri, Apr 4, 2014 at 5:00 AM, Harini Katakam > wrote: >>>> + num-cs =3D /bits/ 16 <4>; >>> >>> What's going on with the /bits/ - is this something that's required f= or >>> the property? >> >> The master->num-chipselect property is 16 bit but writing <4> here dir= ectly >> leads to 0 being read in of_property_read (because it's big endian). >> Instead using of property read u32 and then copying, we decided to do = this. >> This was discussed on v2 between Michal and Rob: >>>>>> + num-chip-select =3D /bits/ 16 <4>; >>>> >>>> I was expecting you will comment this a little bit. :-) >>>> Because all just reading this num-cs as 32bit and then >>>> assigning this value to master->num_chipselect which is 16bit. >>> >>> Well, everyone else has that problem then. Obviously it takes a bit >>> more care than just reading into a u32, but that is a kernel problem >>> and not a problem of the binding. >> They are not reading it directly with read_u32 but they are using >> intermediate u32 value which is assigned to u16 which is fine. >> This pattern is in most drivers(maybe all). >> The point is if binding should or can't simplify driver code. >> And from your reaction above I expect that it is up to driver >> owner and binding doc how you want to do it. >=20 > IMHO this "/bits/ 16" doesn't simplify the binding. >=20 > As "num-cs" is a generic spi subsystem binding, it should not be > restricted to 16 bits for the sake of a driver. As your hardware can dr= ive 4 > chip selects, you could represent it in 3 bits (don't!). >=20 > Simple integers are 32 bit in DT, so use a temporary. No problem to keep it there to 32bit range. I really appreciate that discussion we have about it. Just a note: If "num-cs" is the part of generic spi subsystem binding maybe it should be moved directly to spi core as is done for example for timeout-sec in watchdog. Also this should be listed in any Documentation/devicetree/bindings/spi/s= pi.txt file that this is generic spi binding. Thanks, Michal --=20 Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/ Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform --Cdw5EfFCIsanNVDpkgvWw1A791LJUAXmi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlM+lKsACgkQykllyylKDCGkcQCfdTs4zmS2/AmvgdR8D1enuOs+ M8cAnR0cnWrNqc07g8kEGyf6Yx2UIIjx =yFCi -----END PGP SIGNATURE----- --Cdw5EfFCIsanNVDpkgvWw1A791LJUAXmi--