On Mon, May 19, 2008 at 10:30 AM, Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote:Hurrmmmm... I'm not so fond of this approach. cs-parent doesn't seem to make much sense to me. It might be better to have a cs-handler property on the SPI bus node instead of on the SPI slave nodes, but even then it leaves a number of questions about what it really means. In some cases it would be overkill. For example, if the SPI node simply had multiple GPIO lines then an extra cs-parent node wouldn't be needed at all. Then there are the complex arrangements. When setting CS requires inserting a special 'set cs' SPI message at the right time. Or worse; when setting CS requires /modifying/ the sent SPI message. Essentially, the binding would need to describe the ability to completely intercept and rewrite all SPI messages going through the CS scheme. I'm not saying it's not possible to do, but I am saying that I'd like to have a better feel for all the use cases before it is defined. I'm not convinced that adding a cs-parent phandle will do that appropriately. That being said, my gut feel is that the solution will be to support spi-bridge nodes that handle the complex CS configuration settings; the spi-bridge would be a child of the spi-master and the parent of the spi devices; and simple CS settings being handled with regular old GPIO bindings. (Much like the last suggestion you make; except that I think that it *does* looks elegant.) :-) example; here's an SPI bus that has 2 GPIOs for two bus CS lines and an SPI bridge that uses both CSes; one address for accessing the bridge's CS register and one CS to access the downstream devices. + SPI example for an MPC5200 SPI bus: + spi@f00 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,mpc5200b-spi","fsl,mpc5200-spi"; + reg = <0xf00 0x20>; + interrupts = <2 13 0 2 14 0>; + interrupt-parent = <&mpc5200_pic>; + gpios = <&gpio1 0 0 &gpio1 1 0>; + spi-bridge@0 { + compatible = "oem,spi-bridge-type"; + reg = < 0 1 >; // note: 2 SPI CS addresses; first one to access bridge registers + + ethernet-switch@0 { + compatible = "micrel,ks8995m"; + linux,modalias = "ks8995"; + max-speed = <1000000>; + reg = <0>; + }; ... // and more SPI child nodes here... + }; + }; But even this doesn't reflect the hardware layout well. What if the SS lines are on SPI GPIO expanders on the same bus? Then does it make sense for them to be layed out as spi bridges? Cheers, g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. --
| Davide Libenzi | [patch 7/8] fdmap v2 - implement sys_socket2 |
| Benjamin Herrenschmidt | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Greg Kroah-Hartman | [PATCH 011/196] sysfs: Fix a copy-n-paste typo in comment |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Rémi Denis-Courmont | [PATCH] USB host CDC Phonet network interface driver |
| David Miller | [GIT]: Networking |
git: | |
