Merge android-gs-pixel-5.10 into android12-gs-pixel-5.10-sc
Bug: 194964579
Change-Id: Ia87d2145866813ce80a273be491c2e97324ebf52
Signed-off-by: Aaron Ding <aaronding@google.com>
diff --git a/cs40l26/cs40l26.c b/cs40l26/cs40l26.c
index 32e6dd5..4f10c6f 100644
--- a/cs40l26/cs40l26.c
+++ b/cs40l26/cs40l26.c
@@ -2263,7 +2263,7 @@
if (!cs40l26->input)
return -ENOMEM;
- cs40l26->input->name = "cs40l26_input";
+ cs40l26->input->name = cs40l26->pdata.device_name;
cs40l26->input->id.product = cs40l26->devid;
cs40l26->input->id.version = cs40l26->revid;
@@ -3034,6 +3034,7 @@
{
struct device *dev = cs40l26->dev;
struct device_node *np = dev->of_node;
+ const char *str = NULL;
u32 val;
if (!np) {
@@ -3041,6 +3042,11 @@
return -ENOENT;
}
+ if (!of_property_read_string(np, "input-device-name", &str))
+ cs40l26->pdata.device_name = str;
+ else
+ cs40l26->pdata.device_name = CS40L26_INPUT_DEV_NAME;
+
if (of_property_read_bool(np, "cirrus,basic-config"))
cs40l26->fw_mode = CS40L26_FW_MODE_ROM;
else
diff --git a/cs40l26/cs40l26.h b/cs40l26/cs40l26.h
index 797c717..7c0bce8 100644
--- a/cs40l26/cs40l26.h
+++ b/cs40l26/cs40l26.h
@@ -620,6 +620,7 @@
#define CS40L26_MAX_I2C_READ_SIZE_BYTES 32
#define CS40L26_DEV_NAME "CS40L26"
+#define CS40L26_INPUT_DEV_NAME "cs40l26_input"
#define CS40L26_DEVID_A 0x40A260
#define CS40L26_DEVID_B 0x40A26B
#define CS40L26_DEVID_MASK GENMASK(23, 0)
@@ -1258,6 +1259,7 @@
};
struct cs40l26_platform_data {
+ const char *device_name;
bool vbbr_en;
u32 vbbr_thld;
u32 vbbr_max_att;