linux-mips
[Top] [All Lists]

Re: [PATCH] SPI: MIPS: lantiq: adds spi-xway

To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] SPI: MIPS: lantiq: adds spi-xway
From: John Crispin <blogic@openwrt.org>
Date: Wed, 22 Aug 2012 21:04:56 +0200
Cc: spi-devel-general@lists.sourceforge.net, linux-mips@linux-mips.org, Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
In-reply-to: <20120822185944.GD7995@opensource.wolfsonmicro.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1345103821-12543-1-git-send-email-blogic@openwrt.org> <20120822185944.GD7995@opensource.wolfsonmicro.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16
On 22/08/12 20:59, Mark Brown wrote:
>> +       if (of_machine_is_compatible("lantiq,ase"))
>> > +               master->num_chipselect = 3;
>> > +       else
>> > +               master->num_chipselect = 6;
> This is very suspicious - why is this being done based on the machine
> rather than based on the IP?  Surely there can be machines with this SoC
> on which aren't compatible with whatever (reference?) board this is
> matching on.  I'd expect that the driver would have multiple compatible
> strings which it uses to distinguish the capabilities of the IP.
>
> Though actually the driver never reads this value so perhaps the code
> can just be deleted and we rely on the fact that if the /CS isn't
> physically present nobody's going to hook it up on a board so just
> always set it to 6?
>
Thanks for the review i will rework the driver, add a binding doc and
resend ...

is there a equivalent of of_machine_is_compatible for IP ?

John

<Prev in Thread] Current Thread [Next in Thread>