On Wed, Sep 07, 2011 at 05:19:43PM +0100, Jonathan Cameron wrote: > These devices look like 8 bit registers for writes and 16 bit registers for > reads. As you might imagine this causes some 'issues' hence this regmap > bus implementation claims they are always 16bit and does the mangling to > make the writes work. > --- You've not signed this off. To be honest I'm not terribly happy about pushing this into the regmap core code; if we start needing to do stuff like this we should expose the bus interface. > + > +static int regmap_spi_write(struct device *dev, const void *data, size_t count) > +{ > +/* Now this only works for 8 bit addresss 16 bit register first byte of data > + * is the lower address, second two the value */ > + struct spi_device *spi = to_spi_device(dev); > + int ret; Indentation. > +static struct regmap_bus regmap_spi_adi = { > + .write = regmap_spi_write, > + .read = regmap_spi_read, > +}; You want to implement the gather write too if you can. -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html