2021-02-15 09:53:23

by Chanwoo Choi

[permalink] [raw]
Subject: [PATCH 0/3] extcon: Add missing function defintion and update extcon driver

Instead of pull request for extcon next of v5.12, send the patches
because the pull request was too late for merging them.

Detailed description of this patchset as following:
- Add missing function definitions for extcon_register_notifier()
- Add charging interrupt handling such as CHGINS and CHGRM interrupt for extcon-max8997.c
- Detect OTG when USB_ID is connected to ground for extcon-sm5502.c

Reference of previous pull request,
[1] [GIT PULL ,v3] extcon next for v5.12
- https://lore.kernel.org/patchwork/patch/1380533/
[2] [GIT PULL v2] extcon next for v5.12
- https://lore.kernel.org/patchwork/patch/1379836/
[3] [GIT PULL] extcon next for v5.12
- https://lore.kernel.org/patchwork/patch/1378261/

Krzysztof Kozlowski (1):
extcon: Add stubs for extcon_register_notifier_all() functions

Nikita Travkin (1):
extcon: sm5502: Detect OTG when USB_ID is connected to ground

Timon Baetz (1):
extcon: max8997: Add CHGINS and CHGRM interrupt handling

drivers/extcon/extcon-max8997.c | 4 ++++
drivers/extcon/extcon-sm5502.c | 22 ++++++++++++++++++++--
include/linux/extcon.h | 23 +++++++++++++++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)

--
2.17.1


2021-02-15 09:53:48

by Chanwoo Choi

[permalink] [raw]
Subject: [PATCH 2/3] extcon: max8997: Add CHGINS and CHGRM interrupt handling

From: Timon Baetz <[email protected]>

This allows the MAX8997 charger to set the current limit depending on
the detected extcon charger type.

Signed-off-by: Timon Baetz <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
---
drivers/extcon/extcon-max8997.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 337b0eea4e62..e1408075ef7d 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -44,6 +44,8 @@ static struct max8997_muic_irq muic_irqs[] = {
{ MAX8997_MUICIRQ_ChgDetRun, "muic-CHGDETRUN" },
{ MAX8997_MUICIRQ_ChgTyp, "muic-CHGTYP" },
{ MAX8997_MUICIRQ_OVP, "muic-OVP" },
+ { MAX8997_PMICIRQ_CHGINS, "pmic-CHGINS" },
+ { MAX8997_PMICIRQ_CHGRM, "pmic-CHGRM" },
};

/* Define supported cable type */
@@ -538,6 +540,8 @@ static void max8997_muic_irq_work(struct work_struct *work)
case MAX8997_MUICIRQ_DCDTmr:
case MAX8997_MUICIRQ_ChgDetRun:
case MAX8997_MUICIRQ_ChgTyp:
+ case MAX8997_PMICIRQ_CHGINS:
+ case MAX8997_PMICIRQ_CHGRM:
/* Handle charger cable */
ret = max8997_muic_chg_handler(info);
break;
--
2.17.1

2021-02-15 09:55:32

by Chanwoo Choi

[permalink] [raw]
Subject: [PATCH 1/3] extcon: Add stubs for extcon_register_notifier_all() functions

From: Krzysztof Kozlowski <[email protected]>

Add stubs for extcon_register_notifier_all() function for !CONFIG_EXTCON
case. This is useful for compile testing and for drivers which use
EXTCON but do not require it (therefore do not depend on CONFIG_EXTCON).

Fixes: 815429b39d94 ("extcon: Add new extcon_register_notifier_all() to monitor all external connectors")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
---
include/linux/extcon.h | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index fd183fb9c20f..0c19010da77f 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -271,6 +271,29 @@ static inline void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb) { }

+static inline int extcon_register_notifier_all(struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int extcon_unregister_notifier_all(struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline int devm_extcon_register_notifier_all(struct device *dev,
+ struct extcon_dev *edev,
+ struct notifier_block *nb)
+{
+ return 0;
+}
+
+static inline void devm_extcon_unregister_notifier_all(struct device *dev,
+ struct extcon_dev *edev,
+ struct notifier_block *nb) { }
+
static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
{
return ERR_PTR(-ENODEV);
--
2.17.1