Skip to content

Commit c324345

Browse files
khfengdtor
authored andcommitted
Revert "Input: elantech - enable SMBus on new (2018+) systems"
This reverts commit 883a2a8. 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 <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 363c538 commit c324345

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

drivers/input/mouse/elantech.c

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,31 +1827,6 @@ static int elantech_create_smbus(struct psmouse *psmouse,
18271827
leave_breadcrumbs);
18281828
}
18291829

1830-
static 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-
18551830
/**
18561831
* elantech_setup_smbus - called once the PS/2 devices are enumerated
18571832
* and decides to instantiate a SMBus InterTouch device.
@@ -1871,7 +1846,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
18711846
* i2c_blacklist_pnp_ids.
18721847
* Old ICs are up to the user to decide.
18731848
*/
1874-
if (!elantech_use_host_notify(psmouse, info) ||
1849+
if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||
18751850
psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
18761851
return -ENXIO;
18771852
}
@@ -1891,6 +1866,34 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
18911866
return 0;
18921867
}
18931868

1869+
static 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+
18941897
int elantech_init_smbus(struct psmouse *psmouse)
18951898
{
18961899
struct elantech_device_info info;

0 commit comments

Comments
 (0)