public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>,
	broonie@kernel.org, vkoul@kernel.org
Cc: 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: Thu, 12 Jan 2023 11:38:38 -0600	[thread overview]
Message-ID: <756fcb2d-d571-18cb-985e-d907ab682275@linux.intel.com> (raw)
In-Reply-To: <20230112171840.2098463-3-ckeepax@opensource.cirrus.com>



> -static int regmap_sdw_write(void *context, unsigned int reg, unsigned int val)
> +static int regmap_sdw_write(void *context, const void *val_buf, size_t val_size)
>  {
>  	struct device *dev = context;
>  	struct sdw_slave *slave = dev_to_sdw_dev(dev);
> +	/* First word of buffer contains the destination address */
> +	u32 addr = le32_to_cpu(*(const __le32 *)val_buf);
> +	const u8 *val = val_buf;
>  
> -	return sdw_write_no_pm(slave, reg, val);
> +	return sdw_nwrite_no_pm(slave, addr, val_size - sizeof(addr), val + sizeof(addr));
>  }
>  
> -static int regmap_sdw_read(void *context, unsigned int reg, unsigned int *val)
> +static int regmap_sdw_gather_write(void *context,
> +				   const void *reg_buf, size_t reg_size,
> +				   const void *val_buf, size_t val_size)
>  {
>  	struct device *dev = context;
>  	struct sdw_slave *slave = dev_to_sdw_dev(dev);
> -	int read;
> +	u32 addr = le32_to_cpu(*(const __le32 *)reg_buf);

what's the difference between regmap_sdw_write() and
regmap_sdw_gather_write()? Seems to me that it's the same functionality
of writing at consecutive addresses. It's not a true 'gather' in the
sense that only the first address is used?

>  
> -	read = sdw_read_no_pm(slave, reg);
> -	if (read < 0)
> -		return read;
> +	return sdw_nwrite_no_pm(slave, addr, val_size, val_buf);
> +}
>  
> -	*val = read;
> -	return 0;

  reply	other threads:[~2023-01-12 18:11 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 [this message]
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
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=756fcb2d-d571-18cb-985e-d907ab682275@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox