[PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices

Anvesh Jain P posted 5 patches 3 weeks, 3 days ago
There is a newer version of this series
.../embedded-controller/qcom,hamoa-ec.yaml         |  56 +++
MAINTAINERS                                        |   8 +
arch/arm64/boot/dts/qcom/glymur-crd.dts            |  22 +
arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts         |  16 +
arch/arm64/boot/dts/qcom/x1-crd.dtsi               |  16 +
drivers/platform/arm64/Kconfig                     |  12 +
drivers/platform/arm64/Makefile                    |   1 +
drivers/platform/arm64/qcom-hamoa-ec.c             | 468 +++++++++++++++++++++
8 files changed, 599 insertions(+)
[PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Anvesh Jain P 3 weeks, 3 days ago
From: Anvesh Jain P <anvesh.p@oss.qualcomm.com>

Add Embedded controller driver support for Hamoa/Purwa/Glymur Qualcomm
reference boards. It handles fan control, temperature sensors, access
to EC state changes and supports reporting suspend entry/exit to the EC.

---
Changes in v4:
  - Fix fan count calculation to use min() instead of max() to correctly
    cap fan_cnt at EC_MAX_FAN_CNT.
  - Remove unnecessary mutex lock/unlock.
  - Disable fan debug mode on ec module removal.
  - Fix issue reported by kernel test robot.
  - Consolidate hamoa-iot-evk specific changes into hamoa-iot-evk.dts.
  - Add board-specific compatible strings as per review comments.
  - Link to v3: https://lore.kernel.org/all/20260308233646.2318676-1-sibi.sankar@oss.qualcomm.com/

Changes in v3:
  - Revamp the bindings and driver to support generic ec specification
    that works across Qualcomm Hamoa/Purwa and Glymur reference devices.
  - Add ec nodes to Hamoa/Purwa CRDs and IOT-EVKs.
  - Add ec node to Glymur CRDs.
  - Link to v2: https://lore.kernel.org/lkml/20241219200821.8328-1-maccraft123mc@gmail.com/
  - Link to v1: https://lore.kernel.org/lkml/20240927185345.3680-1-maccraft123mc@gmail.com/

---
Maya Matuszczyk (1):
      dt-bindings: embedded-controller: Add EC bindings for Qualcomm reference devices

Sibi Sankar (4):
      platform: arm64: Add driver for EC found on Qualcomm reference devices
      arm64: dts: qcom: glymur-crd: Add Embedded controller node
      arm64: dts: qcom: x1-crd: Add Embedded controller node
      arm64: dts: qcom: hamoa-iot-evk: Add Embedded controller node

 .../embedded-controller/qcom,hamoa-ec.yaml         |  56 +++
 MAINTAINERS                                        |   8 +
 arch/arm64/boot/dts/qcom/glymur-crd.dts            |  22 +
 arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts         |  16 +
 arch/arm64/boot/dts/qcom/x1-crd.dtsi               |  16 +
 drivers/platform/arm64/Kconfig                     |  12 +
 drivers/platform/arm64/Makefile                    |   1 +
 drivers/platform/arm64/qcom-hamoa-ec.c             | 468 +++++++++++++++++++++
 8 files changed, 599 insertions(+)
---
base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
change-id: 20260309-v04-add-driver-for-ec-3fa478f264d9

Best regards,
-- 
Anvesh Jain P <anvesh.p@oss.qualcomm.com>
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Bryan O'Donoghue 3 weeks, 3 days ago
On 13/03/2026 10:29, Anvesh Jain P wrote:
> From: Anvesh Jain P <anvesh.p@oss.qualcomm.com>
> 
> Add Embedded controller driver support for Hamoa/Purwa/Glymur Qualcomm
> reference boards. It handles fan control, temperature sensors, access
> to EC state changes and supports reporting suspend entry/exit to the EC.
> 
> ---
> Changes in v4:
>    - Fix fan count calculation to use min() instead of max() to correctly
>      cap fan_cnt at EC_MAX_FAN_CNT.
>    - Remove unnecessary mutex lock/unlock.
>    - Disable fan debug mode on ec module removal.
>    - Fix issue reported by kernel test robot.
>    - Consolidate hamoa-iot-evk specific changes into hamoa-iot-evk.dts.
>    - Add board-specific compatible strings as per review comments.
>    - Link to v3: https://lore.kernel.org/all/20260308233646.2318676-1-sibi.sankar@oss.qualcomm.com/
> 
> Changes in v3:
>    - Revamp the bindings and driver to support generic ec specification
>      that works across Qualcomm Hamoa/Purwa and Glymur reference devices.
>    - Add ec nodes to Hamoa/Purwa CRDs and IOT-EVKs.
>    - Add ec node to Glymur CRDs.
>    - Link to v2: https://lore.kernel.org/lkml/20241219200821.8328-1-maccraft123mc@gmail.com/
>    - Link to v1: https://lore.kernel.org/lkml/20240927185345.3680-1-maccraft123mc@gmail.com/
> 
> ---
> Maya Matuszczyk (1):
>        dt-bindings: embedded-controller: Add EC bindings for Qualcomm reference devices
> 
> Sibi Sankar (4):
>        platform: arm64: Add driver for EC found on Qualcomm reference devices
>        arm64: dts: qcom: glymur-crd: Add Embedded controller node
>        arm64: dts: qcom: x1-crd: Add Embedded controller node
>        arm64: dts: qcom: hamoa-iot-evk: Add Embedded controller node
> 
>   .../embedded-controller/qcom,hamoa-ec.yaml         |  56 +++
>   MAINTAINERS                                        |   8 +
>   arch/arm64/boot/dts/qcom/glymur-crd.dts            |  22 +
>   arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts         |  16 +
>   arch/arm64/boot/dts/qcom/x1-crd.dtsi               |  16 +
>   drivers/platform/arm64/Kconfig                     |  12 +
>   drivers/platform/arm64/Makefile                    |   1 +
>   drivers/platform/arm64/qcom-hamoa-ec.c             | 468 +++++++++++++++++++++
>   8 files changed, 599 insertions(+)
> ---
> base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
> change-id: 20260309-v04-add-driver-for-ec-3fa478f264d9
> 
> Best regards,


echo 'file qcom-hamoa-ec.c +p' > /sys/kernel/debug/dynamic_debug/control
echo 6-0076 > /sys/bus/i2c/drivers/qcom-hamoa-ec/unbind
echo 6-0076 > /sys/bus/i2c/drivers/qcom-hamoa-ec/bind
dmesg | tail -n 15

[   27.301126] qcom-hamoa-ec 6-0076: EC Version 0.35.0
[   27.311768] qcom-hamoa-ec 6-0076: Fan count: 0 Fan Type: 0 Thermistor 
Mask: 0

?

---
bod
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Anvesh Jain P 3 weeks, 3 days ago

On 3/13/2026 5:48 PM, Bryan O'Donoghue wrote:
> On 13/03/2026 10:29, Anvesh Jain P wrote:
>> From: Anvesh Jain P <anvesh.p@oss.qualcomm.com>
>>
>> Add Embedded controller driver support for Hamoa/Purwa/Glymur Qualcomm
>> reference boards. It handles fan control, temperature sensors, access
>> to EC state changes and supports reporting suspend entry/exit to the EC.
>>
>> ---
>> Changes in v4:
>>    - Fix fan count calculation to use min() instead of max() to correctly
>>      cap fan_cnt at EC_MAX_FAN_CNT.
>>    - Remove unnecessary mutex lock/unlock.
>>    - Disable fan debug mode on ec module removal.
>>    - Fix issue reported by kernel test robot.
>>    - Consolidate hamoa-iot-evk specific changes into hamoa-iot-evk.dts.
>>    - Add board-specific compatible strings as per review comments.
>>    - Link to v3: https://lore.kernel.org/all/20260308233646.2318676-1-
>> sibi.sankar@oss.qualcomm.com/
>>
>> Changes in v3:
>>    - Revamp the bindings and driver to support generic ec specification
>>      that works across Qualcomm Hamoa/Purwa and Glymur reference devices.
>>    - Add ec nodes to Hamoa/Purwa CRDs and IOT-EVKs.
>>    - Add ec node to Glymur CRDs.
>>    - Link to v2: https://lore.kernel.org/lkml/20241219200821.8328-1-
>> maccraft123mc@gmail.com/
>>    - Link to v1: https://lore.kernel.org/lkml/20240927185345.3680-1-
>> maccraft123mc@gmail.com/
>>
>> ---
>> Maya Matuszczyk (1):
>>        dt-bindings: embedded-controller: Add EC bindings for Qualcomm
>> reference devices
>>
>> Sibi Sankar (4):
>>        platform: arm64: Add driver for EC found on Qualcomm reference
>> devices
>>        arm64: dts: qcom: glymur-crd: Add Embedded controller node
>>        arm64: dts: qcom: x1-crd: Add Embedded controller node
>>        arm64: dts: qcom: hamoa-iot-evk: Add Embedded controller node
>>
>>   .../embedded-controller/qcom,hamoa-ec.yaml         |  56 +++
>>   MAINTAINERS                                        |   8 +
>>   arch/arm64/boot/dts/qcom/glymur-crd.dts            |  22 +
>>   arch/arm64/boot/dts/qcom/hamoa-iot-evk.dts         |  16 +
>>   arch/arm64/boot/dts/qcom/x1-crd.dtsi               |  16 +
>>   drivers/platform/arm64/Kconfig                     |  12 +
>>   drivers/platform/arm64/Makefile                    |   1 +
>>   drivers/platform/arm64/qcom-hamoa-ec.c             | 468 +++++++++++
>> ++++++++++
>>   8 files changed, 599 insertions(+)
>> ---
>> base-commit: a0ae2a256046c0c5d3778d1a194ff2e171f16e5f
>> change-id: 20260309-v04-add-driver-for-ec-3fa478f264d9
>>
>> Best regards,
> 
> 
> echo 'file qcom-hamoa-ec.c +p' > /sys/kernel/debug/dynamic_debug/control
> echo 6-0076 > /sys/bus/i2c/drivers/qcom-hamoa-ec/unbind
> echo 6-0076 > /sys/bus/i2c/drivers/qcom-hamoa-ec/bind
> dmesg | tail -n 15
> 
> [   27.301126] qcom-hamoa-ec 6-0076: EC Version 0.35.0
> [   27.311768] qcom-hamoa-ec 6-0076: Fan count: 0 Fan Type: 0 Thermistor
> Mask: 0
> 
> ?

Hey Bryan,
Thanks for trying out the patches. CRDs typically ship with
very old firmware, and updating them to the latest version
should allow the thermal information to be populated correctly.

> 
> ---
> bod

Best regards,
Anvesh

Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Bryan O'Donoghue 3 weeks, 3 days ago
On 13/03/2026 13:15, Anvesh Jain P wrote:
>> [   27.311768] qcom-hamoa-ec 6-0076: Fan count: 0 Fan Type: 0 Thermistor
>> Mask: 0
>>
>> ?
> Hey Bryan,
> Thanks for trying out the patches. CRDs typically ship with
> very old firmware, and updating them to the latest version
> should allow the thermal information to be populated correctly.

Sure but looking at this we still load happily even with all of these 
values set @ zero.

Fan Count == 0 || Thermistor == 0 => error and probe() fail.

---
bod
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Dmitry Baryshkov 3 weeks, 3 days ago
On Fri, Mar 13, 2026 at 04:26:16PM +0000, Bryan O'Donoghue wrote:
> On 13/03/2026 13:15, Anvesh Jain P wrote:
> > > [   27.311768] qcom-hamoa-ec 6-0076: Fan count: 0 Fan Type: 0 Thermistor
> > > Mask: 0
> > > 
> > > ?
> > Hey Bryan,
> > Thanks for trying out the patches. CRDs typically ship with
> > very old firmware, and updating them to the latest version
> > should allow the thermal information to be populated correctly.
> 
> Sure but looking at this we still load happily even with all of these values
> set @ zero.
> 
> Fan Count == 0 || Thermistor == 0 => error and probe() fail.

WHy? EC is still there. QUite useless though.

> 
> ---
> bod

-- 
With best wishes
Dmitry
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Bryan O'Donoghue 3 weeks, 3 days ago
On 13/03/2026 17:17, Dmitry Baryshkov wrote:
>> Fan Count == 0 || Thermistor == 0 => error and probe() fail.
> WHy? EC is still there. QUite useless though.

You want to register when zero fans are found, zero thermistors... ?

That's a bit fruity.

---
bod
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Anvesh Jain P 3 weeks ago

On 3/14/2026 9:39 AM, Bryan O'Donoghue wrote:
> On 13/03/2026 17:17, Dmitry Baryshkov wrote:
>>> Fan Count == 0 || Thermistor == 0 => error and probe() fail.
>> WHy? EC is still there. QUite useless though.
> 
> You want to register when zero fans are found, zero thermistors... ?
> 
> That's a bit fruity.
> 

We need to keep the driver loaded even if zero fans are reported, as it
is also responsible for sending suspend/resume notifications to the EC.
Failing the probe would prevent these PM notifications from reaching the EC.

Instead, I will add a dev_warn message suggesting a firmware upgrade
when zero fans are found. Let me know your thoughts.

> ---
> bod

-- 
Best Regards,
Anvesh
Re: [PATCH v4 0/5] Add driver for EC found on Qualcomm reference devices
Posted by Bryan O'Donoghue 3 weeks ago
On 16/03/2026 10:22, Anvesh Jain P wrote:
> We need to keep the driver loaded even if zero fans are reported, as it
> is also responsible for sending suspend/resume notifications to the EC.
> Failing the probe would prevent these PM notifications from reaching the EC.
> 
> Instead, I will add a dev_warn message suggesting a firmware upgrade
> when zero fans are found. Let me know your thoughts.

Sure, say something, it seems very odd to just continue on as if 
everything is grand.

---
bod