[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120523173617.GC4064@opensource.wolfsonmicro.com>
Date: Wed, 23 May 2012 18:36:18 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Fabio Estevam <festevam@...il.com>
Cc: marc@...esign.com.au, Samuel Ortiz <sameo@...ux.intel.com>,
Sascha Hauer <kernel@...gutronix.de>,
Philippe Rétornaz <philippe.retornaz@...l.ch>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: mc13xxx-core: kernel hangs after 'regmap_read'
On Wed, May 23, 2012 at 11:18:10AM -0300, Fabio Estevam wrote:
> #define MC13XXX_REGOFFSET_SHIFT 25
> int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val)
> {
> struct spi_transfer t;
> struct spi_message m;
> int ret;
>
> BUG_ON(!mutex_is_locked(&mc13xxx->lock));
>
> if (offset > MC13XXX_NUMREGS)
> return -EINVAL;
>
> *val = offset << MC13XXX_REGOFFSET_SHIFT;
> ,would the spi regmap access take into account this
> MC13XXX_REGOFFSET_SHIFT operation?
The data sent should be however many bits of register address are
specified, followed by however many padding bits are specified, followed
by the data. The shift there will be some combination of the padding
and register address.
Though if the device is looking for everything byte swapped for some
insane reason...
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists