From: Hugo Villeneuve <hugo@hugovil.com>
To: Mark Brown <broonie@kernel.org>
Cc: "Jan Kundrát" <jan.kundrat@cesnet.cz>,
"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
linux-serial@vger.kernel.org,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: max310x: work around regmap->regcache data corruption
Date: Mon, 4 Dec 2023 12:01:51 -0500 [thread overview]
Message-ID: <20231204120151.f0afbee2ebc69e93e7977547@hugovil.com> (raw)
In-Reply-To: <06fa462c-5b48-410e-8656-4d0dbdbfa142@sirena.org.uk>
On Mon, 4 Dec 2023 16:35:30 +0000
Mark Brown <broonie@kernel.org> wrote:
> On Mon, Dec 04, 2023 at 11:29:05AM -0500, Hugo Villeneuve wrote:
>
> > Do you have an example of a driver which is using regmap ranges like it
> > should be done in this driver, that is using the exact same address for
> > two or more registers? I found an example, but it doesn't seem
> > applicable to the sc16is7xx driver because the two registers do not
> > share a common address, for example they have addresses like 0x01 and
> > 0x81, even though with the proper page selection, they finally map to
> > address 0x01.
>
> I don't understand what you mean here - you say that the addresses both
> have addresses 0x1 and 0x81 but map to address 0x1. What does the 0x81
> refer to? The comments in the driver seemed to indicate that there was
> a single address which mapped to multiple underlying registers...
Hi,
I was referring to an example in da9063-i2c.c where they have
these two registers:
#define DA9063_REG_STATUS_A 0x01
#define DA9063_REG_SEQ 0x81
To access one or the other, you must select page 0 or 1 in page config
selection register at address 0x00. It makes sense to me for this case.
But for the sc16is7xx, for example you have these two
independent registers, sharing the exact same address:
#define SC16IS7XX_IIR_REG (0x02) /* Interrupt Identification */
#define SC16IS7XX_FCR_REG (0x02) /* FIFO control */
I am not sure if regmap range can be used with this configuration.
Assuming regmap range would be properly setup, when we call
regmap_read(regmap, SC16IS7XX_IIR_REG, &val), how does regmap would
know that we want to access SC16IS7XX_IIR_REG and not SC16IS7XX_FCR_REG?
> Searching for struct regmap_range_cfg should show a lot of users in
> mainline.
Yes, I am trying to find a good example but I must download and read the
datasheet for each one. If you could point to an IC/driver that uses
regmap_range similar to IC sc16is7xx, it would really help.
Thank you
Hugo Villeneuve
next prev parent reply other threads:[~2023-12-04 17:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 14:51 Jan Kundrát
2023-12-01 16:14 ` Andy Shevchenko
2023-12-01 16:23 ` Mark Brown
2023-12-01 16:21 ` Mark Brown
2023-12-01 17:02 ` Andy Shevchenko
2023-12-02 10:29 ` Jan Kundrát
2023-12-01 18:27 ` Hugo Villeneuve
2023-12-01 18:34 ` Mark Brown
2023-12-01 21:38 ` Hugo Villeneuve
2023-12-01 21:41 ` Mark Brown
2023-12-01 22:16 ` Hugo Villeneuve
2023-12-04 16:29 ` Hugo Villeneuve
2023-12-04 16:35 ` Mark Brown
2023-12-04 17:01 ` Hugo Villeneuve [this message]
2023-12-04 17:19 ` Mark Brown
2023-12-04 18:59 ` Hugo Villeneuve
2023-12-04 19:16 ` Mark Brown
2023-12-04 19:41 ` Hugo Villeneuve
2023-12-04 19:48 ` Mark Brown
2023-12-04 20:02 ` Hugo Villeneuve
2023-12-04 22:09 ` Mark Brown
2023-12-05 15:52 ` Hugo Villeneuve
2023-12-05 16:00 ` Mark Brown
2023-12-01 21:40 ` Hugo Villeneuve
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=20231204120151.f0afbee2ebc69e93e7977547@hugovil.com \
--to=hugo@hugovil.com \
--cc=andy.shevchenko@gmail.com \
--cc=broonie@kernel.org \
--cc=cosmin.tanislav@analog.com \
--cc=jan.kundrat@cesnet.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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®