mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
mfd: max96755f: Add patgen_mode debug node
Enable pattern: echo 2 > /sys/bus/i2c/devices/x-0040/patgen_mode Disable pattern: echo 0 > /sys/bus/i2c/devices/x-0040/patgen_mode Change-Id: I5bf970210b14f93599a36c78703e53252546da5b Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user