]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Apr 2020 19:02:05 +0000 (21:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Apr 2020 19:02:05 +0000 (21:02 +0200)
added patches:
coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch
extcon-axp288-add-wakeup-support.patch
mei-me-add-cedar-fork-device-ids.patch
misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch
misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch
misc-rtsx-set-correct-pcr_ops-for-rts522a.patch
power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch

queue-4.19/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch [new file with mode: 0644]
queue-4.19/extcon-axp288-add-wakeup-support.patch [new file with mode: 0644]
queue-4.19/mei-me-add-cedar-fork-device-ids.patch [new file with mode: 0644]
queue-4.19/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch [new file with mode: 0644]
queue-4.19/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch [new file with mode: 0644]
queue-4.19/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch [new file with mode: 0644]
queue-4.19/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch b/queue-4.19/coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch
new file mode 100644 (file)
index 0000000..5dc79dc
--- /dev/null
@@ -0,0 +1,39 @@
+From 9b6eaaf3db5e5888df7bca7fed7752a90f7fd871 Mon Sep 17 00:00:00 2001
+From: Eugene Syromiatnikov <esyr@redhat.com>
+Date: Tue, 24 Mar 2020 05:22:13 +0100
+Subject: coresight: do not use the BIT() macro in the UAPI header
+
+From: Eugene Syromiatnikov <esyr@redhat.com>
+
+commit 9b6eaaf3db5e5888df7bca7fed7752a90f7fd871 upstream.
+
+The BIT() macro definition is not available for the UAPI headers
+(moreover, it can be defined differently in the user space); replace
+its usage with the _BITUL() macro that is defined in <linux/const.h>.
+
+Fixes: 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component")
+Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
+Cc: stable <stable@vger.kernel.org>
+Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+Link: https://lore.kernel.org/r/20200324042213.GA10452@asgard.redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/uapi/linux/coresight-stm.h |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/include/uapi/linux/coresight-stm.h
++++ b/include/uapi/linux/coresight-stm.h
+@@ -2,8 +2,10 @@
+ #ifndef __UAPI_CORESIGHT_STM_H_
+ #define __UAPI_CORESIGHT_STM_H_
+-#define STM_FLAG_TIMESTAMPED   BIT(3)
+-#define STM_FLAG_GUARANTEED    BIT(7)
++#include <linux/const.h>
++
++#define STM_FLAG_TIMESTAMPED   _BITUL(3)
++#define STM_FLAG_GUARANTEED    _BITUL(7)
+ /*
+  * The CoreSight STM supports guaranteed and invariant timing
diff --git a/queue-4.19/extcon-axp288-add-wakeup-support.patch b/queue-4.19/extcon-axp288-add-wakeup-support.patch
new file mode 100644 (file)
index 0000000..491c60e
--- /dev/null
@@ -0,0 +1,74 @@
+From 9c94553099efb2ba873cbdddfd416a8a09d0e5f1 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Mon, 23 Mar 2020 22:59:39 +0100
+Subject: extcon: axp288: Add wakeup support
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 9c94553099efb2ba873cbdddfd416a8a09d0e5f1 upstream.
+
+On devices with an AXP288, we need to wakeup from suspend when a charger
+is plugged in, so that we can do charger-type detection and so that the
+axp288-charger driver, which listens for our extcon events, can configure
+the input-current-limit accordingly.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/extcon/extcon-axp288.c |   32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+--- a/drivers/extcon/extcon-axp288.c
++++ b/drivers/extcon/extcon-axp288.c
+@@ -428,9 +428,40 @@ static int axp288_extcon_probe(struct pl
+       /* Start charger cable type detection */
+       axp288_extcon_enable(info);
++      device_init_wakeup(dev, true);
++      platform_set_drvdata(pdev, info);
++
++      return 0;
++}
++
++static int __maybe_unused axp288_extcon_suspend(struct device *dev)
++{
++      struct axp288_extcon_info *info = dev_get_drvdata(dev);
++
++      if (device_may_wakeup(dev))
++              enable_irq_wake(info->irq[VBUS_RISING_IRQ]);
++
+       return 0;
+ }
++static int __maybe_unused axp288_extcon_resume(struct device *dev)
++{
++      struct axp288_extcon_info *info = dev_get_drvdata(dev);
++
++      /*
++       * Wakeup when a charger is connected to do charger-type
++       * connection and generate an extcon event which makes the
++       * axp288 charger driver set the input current limit.
++       */
++      if (device_may_wakeup(dev))
++              disable_irq_wake(info->irq[VBUS_RISING_IRQ]);
++
++      return 0;
++}
++
++static SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
++                       axp288_extcon_resume);
++
+ static const struct platform_device_id axp288_extcon_table[] = {
+       { .name = "axp288_extcon" },
+       {},
+@@ -442,6 +473,7 @@ static struct platform_driver axp288_ext
+       .id_table = axp288_extcon_table,
+       .driver = {
+               .name = "axp288_extcon",
++              .pm = &axp288_extcon_pm_ops,
+       },
+ };
diff --git a/queue-4.19/mei-me-add-cedar-fork-device-ids.patch b/queue-4.19/mei-me-add-cedar-fork-device-ids.patch
new file mode 100644 (file)
index 0000000..54b0e40
--- /dev/null
@@ -0,0 +1,44 @@
+From 99397d33b763dc554d118aaa38cc5abc6ce985de Mon Sep 17 00:00:00 2001
+From: Alexander Usyskin <alexander.usyskin@intel.com>
+Date: Tue, 24 Mar 2020 23:07:30 +0200
+Subject: mei: me: add cedar fork device ids
+
+From: Alexander Usyskin <alexander.usyskin@intel.com>
+
+commit 99397d33b763dc554d118aaa38cc5abc6ce985de upstream.
+
+Add Cedar Fork (CDF) device ids, those belongs to the cannon point family.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
+Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
+Link: https://lore.kernel.org/r/20200324210730.17672-1-tomas.winkler@intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/mei/hw-me-regs.h |    2 ++
+ drivers/misc/mei/pci-me.c     |    2 ++
+ 2 files changed, 4 insertions(+)
+
+--- a/drivers/misc/mei/hw-me-regs.h
++++ b/drivers/misc/mei/hw-me-regs.h
+@@ -147,6 +147,8 @@
+ #define MEI_DEV_ID_CMP_H      0x06e0  /* Comet Lake H */
+ #define MEI_DEV_ID_CMP_H_3    0x06e4  /* Comet Lake H 3 (iTouch) */
++#define MEI_DEV_ID_CDF        0x18D3  /* Cedar Fork */
++
+ #define MEI_DEV_ID_ICP_LP     0x34E0  /* Ice Lake Point LP */
+ #define MEI_DEV_ID_TGP_LP     0xA0E0  /* Tiger Lake Point LP */
+--- a/drivers/misc/mei/pci-me.c
++++ b/drivers/misc/mei/pci-me.c
+@@ -118,6 +118,8 @@ static const struct pci_device_id mei_me
+       {MEI_PCI_DEVICE(MEI_DEV_ID_MCC, MEI_ME_PCH12_CFG)},
+       {MEI_PCI_DEVICE(MEI_DEV_ID_MCC_4, MEI_ME_PCH8_CFG)},
++      {MEI_PCI_DEVICE(MEI_DEV_ID_CDF, MEI_ME_PCH8_CFG)},
++
+       /* required last entry */
+       {0, }
+ };
diff --git a/queue-4.19/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch b/queue-4.19/misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch
new file mode 100644 (file)
index 0000000..9b50f98
--- /dev/null
@@ -0,0 +1,109 @@
+From b2ba9225e0313b1de631a44b7b48c109032bffec Mon Sep 17 00:00:00 2001
+From: Kishon Vijay Abraham I <kishon@ti.com>
+Date: Tue, 17 Mar 2020 15:31:54 +0530
+Subject: misc: pci_endpoint_test: Avoid using module parameter to determine irqtype
+
+From: Kishon Vijay Abraham I <kishon@ti.com>
+
+commit b2ba9225e0313b1de631a44b7b48c109032bffec upstream.
+
+commit e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands")
+uses module parameter 'irqtype' in pci_endpoint_test_set_irq()
+to check if IRQ vectors of a particular type (MSI or MSI-X or
+LEGACY) is already allocated. However with multi-function devices,
+'irqtype' will not correctly reflect the IRQ type of the PCI device.
+
+Fix it here by adding 'irqtype' for each PCI device to show the
+IRQ type of a particular PCI device.
+
+Fixes: e03327122e2c ("pci_endpoint_test: Add 2 ioctl commands")
+Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Cc: stable@vger.kernel.org # v4.19+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/pci_endpoint_test.c |   12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/drivers/misc/pci_endpoint_test.c
++++ b/drivers/misc/pci_endpoint_test.c
+@@ -104,6 +104,7 @@ struct pci_endpoint_test {
+       struct completion irq_raised;
+       int             last_irq;
+       int             num_irqs;
++      int             irq_type;
+       /* mutex to protect the ioctls */
+       struct mutex    mutex;
+       struct miscdevice miscdev;
+@@ -163,6 +164,7 @@ static void pci_endpoint_test_free_irq_v
+       struct pci_dev *pdev = test->pdev;
+       pci_free_irq_vectors(pdev);
++      test->irq_type = IRQ_TYPE_UNDEFINED;
+ }
+ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test,
+@@ -197,6 +199,8 @@ static bool pci_endpoint_test_alloc_irq_
+               irq = 0;
+               res = false;
+       }
++
++      test->irq_type = type;
+       test->num_irqs = irq;
+       return res;
+@@ -336,6 +340,7 @@ static bool pci_endpoint_test_copy(struc
+       dma_addr_t orig_dst_phys_addr;
+       size_t offset;
+       size_t alignment = test->alignment;
++      int irq_type = test->irq_type;
+       u32 src_crc32;
+       u32 dst_crc32;
+@@ -432,6 +437,7 @@ static bool pci_endpoint_test_write(stru
+       dma_addr_t orig_phys_addr;
+       size_t offset;
+       size_t alignment = test->alignment;
++      int irq_type = test->irq_type;
+       u32 crc32;
+       if (size > SIZE_MAX - alignment)
+@@ -500,6 +506,7 @@ static bool pci_endpoint_test_read(struc
+       dma_addr_t orig_phys_addr;
+       size_t offset;
+       size_t alignment = test->alignment;
++      int irq_type = test->irq_type;
+       u32 crc32;
+       if (size > SIZE_MAX - alignment)
+@@ -561,7 +568,7 @@ static bool pci_endpoint_test_set_irq(st
+               return false;
+       }
+-      if (irq_type == req_irq_type)
++      if (test->irq_type == req_irq_type)
+               return true;
+       pci_endpoint_test_release_irq(test);
+@@ -573,12 +580,10 @@ static bool pci_endpoint_test_set_irq(st
+       if (!pci_endpoint_test_request_irq(test))
+               goto err;
+-      irq_type = req_irq_type;
+       return true;
+ err:
+       pci_endpoint_test_free_irq_vectors(test);
+-      irq_type = IRQ_TYPE_UNDEFINED;
+       return false;
+ }
+@@ -655,6 +660,7 @@ static int pci_endpoint_test_probe(struc
+       test->test_reg_bar = 0;
+       test->alignment = 0;
+       test->pdev = pdev;
++      test->irq_type = IRQ_TYPE_UNDEFINED;
+       if (no_msi)
+               irq_type = IRQ_TYPE_LEGACY;
diff --git a/queue-4.19/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch b/queue-4.19/misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch
new file mode 100644 (file)
index 0000000..713d892
--- /dev/null
@@ -0,0 +1,38 @@
+From 6b443e5c80b67a7b8a85b33d052d655ef9064e90 Mon Sep 17 00:00:00 2001
+From: Kishon Vijay Abraham I <kishon@ti.com>
+Date: Tue, 17 Mar 2020 15:31:57 +0530
+Subject: misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices
+
+From: Kishon Vijay Abraham I <kishon@ti.com>
+
+commit 6b443e5c80b67a7b8a85b33d052d655ef9064e90 upstream.
+
+Adding more than 10 pci-endpoint-test devices results in
+"kobject_add_internal failed for pci-endpoint-test.1 with -EEXIST, don't
+try to register things with the same name in the same directory". This
+is because commit 2c156ac71c6b ("misc: Add host side PCI driver for PCI
+test function device") limited the length of the "name" to 20 characters.
+Change the length of the name to 24 in order to support upto 10000
+pci-endpoint-test devices.
+
+Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device")
+Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Cc: stable@vger.kernel.org # v4.14+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/pci_endpoint_test.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/misc/pci_endpoint_test.c
++++ b/drivers/misc/pci_endpoint_test.c
+@@ -636,7 +636,7 @@ static int pci_endpoint_test_probe(struc
+ {
+       int err;
+       int id;
+-      char name[20];
++      char name[24];
+       enum pci_barno bar;
+       void __iomem *base;
+       struct device *dev = &pdev->dev;
diff --git a/queue-4.19/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch b/queue-4.19/misc-rtsx-set-correct-pcr_ops-for-rts522a.patch
new file mode 100644 (file)
index 0000000..1bbc56b
--- /dev/null
@@ -0,0 +1,32 @@
+From 10cea23b6aae15e8324f4101d785687f2c514fe5 Mon Sep 17 00:00:00 2001
+From: YueHaibing <yuehaibing@huawei.com>
+Date: Thu, 26 Mar 2020 11:26:18 +0800
+Subject: misc: rtsx: set correct pcr_ops for rts522A
+
+From: YueHaibing <yuehaibing@huawei.com>
+
+commit 10cea23b6aae15e8324f4101d785687f2c514fe5 upstream.
+
+rts522a should use rts522a_pcr_ops, which is
+diffrent with rts5227 in phy/hw init setting.
+
+Fixes: ce6a5acc9387 ("mfd: rtsx: Add support for rts522A")
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20200326032618.20472-1-yuehaibing@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/misc/cardreader/rts5227.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/misc/cardreader/rts5227.c
++++ b/drivers/misc/cardreader/rts5227.c
+@@ -369,6 +369,7 @@ static const struct pcr_ops rts522a_pcr_
+ void rts522a_init_params(struct rtsx_pcr *pcr)
+ {
+       rts5227_init_params(pcr);
++      pcr->ops = &rts522a_pcr_ops;
+       pcr->tx_initial_phase = SET_CLOCK_PHASE(20, 20, 11);
+       pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3;
+ }
diff --git a/queue-4.19/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch b/queue-4.19/power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch
new file mode 100644 (file)
index 0000000..980a198
--- /dev/null
@@ -0,0 +1,178 @@
+From 9c80662a74cd2a5d1113f5c69d027face963a556 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sun, 23 Feb 2020 16:32:08 +0100
+Subject: power: supply: axp288_charger: Add special handling for HP Pavilion x2 10
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 9c80662a74cd2a5d1113f5c69d027face963a556 upstream.
+
+Some HP Pavilion x2 10 models use an AXP288 for charging and fuel-gauge.
+We use a native power_supply / PMIC driver in this case, because on most
+models with an AXP288 the ACPI AC / Battery code is either completely
+missing or relies on custom / proprietary ACPI OpRegions which Linux
+does not implement.
+
+The native drivers mostly work fine, but there are 2 problems:
+
+1. These model uses a Type-C connector for charging which the AXP288 does
+not support. As long as a Type-A charger (which uses the USB data pins for
+charger type detection) is used everything is fine. But if a Type-C
+charger is used (such as the charger shipped with the device) then the
+charger is not recognized.
+
+So we end up slowly discharging the device even though a charger is
+connected, because we are limiting the current from the charger to 500mA.
+To make things worse this happens with the device's official charger.
+
+Looking at the ACPI tables HP has "solved" the problem of the AXP288 not
+being able to recognize Type-C chargers by simply always programming the
+input-current-limit at 3000mA and relying on a Vhold setting of 4.7V
+(normally 4.4V) to limit the current intake if the charger cannot handle
+this.
+
+2. If no charger is connected when the machine boots then it boots with the
+vbus-path disabled. On other devices this is done when a 5V boost converter
+is active to avoid the PMIC trying to charge from the 5V boost output.
+This is done when an OTG host cable is inserted and the ID pin on the
+micro-B receptacle is pulled low, the ID pin has an ACPI event handler
+associated with it which re-enables the vbus-path when the ID pin is pulled
+high when the OTG cable is removed. The Type-C connector has no ID pin,
+there is no ID pin handler and there appears to be no 5V boost converter,
+so we end up not charging because the vbus-path is disabled, until we
+unplug the charger which automatically clears the vbus-path disable bit and
+then on the second plug-in of the adapter we start charging.
+
+The HP Pavilion x2 10 models with an AXP288 do have mostly working ACPI
+AC / Battery code which does not rely on custom / proprietary ACPI
+OpRegions. So one possible solution would be to blacklist the AXP288
+native power_supply drivers and add the HP Pavilion x2 10 with AXP288
+DMI ids to the list of devices which should use the ACPI AC / Battery
+code even though they have an AXP288 PMIC. This would require changes to
+4 files: drivers/acpi/ac.c, drivers/power/supply/axp288_charger.c,
+drivers/acpi/battery.c and drivers/power/supply/axp288_fuel_gauge.c.
+
+Beside needing adding the same DMI matches to 4 different files, this
+approach also triggers problem 2. from above, but then when suspended,
+during suspend the machine will not wakeup because the vbus path is
+disabled by the AML code when not charging, so the Vbus low-to-high
+IRQ is not triggered, the CPU never wakes up and the device does not
+charge even though the user likely things it is charging, esp. since
+the charge status LED is directly coupled to an adapter being plugged
+in and does not reflect actual charging.
+
+This could be worked by enabling vbus-path explicitly from say the
+axp288_charger driver's suspend handler.
+
+So neither situation is ideal, in both cased we need to explicitly enable
+the vbus-path to work around different variants of problem 2 above, this
+requires a quirk in the axp288_charger code.
+
+If we go the route of using the ACPI AC / Battery drivers then we need
+modifications to 3 other drivers; and we need to partially disable the
+axp288_charger code, while at the same time keeping it around to enable
+vbus-path on suspend.
+
+OTOH we can copy the hardcoding of 3A input-current-limit (we never touch
+Vhold, so that would stay at 4.7V) to the axp288_charger code, which needs
+changes regardless, then we concentrate all special handling of this
+interesting device model in the axp288_charger code. That is what this
+commit does.
+
+Cc: stable@vger.kernel.org
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1791098
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/power/supply/axp288_charger.c |   57 +++++++++++++++++++++++++++++++++-
+ 1 file changed, 56 insertions(+), 1 deletion(-)
+
+--- a/drivers/power/supply/axp288_charger.c
++++ b/drivers/power/supply/axp288_charger.c
+@@ -28,6 +28,7 @@
+ #include <linux/property.h>
+ #include <linux/mfd/axp20x.h>
+ #include <linux/extcon.h>
++#include <linux/dmi.h>
+ #define PS_STAT_VBUS_TRIGGER          (1 << 0)
+ #define PS_STAT_BAT_CHRG_DIR          (1 << 2)
+@@ -552,6 +553,49 @@ out:
+       return IRQ_HANDLED;
+ }
++/*
++ * The HP Pavilion x2 10 series comes in a number of variants:
++ * Bay Trail SoC    + AXP288 PMIC, DMI_BOARD_NAME: "815D"
++ * Cherry Trail SoC + AXP288 PMIC, DMI_BOARD_NAME: "813E"
++ * Cherry Trail SoC + TI PMIC,     DMI_BOARD_NAME: "827C" or "82F4"
++ *
++ * The variants with the AXP288 PMIC are all kinds of special:
++ *
++ * 1. All variants use a Type-C connector which the AXP288 does not support, so
++ * when using a Type-C charger it is not recognized. Unlike most AXP288 devices,
++ * this model actually has mostly working ACPI AC / Battery code, the ACPI code
++ * "solves" this by simply setting the input_current_limit to 3A.
++ * There are still some issues with the ACPI code, so we use this native driver,
++ * and to solve the charging not working (500mA is not enough) issue we hardcode
++ * the 3A input_current_limit like the ACPI code does.
++ *
++ * 2. If no charger is connected the machine boots with the vbus-path disabled.
++ * Normally this is done when a 5V boost converter is active to avoid the PMIC
++ * trying to charge from the 5V boost converter's output. This is done when
++ * an OTG host cable is inserted and the ID pin on the micro-B receptacle is
++ * pulled low and the ID pin has an ACPI event handler associated with it
++ * which re-enables the vbus-path when the ID pin is pulled high when the
++ * OTG host cable is removed. The Type-C connector has no ID pin, there is
++ * no ID pin handler and there appears to be no 5V boost converter, so we
++ * end up not charging because the vbus-path is disabled, until we unplug
++ * the charger which automatically clears the vbus-path disable bit and then
++ * on the second plug-in of the adapter we start charging. To solve the not
++ * charging on first charger plugin we unconditionally enable the vbus-path at
++ * probe on this model, which is safe since there is no 5V boost converter.
++ */
++static const struct dmi_system_id axp288_hp_x2_dmi_ids[] = {
++      {
++              /*
++               * Bay Trail model has "Hewlett-Packard" as sys_vendor, Cherry
++               * Trail model has "HP", so we only match on product_name.
++               */
++              .matches = {
++                      DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion x2 Detachable"),
++              },
++      },
++      {} /* Terminating entry */
++};
++
+ static void axp288_charger_extcon_evt_worker(struct work_struct *work)
+ {
+       struct axp288_chrg_info *info =
+@@ -575,7 +619,11 @@ static void axp288_charger_extcon_evt_wo
+       }
+       /* Determine cable/charger type */
+-      if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) {
++      if (dmi_check_system(axp288_hp_x2_dmi_ids)) {
++              /* See comment above axp288_hp_x2_dmi_ids declaration */
++              dev_dbg(&info->pdev->dev, "HP X2 with Type-C, setting inlmt to 3A\n");
++              current_limit = 3000000;
++      } else if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) {
+               dev_dbg(&info->pdev->dev, "USB SDP charger is connected\n");
+               current_limit = 500000;
+       } else if (extcon_get_state(edev, EXTCON_CHG_USB_CDP) > 0) {
+@@ -692,6 +740,13 @@ static int charger_init_hw_regs(struct a
+               return ret;
+       }
++      if (dmi_check_system(axp288_hp_x2_dmi_ids)) {
++              /* See comment above axp288_hp_x2_dmi_ids declaration */
++              ret = axp288_charger_vbus_path_select(info, true);
++              if (ret < 0)
++                      return ret;
++      }
++
+       /* Read current charge voltage and current limit */
+       ret = regmap_read(info->regmap, AXP20X_CHRG_CTRL1, &val);
+       if (ret < 0) {
index a997f34ecf62b62df2d93fd7245d83d90c1d6710..71648b0aa466b8de0588a448518befd4cf452d75 100644 (file)
@@ -11,3 +11,10 @@ tools-power-turbostat-fix-gcc-build-warnings.patch
 tools-power-turbostat-fix-missing-sys_lpi-counter-on.patch
 drm-etnaviv-replace-mmu-flush-marker-with-flush-sequence.patch
 media-rc-ir-signal-for-panasonic-air-conditioner-too-long.patch
+misc-rtsx-set-correct-pcr_ops-for-rts522a.patch
+misc-pci_endpoint_test-fix-to-support-10-pci-endpoint-test-devices.patch
+misc-pci_endpoint_test-avoid-using-module-parameter-to-determine-irqtype.patch
+coresight-do-not-use-the-bit-macro-in-the-uapi-header.patch
+mei-me-add-cedar-fork-device-ids.patch
+extcon-axp288-add-wakeup-support.patch
+power-supply-axp288_charger-add-special-handling-for-hp-pavilion-x2-10.patch