mfd: Add support for Asus Transformer embedded controller
Subsystems (6)
v13 cover mfd: Add support for Asus Transformer embedded controller
Add support for embedded controller used in Asus Transformers for managing power and input functions.
---
Changes in v2:
- converted sysfs debug exports into debugfs
- added kernel-doc comments for exposed functions
- fixed minor typos and inconsistencies
Changes in v3:
- dropped DockRAM commits (both schema and driver)
- integrated DockRAM functionality directly into the controller driver
- EC schema moved to embedded controllers folder
- removed all cell descriptions from the schema
- removed all compatibles from the cell drivers
- adjusted naming conventions to better align with the ASUS Transformers
- defined EC variant sets to provide coverage for all known devices
Changes in v4:
- grouped known programming models of EC chronologically (both schema and driver)
- call debugfs init only if CONFIG_DEBUG_FS is enabled
Changes in v5:
- added asus,tf600t-ec-dock compatible to schema
- rebased on top of v7.0
- kzalloc > kzalloc_obj in keys and kbc
Changes in v6:
- removed asus_ec_handle_smi casting
- asus_dockram_access_ctl > asus_ec_get_ctl in control_reg_*
- fixed battery Kconfig description
Changes in v7:
- added status check of devm_kasprintf where missing
- devm_asus_ec_register_notifier dropped, added .remove where it was used
- removed cell_to_ec, asus_dockram_read, asus_dockram_write, asus_ec_* public API asus_ec_i2c_command, devm_asus_ec_register_notifier, asus_ec_read, asus_ec_write
- renamed asusec_info > asusec_core
- ec-kbc: added packed size check
ret > error
improved key remap logic
- ec-keys: improve formatting and comments
ret > error
switched to dev_err_probe
- ec-leds: reworked to register both leds via loop
- ec-mfd: adjusted Kconfig description
fixed smbus operation sizes
fixed saving of EC fw model
adjusted IRQ flags
converted to use definer for set cell composition
added factory mode states enum and handling
defined some "magic" values
self > client, info > ec, ecreq > ecreq_gpio, priv > ddata asus_ec_chip_data data > asus_ec_chip_info info
ec_data > ec_buf, ctl_data > ctl_buf
added and improved comments, added structure descriptions asus_ec_magic_debug > asus_ec_susb_on_status
removed all dev_dbg and most of dev_info
pronts with model, fw behavior, factory and susb state preserved switched to MFD_CELL_* macros
removed debugfs
- ec-battery: swithced to BIT macro
lock usage moved to asus_ec_battery_get_value
in asus_ec_battery_poll_work fixed possible rescheduling fail in asus_ec_battery_poll_work fixed missing not charging
- ec-charger: POWER_SUPPLY_PROP_MODEL_NAME set as the first check
Changes in v8:
- added MODULE_ALIAS
- renamed DOCKRAM_* to ASUSEC_*
- ec-keys: input_handler moved into private structure
- ec-leds: added brightness_get
- ec-mdf: fixed i2c_smbus_* return checks () improved model storing
- ec-batt: added status check of devm_kasprintf
Changes in v9:
- fixed i2c_smbus_read_i2c_block_data return check
- blocking_notifier_chain_register moved before serio registration
- adjusted get_unaligned_le16 bounds check
- unsigned long long > u64
- iterator vars made scoped
- removed "magic" values from ec-mfd
- simplified logging, detect split into detect and init
- improved error logs formatting
- adjusted handler in media keys to connect strictly to dock keyboard
Changes in v10:
- ec-kbc: fixed possible out of buffer reads
- ec-kbc: set notifier_call before blocking_notifier_chain_register
- ec-keys: dropped input_unregister_device which should be handled by devm_input_allocate_device
Changes in v11:
- applied changes from Florian Krischer (read_size parameterized and fix keyboard response framing)
- ec-kbc: switch notifier and serio register calls
- ec-keys: used WRITE_ONCE()/READ_ONCE() for priv->special_key_pressed
Changes in v12:
- removed unused includes
- fixed kernel-doc warns
- added check if dockram client and data are not NULL
- replaced handler in media keys with Dmitry's implementation
- calculate battery time props with unsigned value
Changes in v13:
- switch to PLATFORM_DEVID_AUTO
- move notifier registration into input device open()/close()
- remove code check in asus_ec_keys_setup_keymap()
- register notifier before serio ports
- wrap mfd and leds at 100 chars
- moved retry in asus_ec_reset() into loop scope
- removed asus_ec_leds_data from leds
- removed platform_set_drvdata form leds probe
- iterator remains i becuase name led is already taken by struct asus_ec_led pointer
- unfolded driver struct fill in led platform_driver
- minor formatting changes in serio and keyboard drivers
---
Michał Mirosław (6):
mfd: Add driver for ASUS Transformer embedded controller
input: serio: Add driver for ASUS Transformer dock keyboard and
touchpad
input: keyboard: Add driver for ASUS Transformer dock multimedia keys
leds: Add driver for ASUS Transformer LEDs
power: supply: Add driver for ASUS Transformer battery
power: supply: Add charger driver for Asus Transformers
Svyatoslav Ryhel (1):
dt-bindings: embedded-controller: document ASUS Transformer EC
.../asus,tf201-ec-pad.yaml | 119 ++++ drivers/input/keyboard/Kconfig | 10 + drivers/input/keyboard/Makefile | 1 + .../input/keyboard/asus-transformer-ec-keys.c | 216 +++++++ drivers/input/serio/Kconfig | 15 + drivers/input/serio/Makefile | 1 + drivers/input/serio/asus-transformer-ec-kbc.c | 258 ++++++++ drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-asus-transformer-ec.c | 114 ++++ drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/asus-transformer-ec.c | 551 ++++++++++++++++++ drivers/power/supply/Kconfig | 22 + drivers/power/supply/Makefile | 2 + .../supply/asus-transformer-ec-battery.c | 289 +++++++++ .../supply/asus-transformer-ec-charger.c | 208 +++++++ include/linux/mfd/asus-transformer-ec.h | 100 ++++ 18 files changed, 1935 insertions(+) create mode 100644 Documentation/devicetree/bindings/embedded-controller/asus,tf201-ec-pad.yaml create mode 100644 drivers/input/keyboard/asus-transformer-ec-keys.c create mode 100644 drivers/input/serio/asus-transformer-ec-kbc.c create mode 100644 drivers/leds/leds-asus-transformer-ec.c create mode 100644 drivers/mfd/asus-transformer-ec.c create mode 100644 drivers/power/supply/asus-transformer-ec-battery.c create mode 100644 drivers/power/supply/asus-transformer-ec-charger.c create mode 100644 include/linux/mfd/asus-transformer-ec.h
Signature · 1 line
2.53.0
PATCH v13 1/7 dt-bindings: embedded-controller: document ASUS Transformer EC
Document embedded controller used in ASUS Transformer device series.
--- .../asus,tf201-ec-pad.yaml | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 Documentation/devicetree/bindings/embedded-controller/asus,tf201-ec-pad.yaml
Documentation/devicetree/bindings/embedded-controller/asus,tf201-ec-pad.yaml new file +119 -0
@@ -0,0 +1,119 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/embedded-controller/asus,tf201-ec-pad.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASUS Transformer's Embedded Controller + +description: + Several Nuvoton based Embedded Controllers attached to an I2C bus, + running a custom ASUS firmware, specific to the ASUS Transformer + device series. + +maintainers: + - Svyatoslav Ryhel <[email protected]> + +properties: + compatible: + description: + The 'pad' suffix is used for the controller within the tablet, while + the 'dock' suffix refers to the controller in the mobile dock keyboard. + oneOf: + - enum: + - asus,sl101-ec-dock + - asus,tf101-ec-dock + - asus,tf201-ec-pad + - asus,tf600t-ec-dock + - asus,tf600t-ec-pad + + - items: + - enum: + - asus,tf101g-ec-dock + - asus,tf201-ec-dock + - asus,tf300t-ec-dock + - asus,tf300tg-ec-dock + - asus,tf300tl-ec-dock + - asus,tf700t-ec-dock + - const: asus,tf101-ec-dock + + - items: + - enum: + - asus,tf300t-ec-pad + - asus,tf300tg-ec-pad + - asus,tf300tl-ec-pad + - asus,tf700t-ec-pad + - const: asus,tf201-ec-pad + + - items: + - enum: + - asus,tf701t-ec-dock + - const: asus,tf600t-ec-dock + + - items: + - enum: + - asus,p1801-t-ec-pad + - asus,tf701t-ec-pad + - const: asus,tf600t-ec-pad + + reg: + description: + The ASUS Transformer EC has a main I2C address and an associated + DockRAM device, which provides power-related functions for the + embedded controller. Both addresses are required for operation. + minItems: 2 + + reg-names: + items: + - const: ec + - const: dockram + + interrupts: + maxItems: 1 + + request-gpios: + maxItems: 1 + +required: + - compatible + - reg + - reg-names + +allOf: + - $ref: /schemas/power/supply/power-supply.yaml + - if: + properties: + compatible: + not: + contains: + const: asus,tf600t-ec-dock + then: + required: + - interrupts + - request-gpios + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + embedded-controller@19 { + compatible = "asus,tf201-ec-dock", "asus,tf101-ec-dock"; + reg = <0x19>, <0x1b>; + reg-names = "ec", "dockram"; + + interrupt-parent = <&gpio>; + interrupts = <151 IRQ_TYPE_LEVEL_LOW>; + + request-gpios = <&gpio 134 GPIO_ACTIVE_LOW>; + + monitored-battery = <&dock_battery>; + }; + }; +...
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 1/7] dt-bindings: embedded-controller: document ASUS Transformer EC
Sashiko has reviewed this patch and found no issues.
Quoted 3 lines
Document embedded controller used in ASUS Transformer device series.
Signed-off-by Svyatoslav Ryhel <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v13 2/7 mfd: Add driver for ASUS Transformer embedded controller
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
Support Nuvoton NPCE795-based ECs as used in Asus Transformer TF201, TF300T, TF300TG, TF300TL and TF700T pad and dock, as well as TF101 dock and TF600T, P1801-T and TF701T pad. This is a glue driver handling detection and common operations for EC's functions.
--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/asus-transformer-ec.c | 551 ++++++++++++++++++++++++ include/linux/mfd/asus-transformer-ec.h | 100 +++++ 4 files changed, 668 insertions(+) create mode 100644 drivers/mfd/asus-transformer-ec.c create mode 100644 include/linux/mfd/asus-transformer-ec.h
drivers/mfd/Kconfig +16 -0
@@ -137,6 +137,22 @@ config MFD_AAT2870_CORE additional drivers must be enabled in order to use the functionality of the device. +config MFD_ASUS_TRANSFORMER_EC + tristate "ASUS Transformer's embedded controller" + select MFD_CORE + depends on I2C && OF + help + Select this to enable support for the Embedded Controller (EC) + found in Tegra based ASUS Transformer series tablets and mobile + docks. + + This driver handles the core I2C communication with the EC and + provides support for its sub-devices, including battery management, + charger detection, LEDs and keyboard dock functions support. + + This driver can also be built as a module. If so, the module + will be called asus-transformer-ec. + config MFD_AT91_USART tristate "AT91 USART Driver" select MFD_CORE
drivers/mfd/Makefile +1 -0
@@ -10,6 +10,7 @@ obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o obj-$(CONFIG_MFD_88PM886_PMIC) += 88pm886.o obj-$(CONFIG_MFD_ACT8945A) += act8945a.o obj-$(CONFIG_MFD_SM501) += sm501.o +obj-$(CONFIG_MFD_ASUS_TRANSFORMER_EC) += asus-transformer-ec.o obj-$(CONFIG_ARCH_BCM2835) += bcm2835-pm.o obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o obj-$(CONFIG_MFD_BD9571MWV) += bd9571mwv.o
drivers/mfd/asus-transformer-ec.c new file +551 -0
551 lines not on this page · raw message
include/linux/mfd/asus-transformer-ec.h new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 2/7] mfd: Add driver for ASUS Transformer embedded controller
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider: - [High] mfd: asus-transformer-ec: UAF on dockram_ec_data in devm_asus_dockram_get() - [Medium] mfd…
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:
- [High] mfd: asus-transformer-ec: UAF on dockram_ec_data in devm_asus_dockram_get()
- [Medium] mfd: asus-transformer-ec: ec_buf clobbered in asus_ec_interrupt() on SMI
- [Medium] mfd: asus-transformer-ec: fixed retry count in asus_ec_clear_buffer()
- [Low] mfd: asus-transformer-ec: inverted comment in asus_ec_clear_buffer()
- [Low] mfd: asus-transformer-ec: sibling input state in asusec_core and mfd naming --
commit 127ab1fbe238a806a6be88edfad37b1c227e1824
Author: Michał Mirosław <[email protected]>
mfd: Add driver for ASUS Transformer embedded controller
This commit adds a core MFD driver for the Nuvoton NPCE795-based embedded controller found in ASUS Transformer tablets and docks, handling I2C communication, detection, and sub-device registration.
Quoted 6 lines
drivers/mfd/asus-transformer-ec.c new file +0
-0@@ -0,0 +1,551 @@
[ ... ]
Quoted 8 lines
drivers/mfd/asus-transformer-ec.c new file +8
-0+#define ASUSEC_ACCESS_TIMEOUT 300 +#define ASUSEC_DOCKRAM_OFFSET 2 +#define ASUSEC_ECREQ_DELAY 50 +#define ASUSEC_ECREQ_TIMEOUT 200 +#define ASUSEC_RESET 0 +#define ASUSEC_RETRY_MAX 3 +#define ASUSEC_RSP_BUFFER_SIZE (ASUSEC_ENTRIES / ASUSEC_ENTRY_SIZE) +#define ASUSEC_SL101_ENTRY_SIZE 8
[ ... ]
Quoted 10 lines
drivers/mfd/asus-transformer-ec.c new file +10
-0+static void asus_ec_clear_buffer (struct asus_ec_data *ddata) +{ +int ret, retry =ASUSEC_RSP_BUFFER_SIZE ; + +/* +* Read the buffer till we get valid data by checking ASUSEC_OBF_MASK +* of the status byte or till we reach end of the 256 byte buffer. +*/ +while (retry--) { + ret = i2c_smbus_read_i2c_block_data(ddata->client, ASUSEC_READ_BUF,
drivers/mfd/asus-transformer-ec.c line 255
Quoted 10 lines
drivers/mfd/asus-transformer-ec.c new file +10
-0+ ddata->info->read_size, ddata->ec_buf); +if (ret < ddata->info->read_size) +continue ; + +if (ddata->ec_buf[ASUSEC_IRQ_STATUS ] &ASUSEC_OBF_MASK ) +continue ; + +break ; + } +}
[Severity: Medium]
In asus_ec_clear_buffer(), retry is initialized to ASUSEC_RSP_BUFFER_SIZE, which divides ASUSEC_ENTRIES (256) by ASUSEC_ENTRY_SIZE (32) for 8 iterations.
However, each iteration reads ddata->info->read_size bytes. On the SL101 dock variant (asus_ec_sl101_dock_data), read_size is ASUSEC_SL101_ENTRY_SIZE (8), so 8 iterations only drain at most 64 bytes instead of the full 256-byte EC buffer.
Should the retry count be computed from ddata->info->read_size instead of the fixed ASUSEC_ENTRY_SIZE?
[Severity: Low]
Also in asus_ec_clear_buffer(), the comment states "Read the buffer till we get valid data by checking ASUSEC_OBF_MASK", whereas the loop actually continues while ASUSEC_OBF_MASK is set (valid data present) and breaks once the buffer is empty. Should the comment say it reads until the buffer no longer has valid data?
[ ... ]
Quoted 29 lines
drivers/mfd/asus-transformer-ec.c new file +29
-0+static void asus_ec_handle_smi (struct asus_ec_data *ddata,unsigned int code) +{ +switch (code) { +case ASUSEC_SMI_HANDSHAKE : +case ASUSEC_SMI_RESET : +asus_ec_init (ddata); +break ; + } +} + +static irqreturn_t asus_ec_interrupt (int irq,void *dev_id) +{ +struct asus_ec_data *ddata = dev_id; +unsigned long notify_action; +int ret; + + ret =i2c_smbus_read_i2c_block_data (ddata->client,ASUSEC_READ_BUF , + ddata->info->read_size, ddata->ec_buf); +if (ret < ddata->info->read_size) +return IRQ_NONE ; + +/* Check status byte with ASUSEC_OBF_MASK if data is valid */ + ret = ddata->ec_buf[ASUSEC_IRQ_STATUS ] &ASUSEC_OBF_MASK ; +if (!ret) +return IRQ_NONE ; + + notify_action = ddata->ec_buf[ASUSEC_IRQ_STATUS ]; +if (notify_action &ASUSEC_SMI_MASK ) { +unsigned int code = ddata->ec_buf[ASUSEC_SMI_CODE ];
drivers/mfd/asus-transformer-ec.c line 347
Quoted 10 lines
drivers/mfd/asus-transformer-ec.c new file +10
-0+ +asus_ec_handle_smi (ddata, code); + + notify_action |= code <<8 ; + } + +blocking_notifier_call_chain (&ddata->ec.notify_list, notify_action, ddata->ec_buf); + +return IRQ_HANDLED ; +}
[Severity: Medium]
When asus_ec_interrupt() receives an SMI event with ASUSEC_SMI_HANDSHAKE or ASUSEC_SMI_RESET, it calls:
asus_ec_interrupt()
-> asus_ec_handle_smi()
-> asus_ec_init()
-> asus_ec_clear_buffer()asus_ec_clear_buffer() reads into the same shared ddata->ec_buf buffer until ASUSEC_OBF_MASK is clear, overwriting the SMI packet that triggered the interrupt before blocking_notifier_call_chain() passes ddata->ec_buf to registered listeners. In addition, asus_ec_handle_smi() ignores the return value of asus_ec_init(), so notifier callbacks still run even if reinitialization failed.
Should asus_ec_clear_buffer() use a separate buffer (or should asus_ec_interrupt() avoid passing a clobbered ddata->ec_buf and check for asus_ec_init() errors)?
Quoted 20 lines
drivers/mfd/asus-transformer-ec.c new file +20
-0+static void asus_ec_release_dockram_dev (void *client) +{ +i2c_unregister_device (client); +} + +static struct i2c_client *devm_asus_dockram_get (struct device *dev) +{ +struct i2c_client *parent =to_i2c_client (dev); +struct i2c_client *dockram; +struct dockram_ec_data *ddata; +int ret; + + dockram =i2c_new_ancillary_device (parent,"dockram" , + parent->addr +ASUSEC_DOCKRAM_OFFSET ); +if (IS_ERR (dockram)) +return dockram; + + ret =devm_add_action_or_reset (dev, asus_ec_release_dockram_dev, dockram); +if (ret) +return ERR_PTR (ret);
drivers/mfd/asus-transformer-ec.c line 378
Quoted 10 lines
drivers/mfd/asus-transformer-ec.c new file +10
-0+ + ddata =devm_kzalloc (&dockram->dev,sizeof (*ddata),GFP_KERNEL ); +if (!ddata) +return ERR_PTR (-ENOMEM ); + +i2c_set_clientdata (dockram, ddata); +mutex_init (&ddata->ctl_lock); + +return dockram; +}
[Severity: High]
As reported by Dmitry Torokhov on v11 [1], devm_asus_dockram_get() allocates ddata with devm_kzalloc(&dockram->dev, ...) and attaches it via i2c_set_clientdata(dockram, ddata) on the ancillary dummy I2C device rather than the parent device dev.
Because dockram is bound to the I2C dummy driver, unbinding dockram from the dummy driver via sysfs triggers device_unbind_cleanup(&dockram->dev), which frees &dockram->dev devres allocations and clears its driver_data to NULL while the parent MFD driver and child sub-devices remain active. Concurrent calls to asus_dockram_access_ctl() can then suffer a use-after-free on ddata->ctl_lock and ddata->ctl_buf across sleeping SMBus transfers, and subsequent calls will fail with -ENODEV.
Could ddata be allocated with devm_kzalloc(dev, ...) on the parent device instead?
Quoted 22 lines
drivers/mfd/asus-transformer-ec.c new file +22
-0+static const struct mfd_cell asus_ec_sl101_dock_mfd_devices[] = { +MFD_CELL_NAME ("asus-transformer-ec-kbc" ), +}; + +static const struct mfd_cell asus_ec_tf101_dock_mfd_devices[] = { +MFD_CELL_NAME ("asus-transformer-ec-battery" ), +MFD_CELL_NAME ("asus-transformer-ec-charger" ), +MFD_CELL_NAME ("asus-transformer-ec-led" ), +MFD_CELL_NAME ("asus-transformer-ec-kbc" ), +MFD_CELL_NAME ("asus-transformer-ec-keys" ), +}; + +static const struct mfd_cell asus_ec_tf201_pad_mfd_devices[] = { +MFD_CELL_NAME ("asus-transformer-ec-battery" ), +MFD_CELL_NAME ("asus-transformer-ec-led" ), +}; + +static const struct mfd_cell asus_ec_tf600t_pad_mfd_devices[] = { +MFD_CELL_NAME ("asus-transformer-ec-battery" ), +MFD_CELL_NAME ("asus-transformer-ec-charger" ), +MFD_CELL_NAME ("asus-transformer-ec-led" ), +};
[ ... ]
Quoted 6 lines
include/linux/mfd/asus-transformer-ec.h new file +0
-0@@ -0,0 +1,100 @@
[ ... ]
include/linux/mfd/asus-transformer-ec.h line 35
Quoted 10 lines
include/linux/mfd/asus-transformer-ec.h new file +10
-0+struct asusec_core { +const char *model; +const char *name; +struct i2c_client *dockram; +struct blocking_notifier_head notify_list; +u8 keyboard_mask; +bool ext_keys_enabled; +bool right_alt_pressed; +bool special_combo_triggered; +};
[Severity: Low]
This isn't a bug, but in struct asusec_core, the fields ext_keys_enabled, right_alt_pressed, and special_combo_triggered are unused by the core MFD driver in drivers/mfd/asus-transformer-ec.c and appear to be private input state shared between sibling sub-devices. Also, the mfd_cell arrays in drivers/mfd/asus-transformer-ec.c (such as asus_ec_sl101_dock_mfd_devices) include "mfd" in their names. Would it be cleaner to avoid exposing sibling-specific input state in the core MFD structure and drop "mfd" from the cell array names in accordance with MFD conventions?
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v13 3/7 input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
Add input driver for ASUS Transformer dock keyboard and touchpad.
Some keys in ASUS Dock report keycodes that don't make sense according to their position, this patch modifies the incoming data that is sent to serio to send proper scancodes.
--- drivers/input/serio/Kconfig | 15 + drivers/input/serio/Makefile | 1 + drivers/input/serio/asus-transformer-ec-kbc.c | 258 ++++++++++++++++++ 3 files changed, 274 insertions(+) create mode 100644 drivers/input/serio/asus-transformer-ec-kbc.c
drivers/input/serio/Kconfig +15 -0
@@ -84,6 +84,21 @@ config SERIO_RPCKBD To compile this driver as a module, choose M here: the module will be called rpckbd. +config SERIO_ASUS_TRANSFORMER_EC + tristate "Asus Transformer's Dock keyboard and touchpad controller" + depends on MFD_ASUS_TRANSFORMER_EC + help + Say Y here if you want to use the keyboard and/or touchpad on + Asus Transformed's Mobile Dock. + + For keyboard support you also need atkbd driver. + + For touchpad support you also need psmouse driver with Elantech + touchpad option enabled. + + To compile this driver as a module, choose M here: the module will + be called asus-transformer-ec-kbc. + config SERIO_AMBAKMI tristate "AMBA KMI keyboard controller" depends on ARM_AMBA
drivers/input/serio/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_SERIO_SERPORT) += serport.o obj-$(CONFIG_SERIO_RPCKBD) += rpckbd.o obj-$(CONFIG_SERIO_SA1111) += sa1111ps2.o obj-$(CONFIG_SERIO_AMBAKMI) += ambakmi.o +obj-$(CONFIG_SERIO_ASUS_TRANSFORMER_EC) += asus-transformer-ec-kbc.o obj-$(CONFIG_SERIO_Q40KBD) += q40kbd.o obj-$(CONFIG_SERIO_GSCPS2) += gscps2.o obj-$(CONFIG_HP_SDC) += hp_sdc.o
drivers/input/serio/asus-transformer-ec-kbc.c new file +258 -0
258 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 3/7] input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] input: serio: notifier order in asus_ec_kbc_probe() causes NULL deref or UAF --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] input: serio: notifier order in asus_ec_kbc_probe() causes NULL deref or UAF --
commit 8f5c105d6df4708eb2c002e7fe58ff80a2a0fb84
Author: Michał Mirosław <[email protected]>
input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
This commit adds a serio driver for the keyboard and touchpad on the ASUS Transformer dock, registering two serio ports and a notifier on the parent EC to forward and remap incoming PS/2 data.
Quoted 5 lines
drivers/input/serio/asus-transformer-ec-kbc.c new file +0
-0
[ ... ]
Quoted 3 lines
drivers/input/serio/asus-transformer-ec-kbc.c new file +3
-0+static int asus_ec_kbc_notify (struct notifier_block *nb, +unsigned long action,void *data_) +{
[ ... ]
Quoted 5 lines
drivers/input/serio/asus-transformer-ec-kbc.c new file +5
-0+while (n--) +serio_interrupt (priv->sdev[port_idx], *data++,0 ); + +return NOTIFY_OK ; +}
[ ... ]
Quoted 54 lines
drivers/input/serio/asus-transformer-ec-kbc.c new file +54
-0+static int asus_ec_register_serio (struct platform_device *pdev,int idx,const char *name,int cmd) +{ +struct asus_ec_kbc_data *priv =platform_get_drvdata (pdev); +struct i2c_client *parent = priv->parent; +struct serio *port =kzalloc_obj (*port); + +if (!port) +return -ENOMEM ; + + priv->sdev[idx] = port; + port->dev.parent = &pdev->dev; + port->id.type =SERIO_8042 ; + port->id.extra = cmd &0xFF ; + port->write = asus_ec_serio_write; + port->port_data = (void *)priv; +snprintf (port->name,sizeof (port->name),"%s %s" , priv->ec->model, name); +snprintf (port->phys,sizeof (port->phys),"i2c-%u-%04x/serio%d" , +i2c_adapter_id (parent->adapter), parent->addr, idx); + +serio_register_port (port); + +return devm_add_action_or_reset (&pdev->dev, asus_ec_serio_remove, port); +} + +static void asus_ec_notifier_chain_unregister (void *data) +{ +struct asus_ec_kbc_data *priv = data; +struct asusec_core *ec = priv->ec; + +blocking_notifier_chain_unregister (&ec->notify_list, &priv->nb); +} + +static int asus_ec_kbc_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct asusec_core *ec =dev_get_drvdata (dev->parent); +struct asus_ec_kbc_data *priv; +int error; + + priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +platform_set_drvdata (pdev, priv); + + priv->ec = ec; + priv->parent =to_i2c_client (dev->parent); + + priv->nb.notifier_call = asus_ec_kbc_notify; + error =blocking_notifier_chain_register (&ec->notify_list, &priv->nb); +if (error) +return dev_err_probe (dev, error,"Failed to register blocking notifier chain" ); + + error =devm_add_action_or_reset (dev, asus_ec_notifier_chain_unregister, priv);
drivers/input/serio/asus-transformer-ec-kbc.c line 244
Quoted 10 lines
drivers/input/serio/asus-transformer-ec-kbc.c new file +10
-0+if (error) +return error; + + error =asus_ec_register_serio (pdev,0 ,"Keyboard" ,0 ); +if (error) +return error; + + error =asus_ec_register_serio (pdev,1 ,"Touchpad" ,I8042_CMD_AUX_SEND ); +if (error) +return error;
[Severity: High]
As reported by Dmitry Torokhov on v12 [1], registering the notifier before initializing the serio ports and without checking whether the ports are ready can lead to a null pointer dereference during probe or a use-after-free during teardown.
In the parent MFD driver, asus_ec_probe() enables the threaded IRQ handler asus_ec_interrupt() before adding the child MFD devices. Once asus_ec_kbc_probe() calls blocking_notifier_chain_register(), an incoming EC keyboard or touchpad interrupt can invoke asus_ec_kbc_notify() while priv->sdev[0] and priv->sdev[1] are still NULL (or after priv->sdev[idx] = port in asus_ec_register_serio(), before serio_register_port() initializes port->lock). Passing priv->sdev[port_idx] to serio_interrupt() will then dereference NULL or lock an uninitialized spinlock.
Additionally, because devm_add_action_or_reset() for asus_ec_notifier_chain_unregister() is registered before the asus_ec_serio_remove() actions in asus_ec_register_serio(), devm teardown runs in reverse order:
asus_ec_serio_remove()
serio_unregister_port()
serio_disconnect_port()
serio_destroy_port() -> frees struct serio ...
asus_ec_notifier_chain_unregister()
During serio_disconnect_port(), the attached PS/2 driver sends disable/reset commands over I2C, causing the EC to generate ACK interrupts while priv->nb is still registered and priv->sdev[] holds dangling pointers to the freed serio ports. Can the notifier be registered after the serio ports (or gated on port readiness under a lock via serio start/stop or open/close callbacks) so that interrupts cannot reach serio_interrupt() before registration or after unregistration?
[1] https://lore.kernel.org/r/[email protected]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
PATCH v13 4/7 input: keyboard: Add driver for ASUS Transformer dock multimedia keys
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
Add support for multimedia top button row of ASUS Transformer's Mobile Dock keyboard. Driver is made that function keys (F1-F12) are used by default which suits average Linux use better and with pressing ScreenLock + AltGr function keys layout is switched to multimedia keys. Only Dock keyboard input events are tracked for AltGr pressing.
--- drivers/input/keyboard/Kconfig | 10 + drivers/input/keyboard/Makefile | 1 + .../input/keyboard/asus-transformer-ec-keys.c | 216 ++++++++++++++++++ 3 files changed, 227 insertions(+) create mode 100644 drivers/input/keyboard/asus-transformer-ec-keys.c
drivers/input/keyboard/Kconfig +10 -0
@@ -89,6 +89,16 @@ config KEYBOARD_APPLESPI To compile this driver as a module, choose M here: the module will be called applespi. +config KEYBOARD_ASUS_TRANSFORMER_EC + tristate "Asus Transformer's Mobile Dock multimedia keys" + depends on MFD_ASUS_TRANSFORMER_EC + help + Say Y here if you want to use multimedia keys present on Asus + Transformer's Mobile Dock. + + To compile this driver as a module, choose M here: the + module will be called asus-transformer-ec-keys. + config KEYBOARD_ATARI tristate "Atari keyboard" depends on ATARI
drivers/input/keyboard/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_KEYBOARD_ADP5585) += adp5585-keys.o obj-$(CONFIG_KEYBOARD_ADP5588) += adp5588-keys.o obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o obj-$(CONFIG_KEYBOARD_APPLESPI) += applespi.o +obj-$(CONFIG_KEYBOARD_ASUS_TRANSFORMER_EC) += asus-transformer-ec-keys.o obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o obj-$(CONFIG_KEYBOARD_BCM) += bcm-keypad.o
drivers/input/keyboard/asus-transformer-ec-keys.c new file +216 -0
216 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 4/7] input: keyboard: Add driver for ASUS Transformer dock multimedia keys
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] input: keyboard: u8 overflow and page mixup in asus_ec_keys_process_key() --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] input: keyboard: u8 overflow and page mixup in asus_ec_keys_process_key() --
commit ba1df1a44a7f539aae799312892bb55d53afd18c
Author: Michał Mirosław <[email protected]>
input: keyboard: Add driver for ASUS Transformer dock multimedia keys
This commit adds an input driver for the ASUS Transformer Mobile Dock multimedia top button row, defaulting to F1-F12 function keys and allowing switching to multimedia keys with ScreenLock + AltGr.
Quoted 25 lines
drivers/input/keyboard/asus-transformer-ec-keys.c new file +19
-0@@ -0,0 +1,216 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include <linux/array_size.h> +#include <linux/err.h> +#include <linux/i2c.h> +#include <linux/input.h> +#include <linux/mfd/asus-transformer-ec.h> +#include <linux/module.h> +#include <linux/platform_device.h> + +#define ASUSEC_EXT_KEY_CODES 0x20 + +struct asus_ec_keys_data { +struct notifier_block nb; +struct asusec_core *ec; +struct input_dev *xidev; +unsigned short keymap[ASUSEC_EXT_KEY_CODES *2 ]; +bool special_key_mode; +};
[ ... ]
Quoted 29 lines
drivers/input/keyboard/asus-transformer-ec-keys.c new file +29
-0+static int asus_ec_keys_process_key (struct input_dev *dev,u8 code) +{ +struct asus_ec_keys_data *priv =dev_get_drvdata (dev->dev.parent); +unsigned int key =0 ; + +if (code ==0 ) +return NOTIFY_DONE ; + +if (priv->ec->right_alt_pressed) { + priv->ec->special_combo_triggered = true; + +/* Flip special key mode state when pressing SCREEN LOCK + R ALT */ +if (code ==1 ) { + priv->special_key_mode = !priv->special_key_mode; +return NOTIFY_OK ; + } + } + +/* +* Relocate code to second "page" if pressed state XOR's mode state +* This way special key will invert the current mode +*/ +if (priv->special_key_mode ^ priv->ec->right_alt_pressed) + code +=ASUSEC_EXT_KEY_CODES ; + +if (code < dev->keycodemax) { +unsigned short *map = dev->keycode; + + key = map[code];
drivers/input/keyboard/asus-transformer-ec-keys.c line 104
Quoted 10 lines
drivers/input/keyboard/asus-transformer-ec-keys.c new file +10
-0+ } + +if (!key) + key =KEY_UNKNOWN ; + +asus_ec_keys_report_key (dev, code, key,1 ); +asus_ec_keys_report_key (dev, code, key,0 ); + +return NOTIFY_OK ; +}
[Severity: Medium]
Should asus_ec_keys_process_key() validate that code < ASUSEC_EXT_KEY_CODES before setting priv->ec->special_combo_triggered and offsetting code by ASUSEC_EXT_KEY_CODES?
In asus_ec_keys_setup_keymap(), dev->keycodemax is set to ARRAY_SIZE(priv->keymap) (0x40), spanning both keymap pages:
drivers/input/keyboard/asus-transformer-ec-keys.c:asus_ec_keys_setup_keymap() {
...
dev->keycode = priv->keymap;
dev->keycodesize = sizeof(*priv->keymap);
dev->keycodemax = ARRAY_SIZE(priv->keymap);
...
}When asus_ec_keys_notify() passes data[2] to asus_ec_keys_process_key() with a raw code >= ASUSEC_EXT_KEY_CODES (0x20), a few issues can occur:
1. If priv->ec->right_alt_pressed is true, priv->ec->special_combo_triggered is set to true even for out-of-range codes.
2. When (priv->special_key_mode ^ priv->ec->right_alt_pressed) is false, a raw code in 0x20..0x3f passes code < dev->keycodemax (0x40) and indexes into the second page (multimedia keys) in map[code] instead of reporting KEY_UNKNOWN.
3. When (priv->special_key_mode ^ priv->ec->right_alt_pressed) is true, adding ASUSEC_EXT_KEY_CODES (0x20) to the 8-bit u8 code overflows for raw codes in 0xe0..0xff, wrapping code into 0x00..0x1f (the first page of map[]) and reporting the wrapped value via MSC_SCAN instead of KEY_UNKNOWN. For raw codes in 0x20..0xdf, MSC_SCAN is also reported with code + 0x20 rather than the raw code.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
PATCH v13 5/7 leds: Add driver for ASUS Transformer LEDs
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
ASUS Transformer tablets have a green and an amber LED on both the Pad and the Dock.
--- drivers/leds/Kconfig | 11 +++ drivers/leds/Makefile | 1 + drivers/leds/leds-asus-transformer-ec.c | 114 ++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 drivers/leds/leds-asus-transformer-ec.c
drivers/leds/Kconfig +11 -0
@@ -120,6 +120,17 @@ config LEDS_OSRAM_AMS_AS3668 To compile this driver as a module, choose M here: the module will be called leds-as3668. +config LEDS_ASUS_TRANSFORMER_EC + tristate "LED Support for Asus Transformer charging LED" + depends on LEDS_CLASS + depends on MFD_ASUS_TRANSFORMER_EC + help + This option enables support for charging indicator on + Asus Transformer's Pad and its Dock. + + To compile this driver as a module, choose M here: the module + will be called leds-asus-transformer-ec. + config LEDS_AW200XX tristate "LED support for Awinic AW20036/AW20054/AW20072/AW20108" depends on LEDS_CLASS
drivers/leds/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_LEDS_ADP5520) += leds-adp5520.o obj-$(CONFIG_LEDS_AN30259A) += leds-an30259a.o obj-$(CONFIG_LEDS_APU) += leds-apu.o obj-$(CONFIG_LEDS_ARIEL) += leds-ariel.o +obj-$(CONFIG_LEDS_ASUS_TRANSFORMER_EC) += leds-asus-transformer-ec.o obj-$(CONFIG_LEDS_OSRAM_AMS_AS3668) += leds-as3668.o obj-$(CONFIG_LEDS_AW200XX) += leds-aw200xx.o obj-$(CONFIG_LEDS_AW2013) += leds-aw2013.o
drivers/leds/leds-asus-transformer-ec.c new file +114 -0
114 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 5/7] leds: Add driver for ASUS Transformer LEDs
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] leds: non-standard two-part LED name format in asus_ec_led_probe() - [Low] leds: missing driver…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] leds: non-standard two-part LED name format in asus_ec_led_probe()
- [Low] leds: missing driver prefix in commit subject
--
commit 8625f763ce281e3f67385ab547a18ea8401f88e9
Author: Michał Mirosław <[email protected]>
leds: Add driver for ASUS Transformer LEDs
This commit adds an LED class driver for the green and amber charging indicator LEDs on the ASUS Transformer Pad and Dock embedded controllers.
Quoted 8 lines
leds: Add driver for ASUS Transformer LEDs
ASUS Transformer tablets have a green and an amber LED on both the Pad and the Dock.
Co-developed-by Svyatoslav Ryhel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Signed-off-by Michał Mirosław <[email protected]>
[Severity: Low]
This isn't a bug, but LED subsystem commit subjects normally include the driver sub-prefix in the form "leds: <driver>: <Capitalized description>". Should the subject line be updated to something like:
leds: asus-transformer-ec: Add driver for ASUS Transformer LEDs
[ ... ]
Quoted 5 lines
drivers/leds/leds-asus-transformer-ec.c new file +0
-0
[ ... ]
Quoted 6 lines
drivers/leds/leds-asus-transformer-ec.c new file +6
-0+static int asus_ec_led_probe (struct platform_device *pdev) +{ +const struct asusec_core *ec =dev_get_drvdata (pdev->dev.parent); +struct device *dev = &pdev->dev; +struct asus_ec_led *leds; +int ret;
drivers/leds/leds-asus-transformer-ec.c line 81
Quoted 10 lines
drivers/leds/leds-asus-transformer-ec.c new file +10
-0+ + leds =devm_kcalloc (dev,ASUSEC_LED_MAX ,sizeof (*leds),GFP_KERNEL ); +if (!leds) +return -ENOMEM ; + +for (int i =0 ; i <ASUSEC_LED_MAX ; i++) { +const struct asus_ec_led_config *cfg = &asus_ec_leds[i]; +struct asus_ec_led *led = &leds[i]; + + led->cdev.name =devm_kasprintf (dev,GFP_KERNEL ,"%s:%s" , ec->name, cfg->name);
[Severity: Medium]
Does formatting led->cdev.name as "%s:%s" with ec->name ("pad" or "dock") and cfg->name ("amber" or "green") omit the function section expected by the LED class naming convention?
Documentation/leds/leds-class.rst specifies the three-section devicename:color:function format (or color:function when devicename is omitted). When a two-section name containing a single colon such as "pad:amber" or "dock:green" is exposed in /sys/class/leds/, userspace tooling such as tools/leds/get_led_device_info.sh parses the first field (ec->name) as the color and the second field (cfg->name) as the function.
Should led->cdev.name include the function segment as well (for example, using LED_FUNCTION_CHARGING to form "%s:%s:" LED_FUNCTION_CHARGING)?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
PATCH v13 6/7 power: supply: Add driver for ASUS Transformer battery
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
Driver implements one battery cell per EC controller and supports reading of battery status for ASUS Transformer's pad and mobile dock.
--- drivers/power/supply/Kconfig | 11 + drivers/power/supply/Makefile | 1 + .../supply/asus-transformer-ec-battery.c | 289 ++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 drivers/power/supply/asus-transformer-ec-battery.c
drivers/power/supply/Kconfig +11 -0
@@ -122,6 +122,17 @@ config BATTERY_CHAGALL This driver can also be built as a module. If so, the module will be called chagall-battery. +config BATTERY_ASUS_TRANSFORMER_EC + tristate "Asus Transformer's battery driver" + depends on MFD_ASUS_TRANSFORMER_EC + help + Say Y to enable support for battery status access on Tegra based + ASUS Transformer devices. + + This sub-driver supports battery cells found in Asus Transformer + tablets and mobile docks and controlled by a special embedded + controller. + config BATTERY_CPCAP tristate "Motorola CPCAP PMIC battery driver" depends on MFD_CPCAP && IIO
drivers/power/supply/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-$(CONFIG_TEST_POWER) += test_power.o obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o obj-$(CONFIG_CHARGER_ADP5061) += adp5061.o obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o +obj-$(CONFIG_BATTERY_ASUS_TRANSFORMER_EC) += asus-transformer-ec-battery.o obj-$(CONFIG_BATTERY_AXP20X) += axp20x_battery.o obj-$(CONFIG_CHARGER_AXP20X) += axp20x_ac_power.o obj-$(CONFIG_BATTERY_CHAGALL) += chagall-battery.o
drivers/power/supply/asus-transformer-ec-battery.c new file +289 -0
289 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 6/7] power: supply: Add driver for ASUS Transformer battery
Sashiko has reviewed this patch and found no issues.
Quoted 8 lines
From: Michał Mirosław <[email protected]>
Driver implements one battery cell per EC controller and supports reading of battery status for ASUS Transformer's pad and mobile dock.
Co-developed-by Svyatoslav Ryhel <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>Signed-off-by Michał Mirosław <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
PATCH v13 7/7 power: supply: Add charger driver for Asus Transformers
In reply to Svyatoslav RyhelFrom: Michał Mirosław <[email protected]>
Add support for charger detection capabilities found in the embedded controller of ASUS Transformer devices.
--- drivers/power/supply/Kconfig | 11 + drivers/power/supply/Makefile | 1 + .../supply/asus-transformer-ec-charger.c | 208 ++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 drivers/power/supply/asus-transformer-ec-charger.c
drivers/power/supply/Kconfig +11 -0
@@ -508,6 +508,17 @@ config CHARGER_88PM860X help Say Y here to enable charger for Marvell 88PM860x chip. +config CHARGER_ASUS_TRANSFORMER_EC + tristate "Asus Transformer's charger driver" + depends on MFD_ASUS_TRANSFORMER_EC + help + Say Y here to enable support AC plug detection on Asus Transformer + Dock. + + This sub-driver supports charger detection mechanism found in Asus + Transformer tablets and mobile docks and controlled by special + embedded controller. + config CHARGER_PF1550 tristate "NXP PF1550 battery charger driver" depends on MFD_PF1550
drivers/power/supply/Makefile +1 -0
@@ -69,6 +69,7 @@ obj-$(CONFIG_CHARGER_RT9471) += rt9471.o obj-$(CONFIG_CHARGER_RT9756) += rt9756.o obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o +obj-$(CONFIG_CHARGER_ASUS_TRANSFORMER_EC) += asus-transformer-ec-charger.o obj-$(CONFIG_CHARGER_PF1550) += pf1550-charger.o obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o ab8500_chargalg.o
drivers/power/supply/asus-transformer-ec-charger.c new file +208 -0
208 lines not on this page · raw message
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH v13 7/7] power: supply: Add charger driver for Asus Transformers
Sashiko has reviewed this patch and found no issues.
Quoted 9 lines
From: Michał Mirosław <[email protected]>
Add support for charger detection capabilities found in the embedded controller of ASUS Transformer devices.
Suggested-by Maxim Schwalm <[email protected]>Suggested-by Svyatoslav Ryhel <[email protected]>Signed-off-by Michał Mirosław <[email protected]>Signed-off-by Svyatoslav Ryhel <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
Quoted 2 lines · Svyatoslav Ryhel
Add support for embedded controller used in Asus Transformers for managing power and input functions.
Applied, thanks!
[1/7] dt-bindings: embedded-controller: document ASUS Transformer EC
commit: 2880926d48fe884042a1b7b64b431f9ee9531806
[2/7] mfd: Add driver for ASUS Transformer embedded controller
commit: ccb21236e307ff60ce6b96d2f9925abf0274ce8e
[3/7] input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
commit: 3fefdd9a8931eb3b8cade87193c81293256031f0
[4/7] input: keyboard: Add driver for ASUS Transformer dock multimedia keys
commit: 4ace8a63a1612f8142cfdf5d6d4b8e1be37cce3b
[5/7] leds: Add driver for ASUS Transformer LEDs
commit: 04819cdb3912f31586516ef6fc007daa3d976234
[6/7] power: supply: Add driver for ASUS Transformer battery
commit: cd72536270e725b4f1d56df6287c4c34efe953a8
[7/7] power: supply: Add charger driver for Asus Transformers
commit: db6674a08304d03a194f5e09b7543323462b3516--
Lee Jones [李琼斯]
Lee Jones
maintainerQuoted 7 lines · Lee Jones
Quoted 2 lines · Svyatoslav Ryhel
Add support for embedded controller used in Asus Transformers for managing power and input functions.
Applied, thanks!
[1/7] dt-bindings: embedded-controller: document ASUS Transformer EC
Quoted 13 lines
commit: 2880926d48fe884042a1b7b64b431f9ee9531806
[2/7] mfd: Add driver for ASUS Transformer embedded controller
commit: ccb21236e307ff60ce6b96d2f9925abf0274ce8e
[3/7] input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
commit: 3fefdd9a8931eb3b8cade87193c81293256031f0
[4/7] input: keyboard: Add driver for ASUS Transformer dock multimedia keys
commit: 4ace8a63a1612f8142cfdf5d6d4b8e1be37cce3b
[5/7] leds: Add driver for ASUS Transformer LEDs
commit: 04819cdb3912f31586516ef6fc007daa3d976234
[6/7] power: supply: Add driver for ASUS Transformer battery
commit: cd72536270e725b4f1d56df6287c4c34efe953a8
[7/7] power: supply: Add charger driver for Asus Transformers
commit: db6674a08304d03a194f5e09b7543323462b3516Now in soak. If successful, I'll follow-up with a PR shortly.
Note to self: ib-mfd-input-leds-power-7.5
Signature · 1 line
Lee Jones
Lee Jones
maintainer[GIT PULL] Immutable branch between MFD, Input, LEDs and Power due for the v7.5 merge window
In reply to Svyatoslav RyhelEnjoy!
The following changes since commit 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4:
Linux 7.4-rc1 (2026-11-01 13:26:31 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-input-leds-power-v7.5
for you to fetch changes up to db6674a08304d03a194f5e09b7543323462b3516:
power: supply: Add charger driver for Asus Transformers (2026-11-05 11:18:09 +0000)
----------------------------------------------------------------
Immutable branch between MFD, Input, LEDs and Power due for the v7.5 merge window
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmr9rC0ACgkQUa+KL4f8 d2ErjQ/9FdtsxmQO6kutCzEoBE2ka6/0khvWwQd3N/DwRcwqPNyeySlSph4IbA1e 2s3xxZRVOifOEOEmD/IQxbbUY35tJtge6KpIg+nVUVc2lI+GnV1LtA/mMkHG1CLQ lUeNfOuZjnHqW1HvmORPrcChsHncofHa8yN53d7iykYvPSSxKcUzEVL97ijgdgeW cajXj/EMx716qjj0j0cuulbXrScR6ySMiGeYCL8wQpc230x7w2qrBfj1flhdaTF0 SrZmV7UVeT+ogBF/L1bz+jq1vT4om9yCGkVt2+Ju6bY2fWfMJNnpwuJ9a1E+nCtk b/0IgtKA7lVNAhJUMTSzg4GCtMyaE5LoOLEZca1ZgNLSjxKqicT55G5ZaKN3sBtF 2SW51u6SEO5lRZYnsth6bnCQTlfppRgw7oBuELfsUZ6esmyQ2zdzCrM8obqJBGN1 ES5hUC1twiw246imHU6Gla1GllAPkTR/Ck4ZHVJwPXVe3tBB4d4AouAZjjv45frC kwhxMc8h3UpJ4YTKagEcCgz3Gj45oflv4Khcl8aH5YhY8MUDjIFvZU7M/OahiheN WxT65pL55WNVmC6gNyEsqFKNkiGukf2IeuHRvWzSrLuy9GEa/RVk+w5JJmngoqzB Ej4GtEu79gXcuRxd08AnFCc9P0zF84aaZ+q5kVH+0juFX/wb4aM= =sFQA
-----END PGP SIGNATURE-----
----------------------------------------------------------------
Michal Miroslaw (6):
mfd: Add driver for ASUS Transformer embedded controller
input: serio: Add driver for ASUS Transformer dock keyboard and touchpad
input: keyboard: Add driver for ASUS Transformer dock multimedia keys
leds: Add driver for ASUS Transformer LEDs
power: supply: Add driver for ASUS Transformer battery
power: supply: Add charger driver for Asus Transformers
Svyatoslav Ryhel (1):
dt-bindings: embedded-controller: document ASUS Transformer EC
.../embedded-controller/asus,tf201-ec-pad.yaml | 119 +++++ drivers/input/keyboard/Kconfig | 10 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/asus-transformer-ec-keys.c | 216 ++++++++ drivers/input/serio/Kconfig | 15 + drivers/input/serio/Makefile | 1 + drivers/input/serio/asus-transformer-ec-kbc.c | 258 ++++++++++ drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-asus-transformer-ec.c | 114 +++++ drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/asus-transformer-ec.c | 551 +++++++++++++++++++++ drivers/power/supply/Kconfig | 22 + drivers/power/supply/Makefile | 2 + drivers/power/supply/asus-transformer-ec-battery.c | 289 +++++++++++ drivers/power/supply/asus-transformer-ec-charger.c | 208 ++++++++ include/linux/mfd/asus-transformer-ec.h | 100 ++++ 18 files changed, 1935 insertions(+) create mode 100644 Documentation/devicetree/bindings/embedded-controller/asus,tf201-ec-pad.yaml create mode 100644 drivers/input/keyboard/asus-transformer-ec-keys.c create mode 100644 drivers/input/serio/asus-transformer-ec-kbc.c create mode 100644 drivers/leds/leds-asus-transformer-ec.c create mode 100644 drivers/mfd/asus-transformer-ec.c create mode 100644 drivers/power/supply/asus-transformer-ec-battery.c create mode 100644 drivers/power/supply/asus-transformer-ec-charger.c create mode 100644 include/linux/mfd/asus-transformer-ec.h
Signature · 1 line
Lee Jones