mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-05 05:36:46 +07:00
regmap: Add missing little endian functions
This with the longer read and write masks allow supporting more exotic devices. For example a little endian SPI device: static const struct regmap_config foo_regmap_config = { .reg_bits = 16, .reg_stride = 4, .val_bits = 16, .write_flag_mask = 0x8000, .reg_format_endian = REGMAP_ENDIAN_LITTLE, .val_format_endian = REGMAP_ENDIAN_LITTLE, ... }; Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
f50e38c996
commit
5556244903
@ -749,6 +749,9 @@ struct regmap *__regmap_init(struct device *dev,
|
|||||||
case REGMAP_ENDIAN_BIG:
|
case REGMAP_ENDIAN_BIG:
|
||||||
map->format.format_reg = regmap_format_16_be;
|
map->format.format_reg = regmap_format_16_be;
|
||||||
break;
|
break;
|
||||||
|
case REGMAP_ENDIAN_LITTLE:
|
||||||
|
map->format.format_reg = regmap_format_16_le;
|
||||||
|
break;
|
||||||
case REGMAP_ENDIAN_NATIVE:
|
case REGMAP_ENDIAN_NATIVE:
|
||||||
map->format.format_reg = regmap_format_16_native;
|
map->format.format_reg = regmap_format_16_native;
|
||||||
break;
|
break;
|
||||||
@ -768,6 +771,9 @@ struct regmap *__regmap_init(struct device *dev,
|
|||||||
case REGMAP_ENDIAN_BIG:
|
case REGMAP_ENDIAN_BIG:
|
||||||
map->format.format_reg = regmap_format_32_be;
|
map->format.format_reg = regmap_format_32_be;
|
||||||
break;
|
break;
|
||||||
|
case REGMAP_ENDIAN_LITTLE:
|
||||||
|
map->format.format_reg = regmap_format_32_le;
|
||||||
|
break;
|
||||||
case REGMAP_ENDIAN_NATIVE:
|
case REGMAP_ENDIAN_NATIVE:
|
||||||
map->format.format_reg = regmap_format_32_native;
|
map->format.format_reg = regmap_format_32_native;
|
||||||
break;
|
break;
|
||||||
@ -782,6 +788,9 @@ struct regmap *__regmap_init(struct device *dev,
|
|||||||
case REGMAP_ENDIAN_BIG:
|
case REGMAP_ENDIAN_BIG:
|
||||||
map->format.format_reg = regmap_format_64_be;
|
map->format.format_reg = regmap_format_64_be;
|
||||||
break;
|
break;
|
||||||
|
case REGMAP_ENDIAN_LITTLE:
|
||||||
|
map->format.format_reg = regmap_format_64_le;
|
||||||
|
break;
|
||||||
case REGMAP_ENDIAN_NATIVE:
|
case REGMAP_ENDIAN_NATIVE:
|
||||||
map->format.format_reg = regmap_format_64_native;
|
map->format.format_reg = regmap_format_64_native;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user