Skip to content

Commit

Permalink
iio: accel: fxls8962af: add padding to regmap for SPI
Browse files Browse the repository at this point in the history
commit ccbed9d upstream.

Add missing don't care padding between address and
data for SPI transfers

Fixes: a3e0b51 ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers")
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Link: https://lore.kernel.org/r/20211220125144.3630539-1-sean@geanix.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
sknsean authored and gregkh committed Mar 2, 2022
1 parent ca9d179 commit c77f4ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
12 changes: 10 additions & 2 deletions drivers/iio/accel/fxls8962af-core.c
Expand Up @@ -154,12 +154,20 @@ struct fxls8962af_data {
u8 watermark;
};

const struct regmap_config fxls8962af_regmap_conf = {
const struct regmap_config fxls8962af_i2c_regmap_conf = {
.reg_bits = 8,
.val_bits = 8,
.max_register = FXLS8962AF_MAX_REG,
};
EXPORT_SYMBOL_GPL(fxls8962af_regmap_conf);
EXPORT_SYMBOL_GPL(fxls8962af_i2c_regmap_conf);

const struct regmap_config fxls8962af_spi_regmap_conf = {
.reg_bits = 8,
.pad_bits = 8,
.val_bits = 8,
.max_register = FXLS8962AF_MAX_REG,
};
EXPORT_SYMBOL_GPL(fxls8962af_spi_regmap_conf);

enum {
fxls8962af_idx_x,
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/accel/fxls8962af-i2c.c
Expand Up @@ -18,7 +18,7 @@ static int fxls8962af_probe(struct i2c_client *client)
{
struct regmap *regmap;

regmap = devm_regmap_init_i2c(client, &fxls8962af_regmap_conf);
regmap = devm_regmap_init_i2c(client, &fxls8962af_i2c_regmap_conf);
if (IS_ERR(regmap)) {
dev_err(&client->dev, "Failed to initialize i2c regmap\n");
return PTR_ERR(regmap);
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/accel/fxls8962af-spi.c
Expand Up @@ -18,7 +18,7 @@ static int fxls8962af_probe(struct spi_device *spi)
{
struct regmap *regmap;

regmap = devm_regmap_init_spi(spi, &fxls8962af_regmap_conf);
regmap = devm_regmap_init_spi(spi, &fxls8962af_spi_regmap_conf);
if (IS_ERR(regmap)) {
dev_err(&spi->dev, "Failed to initialize spi regmap\n");
return PTR_ERR(regmap);
Expand Down
3 changes: 2 additions & 1 deletion drivers/iio/accel/fxls8962af.h
Expand Up @@ -17,6 +17,7 @@ int fxls8962af_core_probe(struct device *dev, struct regmap *regmap, int irq);
int fxls8962af_core_remove(struct device *dev);

extern const struct dev_pm_ops fxls8962af_pm_ops;
extern const struct regmap_config fxls8962af_regmap_conf;
extern const struct regmap_config fxls8962af_i2c_regmap_conf;
extern const struct regmap_config fxls8962af_spi_regmap_conf;

#endif /* _FXLS8962AF_H_ */

0 comments on commit c77f4ae

Please sign in to comment.