On Thu, Jan 26, 2012 at 05:43:57PM +0900, Shimoda, Yoshihiro wrote: > This SPI controller's access size is 32, or 8-bit. The previous driver > supported 32-bit only. So, this patch adds IORESOURCE_MEM_TYPE_MASK > decoding, an then, the driver can handle the SPI controller of 8-bit. > This patch also changes the readl/writel to ioread*/iowrite*. > > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com> > --- > drivers/spi/spi-sh.c | 25 +++++++++++++++++++++++-- > 1 files changed, 23 insertions(+), 2 deletions(-) > .. > static void spi_sh_set_bit(struct spi_sh_data *ss, unsigned long val, > @@ -464,6 +473,18 @@ static int __devinit spi_sh_probe(struct platform_device > *pdev) > ss = spi_master_get_devdata(master); > dev_set_drvdata(&pdev->dev, ss); > > + switch (res->flags & IORESOURCE_MEM_TYPE_MASK) { > + case IORESOURCE_MEM_8BIT: > + ss->width = 8; > + break; > + case IORESOURCE_MEM_32BIT: > + ss->width = 32; > + break; > + default: > + dev_err(&pdev->dev, "No support width\n"); > + ret = -ENODEV; > + goto error1;
If the default up to this point has been 32-bit only then it makes sense for 32 to still remain the default. The 8-bit user is presumably a new one and therefore has no existing platform data configuration to worry about, while this change would require existing users to be updated for the new 32-bit flag to behave the same way they have up until now. If you wish to do this incrementally then you can of course convert all of the existing platforms to the new mechanism for 32-bit as well and then simply error out as above for the undefined width case, but I still think it makes more sense to have a usable default. ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ spi-devel-general mailing list spi-devel-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/spi-devel-general