drm/sun4i: hdmi: Support HDMI controller on A31
Subsystems (5)
v4 cover drm/sun4i: hdmi: Support HDMI controller on A31
Hi everyone,
This is v4 of my A31 HDMI support series. The DTS patches depend on the patch "clk: sunxi-ng: sun6i: Export video PLLs" alreay merged. The DRM patches depend on "regmap: add iopoll-like polling macro for regmap_field" already merged on a topic branch in the regmap repository.
Changes since v3:
- Renamed sun4i_get_first_tcon() to sun4i_get_tcon0()
- Made sun4i_get_tcon0() return NULL when it fails, and sun6i_tcon_set_mux() will error out if that happens.
- Removed has_unknown_mux field in tcon_quirks structure, as its function is replaced by the per-soc muxing function pointer.
- Dropped clk and regmap patches that were merged.
Changes since v2:
- TCON muxing moved into functions for each platform, with pointers to them in the TCON quirks structure.
- CCU "hdmi-ddc" clock renamed to "ddc".
- Added Maxime's acks.
Changes since v1:
- Core changes to sun4i-drm to support two display pipelines have been merged into drm-misc and thus dropped from this version
- Reworked DDC variant support onto new exposed I2C interface bits.
- Reworked DDC variant support to use regmap_fields.
- Patches to add variant support to various (TMDS, DDC, HDMI controller) sub-blocks have been merged into one patch.
This series adds support for the HDMI controller found on Allwinner A31/A31s SoCs. It builds upon Maxime's work that added support for the HDMI controller on the Allwinner A10s SoC.
The HDMI controllers in the older generation Allwinner SoCs is very similar. The A10/A10s/A20 all have the same hardware block, with the A10 having slightly different initial configuration values. The A31's variant splits out the DDC parent clock, has different formulas for the DDC and TMDS clocks, and a different register layout for the DDC block. Also, it does not expose the CEC pins outside of the SoC, which is unfortunate.
Patch 1 moves the existing TCON muxing code for the A13 into a separate function, pointed to by by function pointer in the quirks structure. The existing sun4i_tcon_set_mux() function calls the function pointer if it is set.
Patch 2 adds support for the TCON demuxing feature on the A31. This is needed if the user wants to output through HDMI from the second display pipeline.
Patch 3 adds proper error path cleanup to the HDMI driver.
Patch 4 adds a regmap for the HDMI driver, to be used in a subsequent patch.
Patch 5 allows the HDMI TMDS clock to use the second PLL as its parent, in case the first PLL is driving an incompatible dot clock.
Patch 6 adds the A31 HDMI controller variant to the device tree binding.
Patch 7 adds support for different variants of the HDMI controller hardware, with the differences mentioned in the beginning of this letter.
Patch 8 adds defines for the A31 specific DDC register offsets.
Patch 9 adds support for the A31's HDMI controller variant.
Patch 10 adds a device node for the HDMI controller on the A31.
Patch 11 enable HDMI video output on three boards that I have.
I also had simultaneous output on both display pipelines on the SinA31s, one with an LCD panel and the other using HDMI. After boot, both screens showed a proper console. The HDMI screen had higher resolution, so the console was limited to the upper left corner.
Note that this series does not deal with conflicting pixel clocks.
As I still don't have a freedesktop.org account [1] to access drm-misc, Maxime will have to apply the patches for me.
Regards
ChenYu
[1] https://bugs.freedesktop.org/show_bug.cgi?id=102920
Chen-Yu Tsai (11):
drm/sun4i: tcon: Add variant callback for TCON output muxing drm/sun4i: tcon: Add support for demuxing TCON output on A31 drm/sun4i: hdmi: Disable clks in bind function error path and unbind
function
drm/sun4i: hdmi: create a regmap for later use
drm/sun4i: hdmi: Allow using second PLL as TMDS clk parent
dt-bindings: display: sun4i: Add binding for A31 HDMI controller drm/sun4i: hdmi: Add support for controller hardware variants drm/sun4i: hdmi: Add A31 specific DDC register definitions drm/sun4i: hdmi: Add support for A31's HDMI controller
ARM: dts: sun6i: Add device node for HDMI controller
ARM: dts: sun6i: Enable HDMI support on some A31/A31s devices
.../bindings/display/sunxi/sun4i-drm.txt | 3 + arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 21 ++ arch/arm/boot/dts/sun6i-a31.dtsi | 55 +++++ arch/arm/boot/dts/sun6i-a31s-primo81.dts | 25 +++ arch/arm/boot/dts/sun6i-a31s-sina31s.dts | 25 +++ drivers/gpu/drm/sun4i/sun4i_hdmi.h | 107 ++++++++++ drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 38 +++- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 204 +++++++++++++++--- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 227 +++++++++++++++------ drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 68 +++--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 91 +++++++-- drivers/gpu/drm/sun4i/sun4i_tcon.h | 6 +- 12 files changed, 727 insertions(+), 143 deletions(-)
Signature · 1 line
2.14.2
PATCH v4 1/11 drm/sun4i: tcon: Add variant callback for TCON output muxing
Different SoCs have different muxing options and values for the TCON outputs. Instead of stuffing every possibility in sun4i_tcon_set_mux(), add a callback pointer to sun4i_tcon_quirks that each TCON variant can use to provide muxing support.
The current muxing options in sun4i_tcon_set_mux() for sun5i-a13 are moved to a new sun5i-specific callback function.
Since the new callback replaces what the .has_unknown_mux field in tcon quirks did in the past, the field is removed.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 44 +++++++++++++++++++++++--------------- drivers/gpu/drm/sun4i/sun4i_tcon.h | 6 +++++- 2 files changed, 32 insertions(+), 18 deletions(-)
drivers/gpu/drm/sun4i/sun4i_tcon.c +27 -17
@@ -14,9 +14,12 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_encoder.h> #include <drm/drm_modes.h> #include <drm/drm_of.h> +#include <uapi/drm/drm_mode.h> +#include <linux/component.h> #include <linux/ioport.h> #include <linux/of_address.h>
@@ -112,23 +115,13 @@ EXPORT_SYMBOL(sun4i_tcon_enable_vblank);void sun4i_tcon_set_mux (struct sun4i_tcon *tcon,int channel,struct drm_encoder *encoder) { -u32 val; - -if (!tcon->quirks->has_unknown_mux) -return ; +int ret = -ENOTSUPP ; -if (channel !=1 ) -return ; - -if (encoder->encoder_type ==DRM_MODE_ENCODER_TVDAC ) - val =1 ; -else - val =0 ; +if (tcon->quirks->set_mux) + ret = tcon->quirks->set_mux (tcon, encoder); -/* -* FIXME: Undocumented bits -*/ -regmap_write (tcon->regs,SUN4I_TCON_MUX_CTRL_REG , val); +DRM_DEBUG_DRIVER ("Muxing encoder %s to CRTC %s: %d\n" , + encoder->name, encoder->crtc->name, ret); }EXPORT_SYMBOL (sun4i_tcon_set_mux);
@@ -767,9 +760,26 @@ static int sun4i_tcon_remove(struct platform_device *pdev)return 0 ; } +/* platform specific TCON muxing callbacks */ +static int sun5i_a13_tcon_set_mux (struct sun4i_tcon *tcon, +struct drm_encoder *encoder) +{ +u32 val; + +if (encoder->encoder_type ==DRM_MODE_ENCODER_TVDAC ) + val =1 ; +else + val =0 ; + +/* +* FIXME: Undocumented bits +*/ +return regmap_write (tcon->regs,SUN4I_TCON_MUX_CTRL_REG , val); +} +static const struct sun4i_tcon_quirks sun5i_a13_quirks = { - .has_unknown_mux = true, - .has_channel_1 = true, + .has_channel_1 = true, + .set_mux = sun5i_a13_tcon_set_mux, };static const struct sun4i_tcon_quirks sun6i_a31_quirks = {
drivers/gpu/drm/sun4i/sun4i_tcon.h +5 -1
@@ -145,10 +145,14 @@#define SUN4I_TCON_MAX_CHANNELS 2 +struct sun4i_tcon ; +struct sun4i_tcon_quirks { -bool has_unknown_mux;/* sun5i has undocumented mux */ bool has_channel_1;/* a33 does not have channel 1 */ bool needs_de_be_mux;/* sun6i needs mux to select backend */ + +/* callback to handle tcon muxing options */ +int (*set_mux)(struct sun4i_tcon *,struct drm_encoder *); };struct sun4i_tcon {
Signature · 1 line
2.14.2
PATCH v4 2/11 drm/sun4i: tcon: Add support for demuxing TCON output on A31
In reply to Chen-Yu TsaiOn systems with 2 TCONs such as the A31, it is possible to demux the output of the TCONs to one encoder.
Add support for this for the A31.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +47 -0
@@ -112,6 +112,27 @@ void sun4i_tcon_enable_vblank(struct sun4i_tcon *tcon, bool enable) }EXPORT_SYMBOL (sun4i_tcon_enable_vblank); +/* +* This function is a helper for TCON output muxing. The TCON output +* muxing control register in earlier SoCs (without the TCON TOP block) +* are located in TCON0. This helper returns a pointer to TCON0's +* sun4i_tcon structure, or NULL if not found. +*/ +static struct sun4i_tcon *sun4i_get_tcon0 (struct drm_device *drm) +{ +struct sun4i_drv *drv = drm->dev_private; +struct sun4i_tcon *tcon; + +list_for_each_entry (tcon, &drv->tcon_list, list) +if (tcon->id ==0 ) +return tcon; + +dev_warn (drm->dev, +"TCON0 not found, display output muxing may not work\n" ); + +return NULL ; +} +void sun4i_tcon_set_mux (struct sun4i_tcon *tcon,int channel,struct drm_encoder *encoder) {
@@ -777,6 +798,31 @@ static int sun5i_a13_tcon_set_mux(struct sun4i_tcon *tcon,return regmap_write (tcon->regs,SUN4I_TCON_MUX_CTRL_REG , val); } +static int sun6i_tcon_set_mux (struct sun4i_tcon *tcon, +struct drm_encoder *encoder) +{ +struct sun4i_tcon *tcon0 =sun4i_get_tcon0 (encoder->dev); +u32 shift; + +if (!tcon0) +return -EINVAL ; + +switch (encoder->encoder_type) { +case DRM_MODE_ENCODER_TMDS : +/* HDMI */ + shift =8 ; +break ; +default : +/* TODO A31 has MIPI DSI but A31s does not */ +return -EINVAL ; + } + +regmap_update_bits (tcon0->regs,SUN4I_TCON_MUX_CTRL_REG , +0x3 << shift, tcon->id << shift); + +return 0 ; +} +static const struct sun4i_tcon_quirks sun5i_a13_quirks = { .has_channel_1 = true, .set_mux = sun5i_a13_tcon_set_mux,
@@ -785,6 +831,7 @@ static const struct sun4i_tcon_quirks sun5i_a13_quirks = {static const struct sun4i_tcon_quirks sun6i_a31_quirks = { .has_channel_1 = true, .needs_de_be_mux = true, + .set_mux = sun6i_tcon_set_mux, };static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
Signature · 1 line
2.14.2
Re: [linux-sunxi] [PATCH v4 02/11] drm/sun4i: tcon: Add support for demuxing TCON output on A31
Hi Chen-Yu,
Quoted 6 lines · Chen-Yu Tsai
On systems with 2 TCONs such as the A31, it is possible to demux the output of the TCONs to one encoder.
Add support for this for the A31.
Signed-off-by Chen-Yu Tsai <[email protected]>
Thanks!
FWIW this is:
Signature · 8 lines
Julian Calaby Email: [email protected] Profile: http://www.google.com/profiles/julian.calaby/ -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v4 3/11 drm/sun4i: hdmi: Disable clks in bind function error path and unbind function
In reply to Chen-Yu TsaiThe HDMI driver enables the bus and mod clocks in the bind function, but does not disable them if it then bails our due to any errors. Neither does it disable the clocks in the unbind function.
Fix this by adding a proper error path to the bind function, and clk_disable_unprepare calls to the unbind function.
Also rename the err_cleanup_connector label to err_cleanup_encoder, since it is the encoder that gets cleaned up.
--- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +14 -5
@@ -302,26 +302,29 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, hdmi->mod_clk =devm_clk_get (dev,"mod" );if (IS_ERR (hdmi->mod_clk)) {dev_err (dev,"Couldn't get the HDMI mod clock\n" ); -return PTR_ERR (hdmi->mod_clk); + ret =PTR_ERR (hdmi->mod_clk); + goto err_disable_bus_clk; }clk_prepare_enable (hdmi->mod_clk); hdmi->pll0_clk =devm_clk_get (dev,"pll-0" );if (IS_ERR (hdmi->pll0_clk)) {dev_err (dev,"Couldn't get the HDMI PLL 0 clock\n" ); -return PTR_ERR (hdmi->pll0_clk); + ret =PTR_ERR (hdmi->pll0_clk); + goto err_disable_mod_clk; } hdmi->pll1_clk =devm_clk_get (dev,"pll-1" );if (IS_ERR (hdmi->pll1_clk)) {dev_err (dev,"Couldn't get the HDMI PLL 1 clock\n" ); -return PTR_ERR (hdmi->pll1_clk); + ret =PTR_ERR (hdmi->pll1_clk); + goto err_disable_mod_clk; } ret =sun4i_tmds_create (hdmi);if (ret) {dev_err (dev,"Couldn't create the TMDS clock\n" ); -return ret; + goto err_disable_mod_clk; }writel (SUN4I_HDMI_CTRL_ENABLE , hdmi->base +SUN4I_HDMI_CTRL_REG );
@@ -362,7 +365,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, ret =sun4i_hdmi_i2c_create (dev, hdmi);if (ret) {dev_err (dev,"Couldn't create the HDMI I2C adapter\n" ); -return ret; + goto err_disable_mod_clk; } drm_encoder_helper_add(&hdmi->encoder,
@@ -422,6 +425,10 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,drm_encoder_cleanup (&hdmi->encoder); err_del_i2c_adapter:i2c_del_adapter (hdmi->i2c); +err_disable_mod_clk: +clk_disable_unprepare (hdmi->mod_clk); +err_disable_bus_clk: +clk_disable_unprepare (hdmi->bus_clk);return ret; }
@@ -434,6 +441,8 @@ static void sun4i_hdmi_unbind(struct device *dev, struct device *master,drm_connector_cleanup (&hdmi->connector);drm_encoder_cleanup (&hdmi->encoder);i2c_del_adapter (hdmi->i2c); +clk_disable_unprepare (hdmi->mod_clk); +clk_disable_unprepare (hdmi->bus_clk); }static const struct component_ops sun4i_hdmi_ops = {
Signature · 1 line
2.14.2
PATCH v4 4/11 drm/sun4i: hdmi: create a regmap for later use
In reply to Chen-Yu TsaiThe HDMI driver is written with readl/writel I/O to the registers. However, to support the A31 variant, which has a different layout for the DDC registers, it was recommended to use regfields to have a cleaner implementation. To use regfields, we need to create an underlying regmap.
This patch only adds the regmap. It does not convert the existing driver accesses to use regmap.
--- drivers/gpu/drm/sun4i/sun4i_hdmi.h | 1 + drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+)
drivers/gpu/drm/sun4i/sun4i_hdmi.h +1 -0
@@ -163,6 +163,7 @@ struct sun4i_hdmi {struct device *dev;void __iomem *base; +struct regmap *regmap;/* Parent clocks */ struct clk *bus_clk;
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +15 -0
@@ -22,6 +22,7 @@#include <linux/iopoll.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/regmap.h> #include "sun4i_backend.h" #include "sun4i_crtc.h"
@@ -267,6 +268,13 @@ static const struct cec_pin_ops sun4i_hdmi_cec_pin_ops = { };#endif +static const struct regmap_config sun4i_hdmi_regmap_config = { + .reg_bits =32 , + .val_bits =32 , + .reg_stride =4 , + .max_register =0x580 , +}; +static int sun4i_hdmi_bind (struct device *dev,struct device *master,void *data) {
@@ -321,6 +329,13 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, goto err_disable_mod_clk; } + hdmi->regmap =devm_regmap_init_mmio (dev, hdmi->base, + &sun4i_hdmi_regmap_config); +if (IS_ERR (hdmi->regmap)) { +dev_err (dev,"Couldn't create HDMI encoder regmap\n" ); +return PTR_ERR (hdmi->regmap); + } + ret =sun4i_tmds_create (hdmi);if (ret) {dev_err (dev,"Couldn't create the TMDS clock\n" );
Signature · 1 line
2.14.2
PATCH v4 5/11 drm/sun4i: hdmi: Allow using second PLL as TMDS clk parent
In reply to Chen-Yu TsaiOn SoCs with two display pipelines, it is possible that the two pipelines are active at the same time, with potentially incompatible dot clocks.
Let the HDMI encoder's TMDS clock go through all of its parents when calculating possible clock rates. This allows usage of the second video PLL as its parent.
--- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 53 ++++++++++++++++------------- 1 file changed, 29 insertions(+), 24 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c +29 -24
@@ -67,11 +67,11 @@ static unsigned long sun4i_tmds_calc_divider(unsigned long rate,static int sun4i_tmds_determine_rate (struct clk_hw *hw,struct clk_rate_request *req) { -struct clk_hw *parent; +struct clk_hw *parent =NULL ;unsigned long best_parent =0 ;unsigned long rate = req->rate;int best_div =1 , best_half =1 ; -int i, j; +int i, j, p;/* * We only consider PLL3, since the TCON is very likely to be
@@ -79,32 +79,37 @@ static int sun4i_tmds_determine_rate(struct clk_hw *hw,* clock, so we should not need to do anything. */ - parent =clk_hw_get_parent_by_index (hw,0 ); -if (!parent) -return -EINVAL ; - -for (i =1 ; i <3 ; i++) { -for (j =1 ; j <16 ; j++) { -unsigned long ideal = rate * i * j; -unsigned long rounded; - - rounded =clk_hw_round_rate (parent, ideal); - -if (rounded == ideal) { - best_parent = rounded; - best_half = i; - best_div = j; - goto out; - } - -if (abs (rate - rounded / i) < -abs (rate - best_parent / best_div)) { - best_parent = rounded; - best_div = i; +for (p =0 ; p <clk_hw_get_num_parents (hw); p++) { + parent =clk_hw_get_parent_by_index (hw, p); +if (!parent) +continue ; + +for (i =1 ; i <3 ; i++) { +for (j =1 ; j <16 ; j++) { +unsigned long ideal = rate * i * j; +unsigned long rounded; + + rounded =clk_hw_round_rate (parent, ideal); + +if (rounded == ideal) { + best_parent = rounded; + best_half = i; + best_div = j; + goto out; + } + +if (abs (rate - rounded / i) < +abs (rate - best_parent / best_div)) { + best_parent = rounded; + best_div = i; + } } } } +if (!parent) +return -EINVAL ; + out: req->rate = best_parent / best_half / best_div; req->best_parent_rate = best_parent;
Signature · 1 line
2.14.2
PATCH v4 6/11 dt-bindings: display: sun4i: Add binding for A31 HDMI controller
In reply to Chen-Yu TsaiThe HDMI controller in the A31 SoC is slightly different from the earlier version. In addition to the TMDS clock and DDC controls, this version now takes a second DDC clock input.
Add a compatible string for it, and add the DDC clock input to the list of clocks required.
--- Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt +3 -0
@@ -41,14 +41,17 @@ CEC. It is one end of the pipeline. Required properties: - compatible: value must be one of: * allwinner,sun5i-a10s-hdmi + * allwinner,sun6i-a31-hdmi - reg: base address and size of memory-mapped region - interrupts: interrupt associated to this IP - clocks: phandles to the clocks feeding the HDMI encoder * ahb: the HDMI interface clock * mod: the HDMI module clock + * ddc: the HDMI ddc clock (A31 only) * pll-0: the first video PLL * pll-1: the second video PLL - clock-names: the clock names mentioned above + - resets: phandle to the reset control for the HDMI encoder (A31 only) - dmas: phandles to the DMA channels used by the HDMI encoder * ddc-tx: The channel for DDC transmission * ddc-rx: The channel for DDC reception
Signature · 1 line
2.14.2
PATCH v4 7/11 drm/sun4i: hdmi: Add support for controller hardware variants
In reply to Chen-Yu TsaiThe HDMI controller found in earlier Allwinner SoCs have slight differences between the A10, A10s, and the A31:
- Need different initial values for the PLL related registers
- Different behavior of the DDC and TMDS clocks
- Different register layout for the DDC portion
- Separate DDC parent clock on the A31
- Explicit reset control
For the A31, the HDMI TMDS clock has a different value offset for the divider. The HDMI DDC block is different from the one in the other SoCs. As far as the DDC clock goes, it has no pre-divider, as it is clocked from a slower parent clock, not the TMDS clock. The divider offset from the register value is different. And the clock control register is at a different offset.
A new variant data structure is created to store pointers to the above functions, structures, and the different initial values. Another flag notates whether there is a separate DDC parent clock. If not, the TMDS clock is passed to the DDC clock create function, as before.
Regmap fields are used to deal with the different register layout of the DDC block.
--- drivers/gpu/drm/sun4i/sun4i_hdmi.h | 72 +++++++++ drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 38 +++-- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 112 +++++++++++--- drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 227 ++++++++++++++++++++-------- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 17 ++- 5 files changed, 369 insertions(+), 97 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi.h +72 -0
@@ -14,6 +14,7 @@#include <drm/drm_connector.h> #include <drm/drm_encoder.h> +#include <linux/regmap.h> #include <media/cec-pin.h>
@@ -157,6 +158,55 @@ enum sun4i_hdmi_pkt_type { SUN4I_HDMI_PKT_END = 15, }; +struct sun4i_hdmi_variant { +bool has_ddc_parent_clk; +bool has_reset_control; + +u32 pad_ctrl0_init_val; +u32 pad_ctrl1_init_val; +u32 pll_ctrl_init_val; + +struct reg_field ddc_clk_reg; +u8 ddc_clk_pre_divider; +u8 ddc_clk_m_offset; + +u8 tmds_clk_div_offset; + +/* Register fields for I2C adapter */ +struct reg_field field_ddc_en; +struct reg_field field_ddc_start; +struct reg_field field_ddc_reset; +struct reg_field field_ddc_addr_reg; +struct reg_field field_ddc_slave_addr; +struct reg_field field_ddc_int_mask; +struct reg_field field_ddc_int_status; +struct reg_field field_ddc_fifo_clear; +struct reg_field field_ddc_fifo_rx_thres; +struct reg_field field_ddc_fifo_tx_thres; +struct reg_field field_ddc_byte_count; +struct reg_field field_ddc_cmd; +struct reg_field field_ddc_sda_en; +struct reg_field field_ddc_sck_en; + +/* DDC FIFO register offset */ +u32 ddc_fifo_reg; + +/* +* DDC FIFO threshold boundary conditions +* +* This is used to cope with the threshold boundary condition +* being slightly different on sun5i and sun6i. +* +* On sun5i the threshold is exclusive, i.e. does not include, +* the value of the threshold. ( > for RX; < for TX ) +* On sun6i the threshold is inclusive, i.e. includes, the +* value of the threshold. ( >= for RX; <= for TX ) +*/ +bool ddc_fifo_thres_incl; + +bool ddc_fifo_has_dir; +}; +struct sun4i_hdmi {struct drm_connector connector;struct drm_encoder encoder;
@@ -165,9 +215,13 @@ struct sun4i_hdmi {void __iomem *base;struct regmap *regmap; +/* Reset control */ +struct reset_control *reset; +/* Parent clocks */ struct clk *bus_clk;struct clk *mod_clk; +struct clk *ddc_parent_clk;struct clk *pll0_clk;struct clk *pll1_clk;
@@ -177,10 +231,28 @@ struct sun4i_hdmi {struct i2c_adapter *i2c; +/* Regmap fields for I2C adapter */ +struct regmap_field *field_ddc_en; +struct regmap_field *field_ddc_start; +struct regmap_field *field_ddc_reset; +struct regmap_field *field_ddc_addr_reg; +struct regmap_field *field_ddc_slave_addr; +struct regmap_field *field_ddc_int_mask; +struct regmap_field *field_ddc_int_status; +struct regmap_field *field_ddc_fifo_clear; +struct regmap_field *field_ddc_fifo_rx_thres; +struct regmap_field *field_ddc_fifo_tx_thres; +struct regmap_field *field_ddc_byte_count; +struct regmap_field *field_ddc_cmd; +struct regmap_field *field_ddc_sda_en; +struct regmap_field *field_ddc_sck_en; +struct sun4i_drv *drv;bool hdmi_monitor;struct cec_adapter *cec_adap; + +const struct sun4i_hdmi_variant *variant; };int sun4i_ddc_create (struct sun4i_hdmi *hdmi,struct clk *clk);
drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c +29 -9
@@ -11,6 +11,7 @@*/ #include <linux/clk-provider.h> +#include <linux/regmap.h> #include "sun4i_tcon.h" #include "sun4i_hdmi.h"
@@ -18,6 +19,9 @@struct sun4i_ddc {struct clk_hw hw;struct sun4i_hdmi *hdmi; +struct regmap_field *reg; +u8 pre_div; +u8 m_offset; };static inline struct sun4i_ddc *hw_to_ddc (struct clk_hw *hw)
@@ -27,6 +31,8 @@ static inline struct sun4i_ddc *hw_to_ddc(struct clk_hw *hw)static unsigned long sun4i_ddc_calc_divider (unsigned long rate,unsigned long parent_rate, +const u8 pre_div, +const u8 m_offset,u8 *m,u8 *n) {unsigned long best_rate =0 ;
@@ -36,7 +42,8 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,for (_n =0 ; _n <8 ; _n++) {unsigned long tmp_rate; - tmp_rate = (((parent_rate /2 ) /10 ) >> _n) / (_m +1 ); + tmp_rate = (((parent_rate / pre_div) /10 ) >> _n) / + (_m + m_offset);if (tmp_rate > rate)continue ;
@@ -60,21 +67,25 @@ static unsigned long sun4i_ddc_calc_divider(unsigned long rate,static long sun4i_ddc_round_rate (struct clk_hw *hw,unsigned long rate,unsigned long *prate) { -return sun4i_ddc_calc_divider (rate, *prate,NULL ,NULL ); +struct sun4i_ddc *ddc =hw_to_ddc (hw); + +return sun4i_ddc_calc_divider (rate, *prate, ddc->pre_div, + ddc->m_offset,NULL ,NULL ); }static unsigned long sun4i_ddc_recalc_rate (struct clk_hw *hw,unsigned long parent_rate) {struct sun4i_ddc *ddc =hw_to_ddc (hw); -u32 reg; +unsigned int reg;u8 m, n; - reg =readl (ddc->hdmi->base +SUN4I_HDMI_DDC_CLK_REG ); - m = (reg >>3 ) &0x7 ; +regmap_field_read (ddc->reg, ®); + m = (reg >>3 ) &0xf ; n = reg &0x7 ; -return (((parent_rate /2 ) /10 ) >> n) / (m +1 ); +return (((parent_rate / ddc->pre_div) /10 ) >> n) / + (m + ddc->m_offset); } static int sun4i_ddc_set_rate(struct clk_hw *hw, unsigned long rate,
@@ -83,10 +94,12 @@ static int sun4i_ddc_set_rate(struct clk_hw *hw, unsigned long rate,struct sun4i_ddc *ddc =hw_to_ddc (hw);u8 div_m, div_n; -sun4i_ddc_calc_divider (rate, parent_rate, &div_m, &div_n); +sun4i_ddc_calc_divider (rate, parent_rate, ddc->pre_div, + ddc->m_offset, &div_m, &div_n); -writel (SUN4I_HDMI_DDC_CLK_M (div_m) |SUN4I_HDMI_DDC_CLK_N (div_n), - ddc->hdmi->base +SUN4I_HDMI_DDC_CLK_REG ); +regmap_field_write (ddc->reg, +SUN4I_HDMI_DDC_CLK_M (div_m) | +SUN4I_HDMI_DDC_CLK_N (div_n));return 0 ; }
@@ -111,6 +124,11 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent)if (!ddc)return -ENOMEM ; + ddc->reg =devm_regmap_field_alloc (hdmi->dev, hdmi->regmap, + hdmi->variant->ddc_clk_reg); +if (IS_ERR (ddc->reg)) +return PTR_ERR (ddc->reg); + init.name ="hdmi-ddc" ; init.ops = &sun4i_ddc_ops; init.parent_names = &parent_name;
@@ -118,6 +136,8 @@ int sun4i_ddc_create(struct sun4i_hdmi *hdmi, struct clk *parent) ddc->hdmi = hdmi; ddc->hw.init = &init; + ddc->pre_div = hdmi->variant->ddc_clk_pre_divider; + ddc->m_offset = hdmi->variant->ddc_clk_m_offset; hdmi->ddc_clk =devm_clk_register (hdmi->dev, &ddc->hw);if (IS_ERR (hdmi->ddc_clk))
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +92 -20
172 lines not on this page · raw message
drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c +164 -63
295 lines not on this page · raw message
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c +12 -5
@@ -18,6 +18,8 @@struct sun4i_tmds {struct clk_hw hw;struct sun4i_hdmi *hdmi; + +u8 div_offset; };static inline struct sun4i_tmds *hw_to_tmds (struct clk_hw *hw)
@@ -28,6 +30,7 @@ static inline struct sun4i_tmds *hw_to_tmds(struct clk_hw *hw)static unsigned long sun4i_tmds_calc_divider (unsigned long rate,unsigned long parent_rate, +u8 div_offset,u8 *div,bool *half) {
@@ -35,7 +38,7 @@ static unsigned long sun4i_tmds_calc_divider(unsigned long rate,u8 best_m =0 , m;bool is_double; -for (m =1 ; m <16 ; m++) { +for (m = div_offset ?:1 ; m < (16 + div_offset); m++) {u8 d;for (d =1 ; d <3 ; d++) {
@@ -67,6 +70,7 @@ static unsigned long sun4i_tmds_calc_divider(unsigned long rate,static int sun4i_tmds_determine_rate (struct clk_hw *hw,struct clk_rate_request *req) { +struct sun4i_tmds *tmds =hw_to_tmds (hw);struct clk_hw *parent =NULL ;unsigned long best_parent =0 ;unsigned long rate = req->rate;
@@ -85,7 +89,8 @@ static int sun4i_tmds_determine_rate(struct clk_hw *hw,continue ;for (i =1 ; i <3 ; i++) { -for (j =1 ; j <16 ; j++) { +for (j = tmds->div_offset ?:1 ; + j < (16 + tmds->div_offset); j++) {unsigned long ideal = rate * i * j;unsigned long rounded;
@@ -129,7 +134,7 @@ static unsigned long sun4i_tmds_recalc_rate(struct clk_hw *hw, parent_rate /=2 ; reg =readl (tmds->hdmi->base +SUN4I_HDMI_PLL_CTRL_REG ); - reg = (reg >>4 ) &0xf ; + reg = ((reg >>4 ) &0xf ) + tmds->div_offset;if (!reg) reg =1 ;
@@ -144,7 +149,8 @@ static int sun4i_tmds_set_rate(struct clk_hw *hw, unsigned long rate,u32 reg;u8 div; -sun4i_tmds_calc_divider (rate, parent_rate, &div, &half); +sun4i_tmds_calc_divider (rate, parent_rate, tmds->div_offset, + &div, &half); reg =readl (tmds->hdmi->base +SUN4I_HDMI_PAD_CTRL1_REG ); reg &= ~SUN4I_HDMI_PAD_CTRL1_HALVE_CLK ;
@@ -154,7 +160,7 @@ static int sun4i_tmds_set_rate(struct clk_hw *hw, unsigned long rate, reg =readl (tmds->hdmi->base +SUN4I_HDMI_PLL_CTRL_REG ); reg &= ~SUN4I_HDMI_PLL_CTRL_DIV_MASK ; -writel (reg |SUN4I_HDMI_PLL_CTRL_DIV (div), +writel (reg |SUN4I_HDMI_PLL_CTRL_DIV (div - tmds->div_offset), tmds->hdmi->base +SUN4I_HDMI_PLL_CTRL_REG );return 0 ;
@@ -221,6 +227,7 @@ int sun4i_tmds_create(struct sun4i_hdmi *hdmi) tmds->hdmi = hdmi; tmds->hw.init = &init; + tmds->div_offset = hdmi->variant->tmds_clk_div_offset; hdmi->tmds_clk =devm_clk_register (hdmi->dev, &tmds->hw);if (IS_ERR (hdmi->tmds_clk))
Signature · 1 line
2.14.2
PATCH v4 8/11 drm/sun4i: hdmi: Add A31 specific DDC register definitions
In reply to Chen-Yu TsaiThe DDC block for the HDMI controller is different on the A31.
This patch adds the register definitions.
--- drivers/gpu/drm/sun4i/sun4i_hdmi.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/gpu/drm/sun4i/sun4i_hdmi.h +31 -0
@@ -153,6 +153,37 @@#define SUN4I_HDMI_DDC_FIFO_SIZE 16 +/* A31 specific */ +#define SUN6I_HDMI_DDC_CTRL_REG 0x500 +#define SUN6I_HDMI_DDC_CTRL_RESET BIT(31) +#define SUN6I_HDMI_DDC_CTRL_START_CMD BIT(27) +#define SUN6I_HDMI_DDC_CTRL_SDA_ENABLE BIT(6) +#define SUN6I_HDMI_DDC_CTRL_SCL_ENABLE BIT(4) +#define SUN6I_HDMI_DDC_CTRL_ENABLE BIT(0) + +#define SUN6I_HDMI_DDC_CMD_REG 0x508 +#define SUN6I_HDMI_DDC_CMD_BYTE_COUNT (count) ((count) << 16) +/* command types in lower 3 bits are the same as sun4i */ + +#define SUN6I_HDMI_DDC_ADDR_REG 0x50c +#define SUN6I_HDMI_DDC_ADDR_SEGMENT (seg) (((seg) & 0xff) << 24) +#define SUN6I_HDMI_DDC_ADDR_EDDC (addr) (((addr) & 0xff) << 16) +#define SUN6I_HDMI_DDC_ADDR_OFFSET (off) (((off) & 0xff) << 8) +#define SUN6I_HDMI_DDC_ADDR_SLAVE (addr) (((addr) & 0xff) << 1) + +#define SUN6I_HDMI_DDC_INT_STATUS_REG 0x514 +#define SUN6I_HDMI_DDC_INT_STATUS_TIMEOUT BIT(8) +/* lower 8 bits are the same as sun4i */ + +#define SUN6I_HDMI_DDC_FIFO_CTRL_REG 0x518 +#define SUN6I_HDMI_DDC_FIFO_CTRL_CLEAR BIT(15) +/* lower 9 bits are the same as sun4i */ + +#define SUN6I_HDMI_DDC_CLK_REG 0x520 +/* DDC CLK bit fields are the same, but the formula is not */ + +#define SUN6I_HDMI_DDC_FIFO_DATA_REG 0x580 +enum sun4i_hdmi_pkt_type {SUN4I_HDMI_PKT_AVI =2 ,SUN4I_HDMI_PKT_END =15 ,
Signature · 1 line
2.14.2
PATCH v4 9/11 drm/sun4i: hdmi: Add support for A31's HDMI controller
In reply to Chen-Yu TsaiThe HDMI controller found in the A31 SoCs is slightly different from the one already supported, which is found in the A10s:
- Need different initial values for the PLL related registers
- Different behavior of the DDC and TMDS clocks
- Different register layout for the DDC portion
- Separate DDC parent clock
This patch adds support for it.
--- drivers/gpu/drm/sun4i/sun4i_hdmi.h | 3 ++ drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)
drivers/gpu/drm/sun4i/sun4i_hdmi.h +3 -0
@@ -59,10 +59,13 @@#define SUN4I_HDMI_PAD_CTRL0_TXEN BIT(23)#define SUN4I_HDMI_PAD_CTRL1_REG 0x204 +#define SUN4I_HDMI_PAD_CTRL1_UNKNOWN BIT(24)/* set on A31 */ #define SUN4I_HDMI_PAD_CTRL1_AMP_OPT BIT(23)#define SUN4I_HDMI_PAD_CTRL1_AMPCK_OPT BIT(22)#define SUN4I_HDMI_PAD_CTRL1_EMP_OPT BIT(20)#define SUN4I_HDMI_PAD_CTRL1_EMPCK_OPT BIT(19) +#define SUN4I_HDMI_PAD_CTRL1_PWSCK BIT(18) +#define SUN4I_HDMI_PAD_CTRL1_PWSDT BIT(17)#define SUN4I_HDMI_PAD_CTRL1_REG_DEN BIT(15)#define SUN4I_HDMI_PAD_CTRL1_REG_DENCK BIT(14)#define SUN4I_HDMI_PAD_CTRL1_REG_EMP (n) (((n) & 7) << 10)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +58 -0
70 lines not on this page · raw message
Signature · 1 line
2.14.2
PATCH v4 10/11 ARM: dts: sun6i: Add device node for HDMI controller
In reply to Chen-Yu TsaiNow that we support the HDMI controller on the A31 SoC, we can add it to the device tree.
This adds a device node for the HDMI controller, and the of_graph nodes connecting it to the 2 TCONs.
--- arch/arm/boot/dts/sun6i-a31.dtsi | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +55 -0
@@ -289,6 +289,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; + + tcon0_out_hdmi: endpoint@1 { + reg = <1>; + remote-endpoint = <&hdmi_in_tcon0>; + allwinner,tcon-channel = <1>; + }; }; }; };
@@ -331,6 +337,12 @@ #address-cells = <1>; #size-cells = <0>; reg = <1>; + + tcon1_out_hdmi: endpoint@1 { + reg = <1>; + remote-endpoint = <&hdmi_in_tcon1>; + allwinner,tcon-channel = <1>; + }; }; }; };
@@ -411,6 +423,49 @@ #size-cells = <0>; }; + hdmi: hdmi@01c16000 { + compatible = "allwinner,sun6i-a31-hdmi"; + reg = <0x01c16000 0x1000>; + interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&ccu CLK_AHB1_HDMI>, <&ccu CLK_HDMI>, + <&ccu CLK_HDMI_DDC>, + <&ccu CLK_PLL_VIDEO0_2X>, + <&ccu CLK_PLL_VIDEO1_2X>; + clock-names = "ahb", "mod", "ddc", "pll-0", "pll-1"; + resets = <&ccu RST_AHB1_HDMI>; + reset-names = "ahb"; + dma-names = "ddc-tx", "ddc-rx", "audio-tx"; + dmas = <&dma 13>, <&dma 13>, <&dma 14>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in: port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + hdmi_in_tcon0: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_hdmi>; + }; + + hdmi_in_tcon1: endpoint@1 { + reg = <1>; + remote-endpoint = <&tcon1_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + }; + }; + usb_otg: usb@01c19000 { compatible = "allwinner,sun6i-a31-musb"; reg = <0x01c19000 0x0400>;
Signature · 1 line
2.14.2
PATCH v4 11/11 ARM: dts: sun6i: Enable HDMI support on some A31/A31s devices
In reply to Chen-Yu TsaiAll the A31/A31s devices I own have some kind of HDMI connector wired to the dedicated HDMI pins on the SoC:
- A31 Hummingbird (standard HDMI connector, display already enabled)
- Sinlinx SinA31s (standard HDMI connector)
- MSI Primo81 tablet (micro HDMI connector)
Enable the display pipeline (if needed) and HDMI output for them.
--- arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 21 +++++++++++++++++++++ arch/arm/boot/dts/sun6i-a31s-primo81.dts | 25 +++++++++++++++++++++++++ arch/arm/boot/dts/sun6i-a31s-sina31s.dts | 25 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+)
arch/arm/boot/dts/sun6i-a31-hummingbird.dts +21 -0
@@ -62,6 +62,17 @@ stdout-path = "serial0:115200n8"; }; + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + vga-connector { compatible = "vga-connector";
@@ -162,6 +173,16 @@ }; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + &i2c0 { pinctrl-names = "default"; pinctrl-0 = <&i2c0_pins_a>;
arch/arm/boot/dts/sun6i-a31s-primo81.dts +25 -0
@@ -52,17 +52,42 @@ / { model = "MSI Primo81 tablet"; compatible = "msi,primo81", "allwinner,sun6i-a31s"; + + hdmi-connector { + compatible = "hdmi-connector"; + type = "c"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; }; &cpu0 { cpu-supply = <®_dcdc3>; }; +&de { + status = "okay"; +}; + &ehci0 { /* rtl8188etv wifi is connected here */ status = "okay"; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + &i2c0 { /* pull-ups and device VDDIO use AXP221 DLDO3 */ pinctrl-names = "default";
arch/arm/boot/dts/sun6i-a31s-sina31s.dts +25 -0
@@ -53,6 +53,17 @@ stdout-path = "serial0:115200n8"; }; + hdmi-connector { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default";
@@ -90,6 +101,10 @@ status = "okay"; }; +&de { + status = "okay"; +}; + &ehci0 { /* USB 2.0 4 port hub IC */ status = "okay";
@@ -112,6 +127,16 @@ }; }; +&hdmi { + status = "okay"; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + &ir { pinctrl-names = "default"; pinctrl-0 = <&ir_pins_a>;
Signature · 1 line
2.14.2
Quoted 46 lines · Chen-Yu Tsai
Hi everyone,
This is v4 of my A31 HDMI support series. The DTS patches depend on the patch "clk: sunxi-ng: sun6i: Export video PLLs" alreay merged. The DRM patches depend on "regmap: add iopoll-like polling macro for
regmap_field" already merged on a topic branch in the regmap repository.Changes since v3:
- Renamed
sun4i_get_first_tcon()tosun4i_get_tcon0()- Made
sun4i_get_tcon0()return NULL when it fails, andsun6i_tcon_set_mux()will error out if that happens.- Removed
has_unknown_muxfield intcon_quirksstructure, as its function is replaced by the per-soc muxing function pointer.- Dropped clk and regmap patches that were merged.
Changes since v2:
- TCON muxing moved into functions for each platform, with pointers to them in the TCON quirks structure.
- CCU "hdmi-ddc" clock renamed to "ddc".
- Added Maxime's acks.
Changes since v1:
- Core changes to sun4i-drm to support two display pipelines have been merged into drm-misc and thus dropped from this version
- Reworked DDC variant support onto new exposed I2C interface bits.
- Reworked DDC variant support to use
regmap_fields.- Patches to add variant support to various (TMDS, DDC, HDMI controller) sub-blocks have been merged into one patch.
This series adds support for the HDMI controller found on Allwinner A31/A31s SoCs. It builds upon Maxime's work that added support for the HDMI controller on the Allwinner A10s SoC.
Quoted 6 lines
The HDMI controllers in the older generation Allwinner SoCs is very similar. The A10/A10s/A20 all have the same hardware block, with the A10 having slightly different initial configuration values. The A31's variant splits out the DDC parent clock, has different formulas for the DDC and TMDS clocks, and a different register layout for the DDC block.
Applied everything, thanks!
Quoted 2 lines
Also, it does not expose the CEC pins outside of the SoC, which is unfortunate.
Maybe we shouldn't register the CEC adapter in that case then? Can you send an additional patch for that?
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Quoted 47 lines · Maxime Ripard
Quoted 46 lines · Chen-Yu Tsai
Hi everyone,
This is v4 of my A31 HDMI support series. The DTS patches depend on the patch "clk: sunxi-ng: sun6i: Export video PLLs" alreay merged. The DRM patches depend on "regmap: add iopoll-like polling macro for
regmap_field" already merged on a topic branch in the regmap repository.Changes since v3:
- Renamed
sun4i_get_first_tcon()tosun4i_get_tcon0()- Made
sun4i_get_tcon0()return NULL when it fails, andsun6i_tcon_set_mux()will error out if that happens.- Removed
has_unknown_muxfield intcon_quirksstructure, as its function is replaced by the per-soc muxing function pointer.- Dropped clk and regmap patches that were merged.
Changes since v2:
- TCON muxing moved into functions for each platform, with pointers to them in the TCON quirks structure.
- CCU "hdmi-ddc" clock renamed to "ddc".
- Added Maxime's acks.
Changes since v1:
- Core changes to sun4i-drm to support two display pipelines have been merged into drm-misc and thus dropped from this version
- Reworked DDC variant support onto new exposed I2C interface bits.
- Reworked DDC variant support to use
regmap_fields.- Patches to add variant support to various (TMDS, DDC, HDMI controller) sub-blocks have been merged into one patch.
This series adds support for the HDMI controller found on Allwinner A31/A31s SoCs. It builds upon Maxime's work that added support for the HDMI controller on the Allwinner A10s SoC.
Quoted 8 lines
Quoted 6 lines
The HDMI controllers in the older generation Allwinner SoCs is very similar. The A10/A10s/A20 all have the same hardware block, with the A10 having slightly different initial configuration values. The A31's variant splits out the DDC parent clock, has different formulas for the DDC and TMDS clocks, and a different register layout for the DDC block.
Applied everything, thanks!
Looks like regmap/topic/field (which holds a required patch) was not merged in. This means there will be some build breakage on drm-misc.
Quoted 5 lines
Quoted 2 lines
Also, it does not expose the CEC pins outside of the SoC, which is unfortunate.
Maybe we shouldn't register the CEC adapter in that case then? Can you send an additional patch for that?
My bad. This series started off pre-CEC support. I'll send another patch for that.
ChenYu
Quoted 8 lines
Thanks!
Maxime--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com