Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/tegra: Refactor CEC support

Most of the CEC support code already lives in the "output" library code.
Move registration and unregistration to the library code as well to make
use of the same code with HDMI on Tegra210 and later via the SOR.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Thierry Reding <treding@nvidia.com>

+10 -12
+1 -1
drivers/gpu/drm/tegra/drm.h
··· 124 124 struct drm_panel *panel; 125 125 struct i2c_adapter *ddc; 126 126 const struct edid *edid; 127 - struct cec_notifier *notifier; 127 + struct cec_notifier *cec; 128 128 unsigned int hpd_irq; 129 129 int hpd_gpio; 130 130 enum of_gpio_flags hpd_gpio_flags;
-9
drivers/gpu/drm/tegra/hdmi.c
··· 22 22 23 23 #include <sound/hda_verbs.h> 24 24 25 - #include <media/cec-notifier.h> 26 - 27 25 #include "hdmi.h" 28 26 #include "drm.h" 29 27 #include "dc.h" ··· 1707 1709 return PTR_ERR(hdmi->vdd); 1708 1710 } 1709 1711 1710 - hdmi->output.notifier = cec_notifier_get(&pdev->dev); 1711 - if (hdmi->output.notifier == NULL) 1712 - return -ENOMEM; 1713 - 1714 1712 hdmi->output.dev = &pdev->dev; 1715 1713 1716 1714 err = tegra_output_probe(&hdmi->output); ··· 1764 1770 } 1765 1771 1766 1772 tegra_output_remove(&hdmi->output); 1767 - 1768 - if (hdmi->output.notifier) 1769 - cec_notifier_put(hdmi->output.notifier); 1770 1773 1771 1774 return 0; 1772 1775 }
+9 -2
drivers/gpu/drm/tegra/output.c
··· 36 36 else if (output->ddc) 37 37 edid = drm_get_edid(connector, output->ddc); 38 38 39 - cec_notifier_set_phys_addr_from_edid(output->notifier, edid); 39 + cec_notifier_set_phys_addr_from_edid(output->cec, edid); 40 40 drm_connector_update_edid_property(connector, edid); 41 41 42 42 if (edid) { ··· 73 73 } 74 74 75 75 if (status != connector_status_connected) 76 - cec_notifier_phys_addr_invalidate(output->notifier); 76 + cec_notifier_phys_addr_invalidate(output->cec); 77 77 78 78 return status; 79 79 } ··· 174 174 disable_irq(output->hpd_irq); 175 175 } 176 176 177 + output->cec = cec_notifier_get(output->dev); 178 + if (!output->cec) 179 + return -ENOMEM; 180 + 177 181 return 0; 178 182 } 179 183 180 184 void tegra_output_remove(struct tegra_output *output) 181 185 { 186 + if (output->cec) 187 + cec_notifier_put(output->cec); 188 + 182 189 if (gpio_is_valid(output->hpd_gpio)) { 183 190 free_irq(output->hpd_irq, output); 184 191 gpio_free(output->hpd_gpio);