diff --git a/drivers/mfd/max96755f.c b/drivers/mfd/max96755f.c index 6b7b10339ecf..eef5ef2f1ff5 100644 --- a/drivers/mfd/max96755f.c +++ b/drivers/mfd/max96755f.c @@ -195,8 +195,28 @@ static ssize_t line_fault_monitor_show(struct device *device, static DEVICE_ATTR_RO(line_fault_monitor); +static ssize_t patgen_mode_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct max96755f *max96755f = dev_get_drvdata(dev); + u8 patgen_mode; + int ret; + + ret = kstrtou8(buf, 0, &patgen_mode); + if (ret) + return ret; + + regmap_update_bits(max96755f->regmap, 0x01e5, PATGEN_MODE, + FIELD_PREP(PATGEN_MODE, patgen_mode)); + + return count; +} +static DEVICE_ATTR_WO(patgen_mode); + static struct attribute *max96755f_attrs[] = { &dev_attr_line_fault_monitor.attr, + &dev_attr_patgen_mode.attr, NULL }; diff --git a/include/linux/mfd/max96755f.h b/include/linux/mfd/max96755f.h index 74b0fff0d24e..eae6da60f66f 100644 --- a/include/linux/mfd/max96755f.h +++ b/include/linux/mfd/max96755f.h @@ -79,6 +79,9 @@ /* 0170h */ #define SPI_EN BIT(0) +/* 01e5h */ +#define PATGEN_MODE GENMASK(1, 0) + /* 02beh */ #define RES_CFG BIT(7) #define TX_PRIO BIT(6)