summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2018-03-01 22:34:36 +0100
committerMaxime Ripard <maxime.ripard@bootlin.com>2018-03-02 08:45:29 +0100
commit6fd903102c9d9e1c2807d5fbbf011b44f122b20d (patch)
tree88fa27d7d2fdefc865f5b731b33fa1384354aae9 /drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
parente420ccd66d36e4ac2035620286495ce13a40b7f7 (diff)
downloadop-kernel-dev-6fd903102c9d9e1c2807d5fbbf011b44f122b20d.zip
op-kernel-dev-6fd903102c9d9e1c2807d5fbbf011b44f122b20d.tar.gz
drm/sun4i: Add support for variants to DW HDMI PHY
There are multiple variants of DW HDMI PHYs in Allwinner SoCs. While some things like clock and reset setup are the same, PHY configuration differs a lot. Split out code which is PHY specific to separate functions and create a structure which holds pointers to those functions. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-11-jernej.skrabec@siol.net
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h')
-rw-r--r--drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
index d8d0684..1e9eb60 100644
--- a/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
+++ b/drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
@@ -12,11 +12,23 @@
#include <linux/regmap.h>
#include <linux/reset.h>
+struct sun8i_hdmi_phy;
+
+struct sun8i_hdmi_phy_variant {
+ void (*phy_init)(struct sun8i_hdmi_phy *phy);
+ void (*phy_disable)(struct dw_hdmi *hdmi,
+ struct sun8i_hdmi_phy *phy);
+ int (*phy_config)(struct dw_hdmi *hdmi,
+ struct sun8i_hdmi_phy *phy,
+ unsigned int clk_rate);
+};
+
struct sun8i_hdmi_phy {
- struct clk *clk_bus;
- struct clk *clk_mod;
- struct regmap *regs;
- struct reset_control *rst_phy;
+ struct clk *clk_bus;
+ struct clk *clk_mod;
+ struct regmap *regs;
+ struct reset_control *rst_phy;
+ struct sun8i_hdmi_phy_variant *variant;
};
struct sun8i_dw_hdmi {
OpenPOWER on IntegriCloud