mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: AceLan Kao <acelan.kao@canonical.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Aaron Sierra <asierra@xes-inc.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap-i2c: add 16 bits register width support
Date: Thu, 23 Apr 2020 15:45:29 +0100	[thread overview]
Message-ID: <20200423144529.GM4808@sirena.org.uk> (raw)
In-Reply-To: <20200423085857.93684-1-acelan.kao@canonical.com>

[-- Attachment #1: Type: text/plain, Size: 1474 bytes --]

On Thu, Apr 23, 2020 at 04:58:57PM +0800, AceLan Kao wrote:
> This allows to access data with 16 bits register width
> via i2c smbus block functions.

> The implementation is inspired by below commit
> https://patchwork.ozlabs.org/patch/545292/

Do you actually have a system that needs this or is it just being
implemented for completeness?  The patch you link to mentions that there
are correctness issues with this implementation.

Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.

> @@ -255,6 +312,10 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
>  		 i2c_check_functionality(i2c->adapter,
>  					 I2C_FUNC_SMBUS_I2C_BLOCK))
>  		return &regmap_i2c_smbus_i2c_block;
> +	else if (config->val_bits == 8 && config->reg_bits == 16 &&
> +		i2c_check_functionality(i2c->adapter,
> +					I2C_FUNC_SMBUS_I2C_BLOCK))
> +		return &regmap_i2c_smbus_i2c_block_reg16;

OTOH we'll only use it if the device wouldn't otherwise work so I'm not
sure that it's any worse than just hoping the bus is uncontested,
hopefully system designers have taken this into account when building
systems without real I2C controllers.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-04-23 14:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23  8:58 AceLan Kao
2020-04-23 14:45 ` Mark Brown [this message]
2020-04-24 12:24   ` AceLan Kao
2020-04-24 12:39     ` Mark Brown

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=20200423144529.GM4808@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=acelan.kao@canonical.com \
    --cc=asierra@xes-inc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®