From: archit@ti•com (Archit Taneja)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 01/23] OMAPDSS: HDMI: lane config support
Date: Fri, 25 Apr 2014 15:36:13 +0530 [thread overview]
Message-ID: <535A3395.4050106@ti.com> (raw)
In-Reply-To: <1398334639-14172-2-git-send-email-tomi.valkeinen@ti.com>
Hi,
On Thursday 24 April 2014 03:46 PM, Tomi Valkeinen wrote:
> Add support to configure the pins used for the HDMI lanes. The order and
> polarity of the lanes can be defined in the DT data.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti•com>
> ---
> +static void hdmi_phy_configure_lanes(struct hdmi_phy_data *phy)
> +{
> + static const u16 pad_cfg_list[] = {
> + 0x0123,
> + 0x0132,
> + 0x0312,
> + 0x0321,
> + 0x0231,
> + 0x0213,
> + 0x1023,
> + 0x1032,
> + 0x3012,
> + 0x3021,
> + 0x2031,
> + 0x2013,
> + 0x1203,
> + 0x1302,
> + 0x3102,
> + 0x3201,
> + 0x2301,
> + 0x2103,
> + 0x1230,
> + 0x1320,
> + 0x3120,
> + 0x3210,
> + 0x2310,
> + 0x2130,
> + };
> +
> + u16 lane_cfg = 0;
> + int i;
> + unsigned lane_cfg_val;
> + u16 pol_val = 0;
> +
> + for (i = 0; i < 4; ++i)
> + lane_cfg |= phy->lane_function[i] << ((3 - i) * 4);
> +
> + pol_val |= phy->lane_polarity[0] << 0;
> + pol_val |= phy->lane_polarity[1] << 3;
> + pol_val |= phy->lane_polarity[2] << 2;
> + pol_val |= phy->lane_polarity[3] << 1;
> +
> + for (i = 0; i < ARRAY_SIZE(pad_cfg_list); ++i)
> + if (pad_cfg_list[i] == lane_cfg)
> + break;
> +
> + if (WARN_ON(i == ARRAY_SIZE(pad_cfg_list)))
> + i = 0;
> +
> + lane_cfg_val = i;
I spent some time to see if we could get create lane_cfg_val without
having the table above, looks like there is no pattern at all in the
register field.
> +
> + REG_FLD_MOD(phy->base, HDMI_TXPHY_PAD_CFG_CTRL, lane_cfg_val, 26, 22);
> + REG_FLD_MOD(phy->base, HDMI_TXPHY_PAD_CFG_CTRL, pol_val, 30, 27);
> +}
> +
> int hdmi_phy_enable(struct hdmi_phy_data *phy, struct hdmi_wp_data *wp,
> struct hdmi_config *cfg)
> {
> @@ -92,8 +183,7 @@ int hdmi_phy_enable(struct hdmi_phy_data *phy, struct hdmi_wp_data *wp,
> /* Setup max LDO voltage */
> REG_FLD_MOD(phy->base, HDMI_TXPHY_POWER_CTRL, 0xB, 3, 0);
>
> - /* Write to phy address 3 to change the polarity control */
> - REG_FLD_MOD(phy->base, HDMI_TXPHY_PAD_CFG_CTRL, 0x1, 27, 27);
wow, didn't realize it was hardcoded like this.
Reviewed-by: Archit Taneja <archit@ti•com?
Archit
next prev parent reply other threads:[~2014-04-25 10:06 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 10:16 [PATCH 00/23] OMAPDSS: OMAP5 display support Tomi Valkeinen
2014-04-24 10:16 ` [PATCH 01/23] OMAPDSS: HDMI: lane config support Tomi Valkeinen
2014-04-25 10:06 ` Archit Taneja [this message]
2014-04-25 10:28 ` Tomi Valkeinen
2014-04-24 10:16 ` [PATCH 02/23] Doc/DT: ti,omap4-dss: hdmi lanes Tomi Valkeinen
2014-04-24 10:16 ` [PATCH 03/23] OMAPDSS: HDMI4: set regulator voltage to 1.8V Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 04/23] OMAPDSS: DSI: " Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 05/23] ARM: OMAP: hwmod: OMAP5 DSS hwmod data Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 06/23] ARM: OMAP: add OMAP5 DSI muxing Tomi Valkeinen
2014-04-25 11:11 ` Archit Taneja
2014-04-25 11:18 ` Tomi Valkeinen
2014-04-25 12:58 ` Archit Taneja
2014-04-25 14:08 ` Tomi Valkeinen
2014-04-25 15:31 ` Tony Lindgren
2014-04-28 6:52 ` Tomi Valkeinen
2014-04-28 16:45 ` Tony Lindgren
2014-04-29 5:26 ` Tomi Valkeinen
2014-04-29 15:05 ` Tony Lindgren
2014-04-29 16:19 ` Tomi Valkeinen
2014-04-29 16:32 ` Tomi Valkeinen
2014-04-29 17:38 ` Tony Lindgren
2014-04-30 6:13 ` Tomi Valkeinen
2014-04-30 17:56 ` Tony Lindgren
2014-05-02 13:06 ` Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 07/23] ARM: OMAP: add detection of omap5-dss Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 08/23] ARM: dts: omap5-clocks.dtsi: add dss iclk Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 09/23] ARM: dts: omap5-clocks.dtsi: add ti, set-rate-parent to dss_dss_clk Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 10/23] ARM: dts: omap5.dtsi: add DSS nodes Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 11/23] ARM: dts: omap5-uevm.dts: add tca6424a Tomi Valkeinen
2014-04-24 13:49 ` Sergei Shtylyov
2014-04-24 14:33 ` Tomi Valkeinen
2014-04-24 16:53 ` Sergei Shtylyov
2014-04-25 14:20 ` Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 12/23] ARM: dts: omap5-uevm.dts: add display nodes Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 13/23] OMAPDSS: DSS & DISPC DT support for OMAP5 Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 14/23] OMAPDSS: features: fix OMAP5 features Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 15/23] OMAPDSS: DPI: fix LCD3 DSI source Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 16/23] OMAPDSS: DSI: Add OMAP5 DSI module IDs Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 17/23] OMAPDSS: HDMI: improve Makefile Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 18/23] OMAPDSS: HDMI: move irq & phy pwr handling Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 19/23] OMAPDSS: HDMI: support larger register offsets for OMAP5 HDMI core Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 20/23] OMAPDSS: HDMI: PHY changes for OMAP5 Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 21/23] OMAPDSS: HDMI: PLL " Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 22/23] OMAPDSS: HDMI: Add OMAP5 HDMI support Tomi Valkeinen
2014-04-24 10:17 ` [PATCH 23/23] Doc/DT: Add OMAP5 DSS DT bindings Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=535A3395.4050106@ti.com \
--to=archit@ti$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox