|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
From bd0d7169342e47919f68e75d659968f02b62f84b Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
From: Hans de Goede <hdegoede@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Date: Fri, 3 Mar 2017 23:48:50 +0100
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Subject: [PATCH 15/16] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
controller driver
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
The Intel Cherry Trail Whiskey Cove PMIC does not contain a builtin
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
battery charger, instead boards with this PMIC use an external TI
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
bq24292i charger IC, which is connected to a SMBUS controller built into
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
the PMIC.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
This commit adds an i2c-bus driver for the PMIC's builtin SMBUS
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
controller. The probe function for this i2c-bus will also register an
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
i2c-client for the TI bq24292i charger after the i2c-bus has been
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
registered.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Note that several device-properties are set on the client-device to
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
tell the bq24190 power-supply driver to integrate the Whiskey Cove PMIC
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
and e.g. use the PMIC's BC1.2 detection (through extcon) to determine
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
the maximum input current.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
---
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
Changes in v2:
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
-Various style (mostly captialization and variable name) fixes
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
-Use device-properties instead of platform_data for the i2c_board_info
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
---
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
drivers/i2c/busses/Kconfig | 8 +
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
drivers/i2c/busses/Makefile | 1 +
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
drivers/i2c/busses/i2c-cht-wc.c | 336 ++++++++++++++++++++++++++++++++++++++++
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
3 files changed, 345 insertions(+)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
create mode 100644 drivers/i2c/busses/i2c-cht-wc.c
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
index 144cbadc7c72..18c96178b177 100644
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
--- a/drivers/i2c/busses/Kconfig
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+++ b/drivers/i2c/busses/Kconfig
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
@@ -187,6 +187,14 @@ config I2C_PIIX4
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
This driver can also be built as a module. If so, the module
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
will be called i2c-piix4.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+config I2C_CHT_WC
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ tristate "Intel Cherry Trail Whiskey Cove PMIC smbus controller"
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ depends on INTEL_SOC_PMIC_CHTWC
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ help
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ If you say yes to this option, support will be included for the
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ SMBus controller found in the Intel Cherry Trail Whiskey Cove PMIC
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ found on some Intel Cherry Trail systems.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
config I2C_NFORCE2
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
tristate "Nvidia nForce2, nForce3 and nForce4"
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
depends on PCI
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
index 30b60855fbcd..f6443fa44f61 100644
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
--- a/drivers/i2c/busses/Makefile
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+++ b/drivers/i2c/busses/Makefile
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
@@ -12,6 +12,7 @@ obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_AMD756_S4882) += i2c-amd756-s4882.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
new file mode 100644
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
index 000000000000..ccf0785bcb75
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
--- /dev/null
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+++ b/drivers/i2c/busses/i2c-cht-wc.c
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
@@ -0,0 +1,336 @@
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+/*
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Intel CHT Whiskey Cove PMIC I2C Master driver
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ *
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Based on various non upstream patches to support the CHT Whiskey Cove PMIC:
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Copyright (C) 2011 - 2014 Intel Corporation. All rights reserved.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ *
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * This program is free software; you can redistribute it and/or
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * modify it under the terms of the GNU General Public License version
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * 2 as published by the Free Software Foundation.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ *
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * This program is distributed in the hope that it will be useful,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * GNU General Public License for more details.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/completion.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/delay.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/i2c.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/interrupt.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/irq.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/irqdomain.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/mfd/intel_soc_pmic.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/module.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/platform_device.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#include <linux/slab.h>
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_CTRL 0x5e24
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_CTRL_WR BIT(0)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_CTRL_RD BIT(1)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_CLIENT_ADDR 0x5e25
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_REG_OFFSET 0x5e26
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_WRDATA 0x5e27
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_I2C_RDDATA 0x5e28
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ 0x6e0a
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_CLIENT_IRQ BIT(0)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_WRITE_IRQ BIT(1)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_READ_IRQ BIT(2)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_NACK_IRQ BIT(3)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK ((u8)GENMASK(3, 1))
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+#define CHT_WC_EXTCHGRIRQ_MSK 0x6e17
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+struct cht_wc_i2c_adap {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct i2c_adapter adapter;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ wait_queue_head_t wait;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct irq_chip irqchip;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct mutex irqchip_lock;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct regmap *regmap;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct irq_domain *irq_domain;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct i2c_client *client;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ int client_irq;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ u8 irq_mask;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ u8 old_irq_mask;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ bool nack;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ bool done;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static irqreturn_t cht_wc_i2c_adap_thread_handler(int id, void *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = data;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ int ret, reg;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /* Read IRQs */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_read(adap->regmap, CHT_WC_EXTCHGRIRQ, ®);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ dev_err(&adap->adapter.dev, "Error reading extchgrirq reg\n");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return IRQ_NONE;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ reg &= ~adap->irq_mask;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /*
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Immediately ack IRQs, so that if new IRQs arrives while we're
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * handling the previous ones our irq will re-trigger when we're done.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ, reg);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ dev_err(&adap->adapter.dev, "Error writing extchgrirq reg\n");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /*
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * Do NOT use handle_nested_irq here, the client irq handler will
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * likely want to do i2c transfers and the i2c controller uses this
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * interrupt handler as well, so running the client irq handler from
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * this thread will cause things to lock up.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (reg & CHT_WC_EXTCHGRIRQ_CLIENT_IRQ) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /*
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * generic_handle_irq expects local IRQs to be disabled
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ * as normally it is called from interrupt context.
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ local_irq_disable();
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ generic_handle_irq(adap->client_irq);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ local_irq_enable();
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (reg & CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->nack = !!(reg & CHT_WC_EXTCHGRIRQ_NACK_IRQ);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->done = true;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ wake_up(&adap->wait);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return IRQ_HANDLED;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static u32 cht_wc_i2c_adap_master_func(struct i2c_adapter *adap)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /* This i2c adapter only supports SMBUS byte transfers */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return I2C_FUNC_SMBUS_BYTE_DATA;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static int cht_wc_i2c_adap_smbus_xfer(struct i2c_adapter *_adap, u16 addr,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ unsigned short flags, char read_write,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ u8 command, int size,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ union i2c_smbus_data *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = i2c_get_adapdata(_adap);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ int ret, reg;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->nack = false;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->done = false;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_I2C_CLIENT_ADDR, addr);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (read_write == I2C_SMBUS_WRITE) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_I2C_WRDATA, data->byte);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_I2C_REG_OFFSET, command);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_I2C_CTRL,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ (read_write == I2C_SMBUS_WRITE) ?
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ CHT_WC_I2C_CTRL_WR : CHT_WC_I2C_CTRL_RD);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /* 3 second timeout, during cable plug the PMIC responds quite slow */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = wait_event_timeout(adap->wait, adap->done, 3 * HZ);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return -ETIMEDOUT;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (adap->nack)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return -EIO;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (read_write == I2C_SMBUS_READ) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_read(adap->regmap, CHT_WC_I2C_RDDATA, ®);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ data->byte = reg;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static const struct i2c_algorithm cht_wc_i2c_adap_algo = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .functionality = cht_wc_i2c_adap_master_func,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .smbus_xfer = cht_wc_i2c_adap_smbus_xfer,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+/**** irqchip for the client connected to the extchgr i2c adapter ****/
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static void cht_wc_i2c_irq_lock(struct irq_data *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ mutex_lock(&adap->irqchip_lock);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static void cht_wc_i2c_irq_sync_unlock(struct irq_data *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ int ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (adap->irq_mask != adap->old_irq_mask) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ_MSK,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->irq_mask);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret == 0)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->old_irq_mask = adap->irq_mask;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ else
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ dev_err(&adap->adapter.dev, "Error writing EXTCHGRIRQ_MSK\n");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ mutex_unlock(&adap->irqchip_lock);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static void cht_wc_i2c_irq_enable(struct irq_data *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->irq_mask &= ~CHT_WC_EXTCHGRIRQ_CLIENT_IRQ;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static void cht_wc_i2c_irq_disable(struct irq_data *data)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->irq_mask |= CHT_WC_EXTCHGRIRQ_CLIENT_IRQ;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static const struct irq_chip cht_wc_i2c_irq_chip = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .irq_bus_lock = cht_wc_i2c_irq_lock,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .irq_bus_sync_unlock = cht_wc_i2c_irq_sync_unlock,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .irq_disable = cht_wc_i2c_irq_disable,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .irq_enable = cht_wc_i2c_irq_enable,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .name = "cht_wc_ext_chrg_irq_chip",
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static const struct property_entry bq24190_props[] = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ PROPERTY_ENTRY_STRING("extcon-name", "cht_wcove_pwrsrc"),
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ PROPERTY_ENTRY_BOOL("omit-battery-class"),
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ PROPERTY_ENTRY_BOOL("disable-reset"),
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ { }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct i2c_board_info board_info = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .type = "bq24190",
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .addr = 0x6b,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .properties = bq24190_props,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ };
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ int ret, irq;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ irq = platform_get_irq(pdev, 0);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (irq < 0) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ dev_err(&pdev->dev, "Error missing irq resource\n");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return -EINVAL;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap = devm_kzalloc(&pdev->dev, sizeof(*adap), GFP_KERNEL);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (!adap)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return -ENOMEM;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ init_waitqueue_head(&adap->wait);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ mutex_init(&adap->irqchip_lock);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->irqchip = cht_wc_i2c_irq_chip;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->regmap = pmic->regmap;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->adapter.owner = THIS_MODULE;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->adapter.class = I2C_CLASS_HWMON;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->adapter.algo = &cht_wc_i2c_adap_algo;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ strlcpy(adap->adapter.name, "PMIC I2C Adapter",
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ sizeof(adap->adapter.name));
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->adapter.dev.parent = &pdev->dev;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /* Clear and activate i2c-adapter interrupts, disable client IRQ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->old_irq_mask = adap->irq_mask = ~CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ, ~adap->irq_mask);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ_MSK, adap->irq_mask);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ /* Alloc and register client IRQ */
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->irq_domain = irq_domain_add_linear(pdev->dev.of_node, 1,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ &irq_domain_simple_ops, NULL);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (!adap->irq_domain)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return -ENOMEM;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->client_irq = irq_create_mapping(adap->irq_domain, 0);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (!adap->client_irq) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = -ENOMEM;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ goto remove_irq_domain;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ irq_set_chip_data(adap->client_irq, adap);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ irq_set_chip_and_handler(adap->client_irq, &adap->irqchip,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ handle_simple_irq);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ cht_wc_i2c_adap_thread_handler,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ IRQF_ONESHOT, "PMIC I2C Adapter", adap);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ goto remove_irq_domain;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ i2c_set_adapdata(&adap->adapter, adap);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = i2c_add_adapter(&adap->adapter);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (ret)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ goto remove_irq_domain;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ board_info.irq = adap->client_irq;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ adap->client = i2c_new_device(&adap->adapter, &board_info);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ if (!adap->client) {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ ret = -ENOMEM;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ goto del_adapter;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ platform_set_drvdata(pdev, adap);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+del_adapter:
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ i2c_del_adapter(&adap->adapter);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+remove_irq_domain:
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ irq_domain_remove(adap->irq_domain);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return ret;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev)
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ struct cht_wc_i2c_adap *adap = platform_get_drvdata(pdev);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ i2c_unregister_device(adap->client);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ i2c_del_adapter(&adap->adapter);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ irq_domain_remove(adap->irq_domain);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+static struct platform_device_id cht_wc_i2c_adap_id_table[] = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ { .name = "cht_wcove_ext_chgr" },
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ {},
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+MODULE_DEVICE_TABLE(platform, cht_wc_i2c_adap_id_table);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+struct platform_driver cht_wc_i2c_adap_driver = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .probe = cht_wc_i2c_adap_i2c_probe,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .remove = cht_wc_i2c_adap_i2c_remove,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .driver = {
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .name = "cht_wcove_ext_chgr",
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ },
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+ .id_table = cht_wc_i2c_adap_id_table,
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+};
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+module_platform_driver(cht_wc_i2c_adap_driver);
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C Master driver");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
+MODULE_LICENSE("GPL");
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
--
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
2.13.0
|
|
![](https://seccdn.libravatar.org/avatar/a90c8fc1fa6bf435277bf1a6f0e8dcfa5081a34b29502febdc7c45358f87105e?s=16&d=retro) |
88f3771 |
|