summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai-Heng Feng <kai.heng.feng@canonical.com>2019-10-15 20:37:37 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-10-15 20:42:47 -0400
commitc324345ce89c3cc50226372960619c7ee940f616 (patch)
treecae2bf8cc49f5396b897c0b94dc47dfea29a5cca
parent363c53875aef8fce69d4a2d0873919ccc7d9e2ad (diff)
Revert "Input: elantech - enable SMBus on new (2018+) systems"
This reverts commit 883a2a80f79ca5c0c105605fafabd1f3df99b34c. Apparently use dmi_get_bios_year() as manufacturing date isn't accurate and this breaks older laptops with new BIOS update. So let's revert this patch. There are still new HP laptops still need to use SMBus to support all features, but it'll be enabled via a whitelist. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191001070845.9720-1-kai.heng.feng@canonical.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/mouse/elantech.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 04fe43440a3c..2d8434b7b623 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1827,31 +1827,6 @@ static int elantech_create_smbus(struct psmouse *psmouse,
1827 leave_breadcrumbs); 1827 leave_breadcrumbs);
1828} 1828}
1829 1829
1830static bool elantech_use_host_notify(struct psmouse *psmouse,
1831 struct elantech_device_info *info)
1832{
1833 if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
1834 return true;
1835
1836 switch (info->bus) {
1837 case ETP_BUS_PS2_ONLY:
1838 /* expected case */
1839 break;
1840 case ETP_BUS_SMB_HST_NTFY_ONLY:
1841 case ETP_BUS_PS2_SMB_HST_NTFY:
1842 /* SMbus implementation is stable since 2018 */
1843 if (dmi_get_bios_year() >= 2018)
1844 return true;
1845 /* fall through */
1846 default:
1847 psmouse_dbg(psmouse,
1848 "Ignoring SMBus bus provider %d\n", info->bus);
1849 break;
1850 }
1851
1852 return false;
1853}
1854
1855/** 1830/**
1856 * elantech_setup_smbus - called once the PS/2 devices are enumerated 1831 * elantech_setup_smbus - called once the PS/2 devices are enumerated
1857 * and decides to instantiate a SMBus InterTouch device. 1832 * and decides to instantiate a SMBus InterTouch device.
@@ -1871,7 +1846,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
1871 * i2c_blacklist_pnp_ids. 1846 * i2c_blacklist_pnp_ids.
1872 * Old ICs are up to the user to decide. 1847 * Old ICs are up to the user to decide.
1873 */ 1848 */
1874 if (!elantech_use_host_notify(psmouse, info) || 1849 if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||
1875 psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids)) 1850 psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
1876 return -ENXIO; 1851 return -ENXIO;
1877 } 1852 }
@@ -1891,6 +1866,34 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
1891 return 0; 1866 return 0;
1892} 1867}
1893 1868
1869static bool elantech_use_host_notify(struct psmouse *psmouse,
1870 struct elantech_device_info *info)
1871{
1872 if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
1873 return true;
1874
1875 switch (info->bus) {
1876 case ETP_BUS_PS2_ONLY:
1877 /* expected case */
1878 break;
1879 case ETP_BUS_SMB_ALERT_ONLY:
1880 /* fall-through */
1881 case ETP_BUS_PS2_SMB_ALERT:
1882 psmouse_dbg(psmouse, "Ignoring SMBus provider through alert protocol.\n");
1883 break;
1884 case ETP_BUS_SMB_HST_NTFY_ONLY:
1885 /* fall-through */
1886 case ETP_BUS_PS2_SMB_HST_NTFY:
1887 return true;
1888 default:
1889 psmouse_dbg(psmouse,
1890 "Ignoring SMBus bus provider %d.\n",
1891 info->bus);
1892 }
1893
1894 return false;
1895}
1896
1894int elantech_init_smbus(struct psmouse *psmouse) 1897int elantech_init_smbus(struct psmouse *psmouse)
1895{ 1898{
1896 struct elantech_device_info info; 1899 struct elantech_device_info info;