[PATCH 02/14] spi: spi-fsl-dspi: Re-use one volatile regmap for both device types

Vladimir Oltean olteanv at gmail.com
Fri May 9 09:07:31 PDT 2025


On Fri, May 09, 2025 at 12:05:49PM +0100, James Clark wrote:
> max_register overrides anything in the volatile ranges, so we can get
> away with sharing the same one for both types. In a later commit we'll
> add more devices and also read/write ranges which also override volatile
> ranges so this avoids adding even more duplication.
> 
> No functional changes.
> 
> Signed-off-by: James Clark <james.clark at linaro.org>
> ---
>  drivers/spi/spi-fsl-dspi.c | 15 ++-------------
>  1 file changed, 2 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> index 31ea8ce81e98..cb0e55a49eea 100644
> --- a/drivers/spi/spi-fsl-dspi.c
> +++ b/drivers/spi/spi-fsl-dspi.c
> @@ -141,6 +141,7 @@ static const struct regmap_range dspi_volatile_ranges[] = {
>  	regmap_reg_range(SPI_MCR, SPI_TCR),
>  	regmap_reg_range(SPI_SR, SPI_SR),
>  	regmap_reg_range(SPI_PUSHR, SPI_RXFR3),
> +	regmap_reg_range(SPI_SREX, SPI_SREX)

Same idea, don't take the review tag as a sign that I don't have any
change request here.

>  };
>  
>  static const struct regmap_access_table dspi_volatile_table = {
> @@ -148,18 +149,6 @@ static const struct regmap_access_table dspi_volatile_table = {
>  	.n_yes_ranges	= ARRAY_SIZE(dspi_volatile_ranges),
>  };
>  
> -static const struct regmap_range dspi_xspi_volatile_ranges[] = {
> -	regmap_reg_range(SPI_MCR, SPI_TCR),
> -	regmap_reg_range(SPI_SR, SPI_SR),
> -	regmap_reg_range(SPI_PUSHR, SPI_RXFR3),
> -	regmap_reg_range(SPI_SREX, SPI_SREX),
> -};
> -
> -static const struct regmap_access_table dspi_xspi_volatile_table = {
> -	.yes_ranges	= dspi_xspi_volatile_ranges,
> -	.n_yes_ranges	= ARRAY_SIZE(dspi_xspi_volatile_ranges),
> -};
> -
>  enum {
>  	DSPI_REGMAP,
>  	DSPI_XSPI_REGMAP,
> @@ -179,7 +168,7 @@ static const struct regmap_config dspi_regmap_config[] = {
>  		.val_bits	= 32,
>  		.reg_stride	= 4,
>  		.max_register	= 0x13c,
> -		.volatile_table	= &dspi_xspi_volatile_table
> +		.volatile_table	= &dspi_volatile_table
>  	},
>  	[DSPI_PUSHR] = {
>  		.name		= "pushr",
> 
> -- 
> 2.34.1
> 

Reviewed-by: Vladimir Oltean <olteanv at gmail.com>



More information about the linux-arm-kernel mailing list