summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel_cht_int33fe_common.h
diff options
context:
space:
mode:
authorYauhen Kharuzhy <jekhor@gmail.com>2019-10-05 23:42:55 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-10-15 10:55:10 +0300
commitd740795d9273dafb02ed809f3b68d62388bc08d9 (patch)
treee6580c7b23bb6a26ab8a515df8f50ba61f70b330 /drivers/platform/x86/intel_cht_int33fe_common.h
parentc656829f073b244ae84f6c41a213ec619434f8fe (diff)
downloadlinux-d740795d9273dafb02ed809f3b68d62388bc08d9.tar.gz
linux-d740795d9273dafb02ed809f3b68d62388bc08d9.tar.bz2
linux-d740795d9273dafb02ed809f3b68d62388bc08d9.zip
platform/x86: intel_cht_int33fe: Split code to Micro-B and Type-C
Existing intel_cht_int33fe ACPI pseudo-device driver assumes that hardware has Type-C connector and register related devices described as I2C connections in the _CRS resource. There is at least one hardware (Lenovo Yoga Book YB1-91L/F) with Micro-B USB connector exists. It has INT33FE device in the DSDT table but there are only two I2C connection described: PMIC and BQ27452 battery fuel gauge. Splitting existing INT33FE driver allow to maintain code for USB Micro-B (or AB) connector variant separately and make it simpler. Split driver to intel_cht_int33fe_common.c and intel_cht_int33fe_{microb,typec}.c. Compile all this sources to one .ko module to make user experience easier. Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel_cht_int33fe_common.h')
-rw-r--r--drivers/platform/x86/intel_cht_int33fe_common.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_cht_int33fe_common.h b/drivers/platform/x86/intel_cht_int33fe_common.h
new file mode 100644
index 000000000000..03cd45f4e8cb
--- /dev/null
+++ b/drivers/platform/x86/intel_cht_int33fe_common.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Common code for Intel Cherry Trail ACPI INT33FE pseudo device drivers
+ * (USB Micro-B and Type-C connector variants), header file
+ *
+ * Copyright (c) 2019 Yauhen Kharuzhy <jekhor@gmail.com>
+ */
+
+#ifndef _INTEL_CHT_INT33FE_COMMON_H
+#define _INTEL_CHT_INT33FE_COMMON_H
+
+#include <linux/device.h>
+#include <linux/fwnode.h>
+#include <linux/i2c.h>
+
+enum int33fe_hw_type {
+ INT33FE_HW_MICROB,
+ INT33FE_HW_TYPEC,
+};
+
+struct cht_int33fe_data {
+ struct device *dev;
+
+ int (*probe)(struct cht_int33fe_data *data);
+ int (*remove)(struct cht_int33fe_data *data);
+
+ struct i2c_client *battery_fg;
+
+ /* Type-C only */
+ struct i2c_client *fusb302;
+ struct i2c_client *pi3usb30532;
+
+ struct fwnode_handle *dp;
+};
+
+int cht_int33fe_microb_probe(struct cht_int33fe_data *data);
+int cht_int33fe_microb_remove(struct cht_int33fe_data *data);
+int cht_int33fe_typec_probe(struct cht_int33fe_data *data);
+int cht_int33fe_typec_remove(struct cht_int33fe_data *data);
+
+#endif /* _INTEL_CHT_INT33FE_COMMON_H */