[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140416170638.GT12304@sirena.org.uk>
Date: Wed, 16 Apr 2014 18:06:39 +0100
From: Mark Brown <broonie@...nel.org>
To: Boris BREZILLON <boris.brezillon@...e-electrons.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Shuge <shuge@...winnertech.com>, kevin@...winnertech.com,
Chen-Yu Tsai <wens@...e.org>,
Hans de Goede <hdegoede@...hat.com>,
Carlo Caione <carlo@...one.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
dev@...ux-sunxi.org
Subject: Re: [PATCH] regmap: i2c: fallback to SMBus if the adapter does not
support standard I2C
On Wed, Apr 16, 2014 at 10:16:10AM +0200, Boris BREZILLON wrote:
> + if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {
> + return ®map_i2c;
> + } else if (config->val_bits == 16 &&
> + i2c_check_functionality(i2c->adapter,
> + I2C_FUNC_SMBUS_WORD_DATA)) {
> + config->reg_read = regmap_smbus_word_reg_read;
> + config->reg_write = regmap_smbus_word_reg_write;
> + return NULL;
This all looks good to me except we shouldn't be modifying the config
struct (it's supposed to be const). We should instead add the ability
for the bus to set these ops - that'll also be useful for things like
AC'97.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists