From: Lars-Peter Clausen <lars@metafoo.de>
To: Guenter Roeck <linux@roeck-us.net>, Mark Brown <broonie@kernel.org>
Cc: Robert Rosengren <robert.rosengren@axis.com>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jean Delvare <jdelvare@suse.de>
Subject: Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions
Date: Mon, 02 Feb 2015 11:26:23 +0100 [thread overview]
Message-ID: <54CF50CF.7040601@metafoo.de> (raw)
In-Reply-To: <1422834481-6936-1-git-send-email-linux@roeck-us.net>
On 02/02/2015 12:48 AM, Guenter Roeck wrote:
[...]
> static int regmap_i2c_write(void *context, const void *data, size_t count)
> {
> struct device *dev = context;
> @@ -180,7 +216,10 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
> else if (config->val_bits == 16 && config->reg_bits == 8 &&
> i2c_check_functionality(i2c->adapter,
> I2C_FUNC_SMBUS_WORD_DATA))
> - return ®map_smbus_word;
> + if (config->val_format_endian == REGMAP_ENDIAN_LITTLE)
This should probably use regmap_get_val_endian() and maybe also handle
REGMAP_ENDIAN_NATIVE.
> + return ®map_smbus_word;
> + else
> + return ®map_smbus_word_swapped;
> else if (config->val_bits == 8 && config->reg_bits == 8 &&
> i2c_check_functionality(i2c->adapter,
> I2C_FUNC_SMBUS_BYTE_DATA))
>
next prev parent reply other threads:[~2015-02-02 10:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 23:48 [PATCH] regmap: Fix i2c word access when using SMBus access functions Guenter Roeck
2015-02-02 10:09 ` Jean Delvare
2015-02-02 10:26 ` Lars-Peter Clausen [this message]
2015-02-02 11:56 ` Mark Brown
2015-02-02 14:30 ` Guenter Roeck
2015-02-03 11:42 ` Mark Brown
2015-02-03 14:21 ` Guenter Roeck
2015-02-03 16:09 ` Mark Brown
2015-02-03 16:58 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54CF50CF.7040601@metafoo.de \
--to=lars@metafoo.de \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robert.rosengren@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.