Draft: HDMIRX support
Add support for hdmi input driver for rk3588
Merge request reports
Activity
289 289 { 290 290 return __cpu_logical_map[cpu]; 291 291 } 292 EXPORT_SYMBOL(cpu_logical_map); changed this line in version 3 of the diff
2170 2170 #dma-cells = <1>; 2171 2171 }; 2172 2172 2173 hdmirx_ctrler: hdmirx-controller@fdee0000 { 2174 compatible = "rockchip,rk3588-hdmirx-ctrler", "rockchip,hdmirx-ctrler"; You need to write a DT binding for this and check with the following command that the DT is valid:
make CHECK_DTBS=y rockchip/rk3588-rock-5b.dtb
(if you are using the integration branch as reference there will be a few warnings about opp-table-cluster1, you can ignore those. They are from the cpufreq support, which need major rework)
changed this line in version 3 of the diff
192 192 mem-supply = <&vdd_cpu_lit_mem_s0>; 193 193 }; 194 194 195 /* Should work with at least 128MB cma reserved above. */ 196 &hdmirx_ctrler { 197 status = "okay"; 198 199 /* Effective level used to trigger HPD: 0-low, 1-high */ 200 hpd-trigger-level = <1>; @sre I am not sure if I got this correctly so just to need to confirm.
If we change it to a boolean type then the driver code for parsing the DT will change to the following
if (of_property_read_bool(np, "hpd-is-active-low")) { hdmirx_dev->hpd_trigger_level = 1; } else { hdmirx_dev->hpd_trigger_level = 0; }
Does it look correct to you? I checked that
of_property_read_bool
returns true if the property is present and false otherwise.Edited by Shreeya PatelYou got it the wrong way around. The previous comment said, that 0 is active-low. Also there is no need for the if/else block:
hdmirx_dev->hpd_trigger_level = !of_property_read_bool(np, "hpd-is-active-low");
Last but not least instead of
of_property_read_*
, it's better to usedevice_property_read_*
, which is more modern and not DT specific:hdmirx_dev->hpd_trigger_level = !device_property_read_bool(dev, "hpd-is-active-low");
(that's from
include/linux/property.h
)changed this line in version 3 of the diff
192 192 mem-supply = <&vdd_cpu_lit_mem_s0>; 193 193 }; 194 194 195 /* Should work with at least 128MB cma reserved above. */ 196 &hdmirx_ctrler { 197 status = "okay"; 198 199 /* Effective level used to trigger HPD: 0-low, 1-high */ 200 hpd-trigger-level = <1>; 201 hdmirx-det-gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>; changed this line in version 3 of the diff
3059 { 3060 struct rk_hdmirx_dev *hdmirx_dev = dev_get_drvdata(dev); 3061 3062 return snprintf(buf, PAGE_SIZE, "%d", hdmirx_dev->audio_state.fs_audio); 3063 } 3064 3065 static ssize_t audio_present_show(struct device *dev, 3066 struct device_attribute *attr, char *buf) 3067 { 3068 struct rk_hdmirx_dev *hdmirx_dev = dev_get_drvdata(dev); 3069 3070 return snprintf(buf, PAGE_SIZE, "%d", 3071 tx_5v_power_present(hdmirx_dev) ? hdmirx_dev->audio_present : 0); 3072 } 3073 3074 static ssize_t edid_show(struct device *dev, changed this line in version 3 of the diff
3736 if (irq < 0) { 3737 dev_err(dev, "get hdmi cec irq failed!\n"); 3738 cec_notifier_conn_unregister(hdmirx_dev->cec_notifier); 3739 ret = irq; 3740 goto err_hdl; 3741 } 3742 cpumask_clear(&cpumask); 3743 cpumask_set_cpu(hdmirx_dev->bound_cpu, &cpumask); 3744 irq_set_affinity_hint(irq, &cpumask); 3745 3746 cec_data.hdmirx = hdmirx_dev; 3747 cec_data.dev = hdmirx_dev->dev; 3748 cec_data.ops = &hdmirx_cec_ops; 3749 cec_data.irq = irq; 3750 cec_data.edid = edid_init_data_340M; 3751 hdmirx_dev->cec = rk_hdmirx_cec_register(&cec_data);