FrameworkComputer / EmbeddedController

Embedded Controller firmware for the Framework Laptop
BSD 3-Clause "New" or "Revised" License
950 stars 64 forks source link

hx20: Touchpad and Audio board IDs are never read via `get_hardware_id` #13

Closed DHowett closed 2 years ago

DHowett commented 2 years ago

The ADC channels ADC_AUDIO_BOARD_ID and ADC_TP_BOARD_ID are ostensibly used to detect the board revision for the input cover and audio daughterboard.

They are only used in diagnostics.c here (and slightly above, where their raw values are gathered):

https://github.com/FrameworkComputer/EmbeddedController/blob/8109392adb17a2cd7d30a74eee8613a0cb72ee7d/board/hx20/diagnostics.c#L163-L164

get_hardware_id takes one argument, channel:

https://github.com/FrameworkComputer/EmbeddedController/blob/8109392adb17a2cd7d30a74eee8613a0cb72ee7d/board/hx20/board.c#L693

However, get_hardware_id ignores its argument and always reads ADC_AD_BID:

https://github.com/FrameworkComputer/EmbeddedController/blob/8109392adb17a2cd7d30a74eee8613a0cb72ee7d/board/hx20/board.c#L699

DHowett commented 2 years ago

In addition, I'd be curious to know what the values are for the various board IDs. I suggested to @CRImier that they could select a different set of values for the TP_BOARD_ID voltage divider so that a custom EC could detect their input cover shim, but not knowing the range of produced values makes it difficult to select a new one. :smile:

DHowett commented 2 years ago

This was fixed in a recent commit as well. Thanks!