From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Mark Brown <broonie@kernel.org>,
vkoul@kernel.org, yung-chuan.liao@linux.intel.com,
sanyog.r.kale@intel.com, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: Re: [PATCH 2/2] regmap: sdw: Remove 8-bit value size restriction
Date: Fri, 13 Jan 2023 10:57:39 -0600 [thread overview]
Message-ID: <487b7647-8304-8e36-00f2-c9ba3aa50004@linux.intel.com> (raw)
In-Reply-To: <20230113110252.GK36097@ediswmail.ad.cirrus.com>
On 1/13/23 05:02, Charles Keepax wrote:
> On Thu, Jan 12, 2023 at 02:19:29PM -0600, Pierre-Louis Bossart wrote:
>> On 1/12/23 13:50, Mark Brown wrote:
>>> On Thu, Jan 12, 2023 at 12:43:46PM -0600, Pierre-Louis Bossart wrote:
>>>> On 1/12/23 12:14, Mark Brown wrote:
>>>
>>>>> The regmap gather_write() operation allows the bus to take two buffers,
>>>>> one for the register and one for the value, rather than requiring the
>>>>> core combine everything into a single buffer (mainly useful for large
>>>>> transfers like firmware downloads).
>>>
>>>> Right, but that's not supported in SoundWire. sdw_nwrite() will only
>>>> work with consecutive addresses - and the auto-increment is handled in
>>>> software, not hardware.
>>>
>>> No, that's exactly what this is for. It's for the *register address*
>>> being in a separate buffer, the data is then a sequence of consecutive
>>> register values.>
>>>> What's suggested here is to use the first element of reg_buf, which begs
>>>> the question how different this is from a regular write. If there was a
>>>> discontinuity in reg_buf then this wouldn't work at all.
>>>
>>> reg_buf contains the address of exactly one register.
>>
>> So what's the difference with a plain write() of N data?
>
> There are two back end interfaces in regmap, the reg_write/read
> and the plain write/read. Both have currently have some
> limitations when dealing with SoundWire.
>
> The reg_write/reg_read can only deal with a single register
> at a time, which is really far from ideal, since it means
> all transactions will be broken up into individual registers
> at the regmap level, mostly depriving the SoundWire side
> of the opportunity to do things like a BRA transfer if it
> deems that suitable. And denying users the ability to use the
> regmap_raw_read/write API at all.
>
> The write/read interface allows us to pass the full transaction
> through, but does have the downside it copies the address around
> a bit more and does some pointless endian swaps on big endian
> systems. This interface is generally used by buses like I2C/SPI
> where there is no actual concept of a register address only a
> buffer of bytes to be sent/read, thus prefers to pass a single
> working buffer if it sensibly can. I went with this solution
> because it enables all the functionality and the downside is
> fairly minimal, apart from looking a little clunky as you note.
The change from reg_write/read_reg to write/read seems ok, what I was
asking about was the gather_write.
+ .write = regmap_sdw_write,
+ .gather_write = regmap_sdw_gather_write,
+ .read = regmap_sdw_read,
what happens if you only have .write and .read? What does the
.gather_write help with if you only use only address?
next prev parent reply other threads:[~2023-01-13 16:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 17:18 [PATCH 0/2] Minor SoundWire Regmap Tweaks Charles Keepax
2023-01-12 17:18 ` [PATCH 1/2] regmap: sdw: Update misleading comment Charles Keepax
2023-01-12 17:18 ` [PATCH 2/2] regmap: sdw: Remove 8-bit value size restriction Charles Keepax
2023-01-12 17:38 ` Pierre-Louis Bossart
2023-01-12 18:14 ` Mark Brown
2023-01-12 18:43 ` Pierre-Louis Bossart
2023-01-12 19:50 ` Mark Brown
2023-01-12 20:19 ` Pierre-Louis Bossart
2023-01-13 11:02 ` Charles Keepax
2023-01-13 16:57 ` Pierre-Louis Bossart [this message]
2023-01-13 17:11 ` Mark Brown
2023-01-13 18:03 ` Pierre-Louis Bossart
2023-03-10 15:02 ` [PATCH 0/2] Minor SoundWire Regmap Tweaks 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=487b7647-8304-8e36-00f2-c9ba3aa50004@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.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.