cec: backport 5.15 AOCEC driver to 4.9 with __ATTR table refactor#5
Open
samtheruby wants to merge 1 commit into
Open
cec: backport 5.15 AOCEC driver to 4.9 with __ATTR table refactor#5samtheruby wants to merge 1 commit into
samtheruby wants to merge 1 commit into
Conversation
Full replacement of the 4.9 AOCEC driver with the 5.15 version, adapted
for the 4.9 Amlogic-ng kernel (G12B/SM1 targets).
Backport changes:
- Split monolithic hdmi_ao_cec.c into three files (hdmi_ao_cec.c,
hdmi_aocec_api.c, hdmi_cec_dump.c) matching the 5.15 driver layout.
- Replace all aml_mbox calls with scpi_protocol equivalents:
MBOX_CMD_SET_CEC_DATA -> scpi_send_cec_data / scpi_send_usr_data
MBOX_CMD_GET_CEC1/2 -> scpi_get_cec_val
MBOX_CMD_GET_CEC_OTP/AS_MSG -> scpi_get_cec_wk_msg
- Add get_hdmitx_phy_addr() shim (5.15 accessor not in 4.9 hdmi_tx_ext.h).
- CEC_MAIL_BOX and CEC_FREEZE_WAKE_UP intentionally left undefined: 4.9
uses scpi_protocol; freeze/s2idle not supported on ng hardware.
- HPD regression fix: 5.15 cec_hdmi_plug_handler clears stale phy_addr on
unplug, preventing phantom active-source responses.
- Add null guards to hdmitx/hdmirx notify callbacks against races during
driver probe/remove.
- Drop CONFIG_AMLOGIC_HDMITX21 guards (not in 4.9); fix
CONFIG_HAS_EARLYSUSPEND -> CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND; fix
HDMIRX include path for 4.9 tree layout.
- Remove the missing linux/earlysuspend.h include — all needed
declarations come from linux/amlogic/pm.h under
CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND.
Refactor on top:
- Replace per-attribute CLASS_ATTR_xx static declarations and the
aocec_class_attrs[] pointer array with a single aocec_class_attr_list[]
table built from __ATTR_xx macros. Same set of attributes, same
RW/RO/WO semantics; cleans up the namespace and makes adding new
attributes a one-line change.
Author
|
All possible tests passed, As well as 0 bugs when in regular use, I think this is ready for prime time! |
Author
|
Please note this also requires the fix pannal/CoreELEC#52 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport changes
hdmi_ao_cec.cinto three files (hdmi_ao_cec.c,hdmi_aocec_api.c,hdmi_cec_dump.c) matching the 5.15 driver layout.aml_mboxcalls withscpi_protocolequivalents:MBOX_CMD_SET_CEC_DATA->scpi_send_cec_data/scpi_send_usr_dataMBOX_CMD_GET_CEC1/2->scpi_get_cec_valMBOX_CMD_GET_CEC_OTP/AS_MSG->scpi_get_cec_wk_msgget_hdmitx_phy_addr()shim (5.15 accessor not in 4.9hdmi_tx_ext.h).CEC_MAIL_BOXandCEC_FREEZE_WAKE_UPintentionally left undefined: 4.9 usesscpi_protocol; freeze/s2idle not supported on ng hardware.cec_hdmi_plug_handlerclears stalephy_addron unplug, preventing phantom active-source responses.CONFIG_AMLOGIC_HDMITX21guards (not in 4.9); fixCONFIG_HAS_EARLYSUSPEND->CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND; fix HDMIRX include path for 4.9 tree layout.linux/earlysuspend.hinclude — all needed declarations come fromlinux/amlogic/pm.hunderCONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND.Refactor on top
CLASS_ATTR_xxstatic declarations and theaocec_class_attrs[]pointer array with a singleaocec_class_attr_list[]table built from__ATTR_xxmacros. Same set of attributes, same RW/RO/WO semantics; cleans up the namespace and makes adding new attributes a one-line change.Test plan