Skip to content
Snippets Groups Projects

Draft: HDMIRX support

Closed Shreeya Patel requested to merge shreeya/rk3588-linux:rk3588-hdmi-input into rk3588
6 unresolved threads

Add support for hdmi input driver for rk3588

Edited by Shreeya Patel

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
289 289 {
290 290 return __cpu_logical_map[cpu];
291 291 }
292 EXPORT_SYMBOL(cpu_logical_map);
  • 2170 2170 #dma-cells = <1>;
    2171 2171 };
    2172 2172
    2173 hdmirx_ctrler: hdmirx-controller@fdee0000 {
    2174 compatible = "rockchip,rk3588-hdmirx-ctrler", "rockchip,hdmirx-ctrler";
  • 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>;
    • DT maintainers usually don't accept boolean types like this. You are expected to have something like "hpd-is-active-low;" boolean flag and default to active high or vice versa. Ideally the default is the more common variant.

    • Author Maintainer

      @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 Patel
    • You 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 use device_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)

    • Shreeya Patel changed this line in version 3 of the diff

      changed this line in version 3 of the diff

    • Please register or sign in to reply
  • 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>;
  • 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,
  • 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);
  • Shreeya Patel added 3 commits

    added 3 commits

    • 4ab1c5e2 - arm64: dts: rockchip: Add device tree support for hdmi input
    • fddb595d - media: platform: rockchip: Add support for hdmi input driver
    • 6adf0bf3 - Add Device Tree Bindings

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading