From: mfuzzey@parkeon.com (Martin Fuzzey)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 01/11] staging: drm/imx: Add LDB support
Date: Wed, 27 Mar 2013 19:40:51 +0100 [thread overview]
Message-ID: <51533D33.8060305@parkeon.com> (raw)
In-Reply-To: <1364405445-5271-2-git-send-email-p.zabel@pengutronix.de>
Hi Philipp,
On 27/03/13 18:30, Philipp Zabel wrote:
> +static bool imx_ldb_encoder_mode_fixup(struct drm_encoder *encoder,
> + const struct drm_display_mode *mode,
> + struct drm_display_mode *adjusted_mode)
> +{
> +/*
> + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
> +
> + adjusted_mode->clock = clk_round_rate(imx_ldb_ch->ldb->clk_pll[imx_ldb_ch->chno],
> + adjusted_mode->clock * 1000) / 1000;
> +*/
This should probably be removed :)
> +static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno,
> + unsigned long serial_clk, unsigned long di_clk)
> +{
> + int ret;
> +
> + dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__,
> + clk_get_rate(ldb->clk_pll[chno]), serial_clk);
> + clk_set_rate(ldb->clk_pll[chno], serial_clk);
> +
> + dev_dbg(ldb->dev, "%s after: %ld\n", __func__,
> + clk_get_rate(ldb->clk_pll[chno]));
> +
> + dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__,
> + clk_get_rate(ldb->clk[chno]),
> + (long int)di_clk);
> + clk_set_rate(ldb->clk[chno], di_clk);
> +
> + dev_dbg(ldb->dev, "%s after: %ld\n", __func__,
> + clk_get_rate(ldb->clk[chno]));
> +
Are all these debug statements still useful?
> +static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
> +{
> + if (imx_ldb_ch == &ldb->channel[0] || dual) {
> + ldb->ldb_ctrl &= ~0x3;
> + if (mux == 0 || ldb->lvds_mux)
> + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0;
> + else if (mux == 1)
> + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1;
> + }
> + if (imx_ldb_ch == &ldb->channel[1] || dual) {
> + ldb->ldb_ctrl &= ~0xc;
> + if (mux == 1 || ldb->lvds_mux)
> + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1;
> + else if (mux == 0)
> + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0;
> + }
Maybe avoid the magic 0x3 and 0x0c by building from LDB_CHx_MODE_EN_TO_DIx?
> +
> +static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
> +{
> + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
> + struct imx_ldb *ldb = imx_ldb_ch->ldb;
> +
> + /*
> + * imx_ldb_encoder_disable is called by
> + * drm_helper_disable_unused_functions without
> + * the encoder being enabled before.
> + */
> + if (imx_ldb_ch == &ldb->channel[0] && (ldb->ldb_ctrl & 0x3) == 0)
> + return;
> + else if (imx_ldb_ch == &ldb->channel[1] && (ldb->ldb_ctrl & 0xc) == 0)
> + return;
> +
> + if (imx_ldb_ch == &ldb->channel[0])
> + ldb->ldb_ctrl &= ~0x3;
> + else if (imx_ldb_ch == &ldb->channel[1])
> + ldb->ldb_ctrl &= ~0xc;
> +
Idem magic numbers
Regards,
Martin
WARNING: multiple messages have this Message-ID (diff)
From: Martin Fuzzey <mfuzzey-mB3Nsq4MPf1BDgjK7y7TUQ@public.gmane.org>
To: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
Sean Cross <xobs-nXMMniAx+RbQT0dZR+AlfA@public.gmane.org>,
Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2 01/11] staging: drm/imx: Add LDB support
Date: Wed, 27 Mar 2013 19:40:51 +0100 [thread overview]
Message-ID: <51533D33.8060305@parkeon.com> (raw)
In-Reply-To: <1364405445-5271-2-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Hi Philipp,
On 27/03/13 18:30, Philipp Zabel wrote:
> +static bool imx_ldb_encoder_mode_fixup(struct drm_encoder *encoder,
> + const struct drm_display_mode *mode,
> + struct drm_display_mode *adjusted_mode)
> +{
> +/*
> + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
> +
> + adjusted_mode->clock = clk_round_rate(imx_ldb_ch->ldb->clk_pll[imx_ldb_ch->chno],
> + adjusted_mode->clock * 1000) / 1000;
> +*/
This should probably be removed :)
> +static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno,
> + unsigned long serial_clk, unsigned long di_clk)
> +{
> + int ret;
> +
> + dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__,
> + clk_get_rate(ldb->clk_pll[chno]), serial_clk);
> + clk_set_rate(ldb->clk_pll[chno], serial_clk);
> +
> + dev_dbg(ldb->dev, "%s after: %ld\n", __func__,
> + clk_get_rate(ldb->clk_pll[chno]));
> +
> + dev_dbg(ldb->dev, "%s: now: %ld want: %ld\n", __func__,
> + clk_get_rate(ldb->clk[chno]),
> + (long int)di_clk);
> + clk_set_rate(ldb->clk[chno], di_clk);
> +
> + dev_dbg(ldb->dev, "%s after: %ld\n", __func__,
> + clk_get_rate(ldb->clk[chno]));
> +
Are all these debug statements still useful?
> +static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
> +{
> + if (imx_ldb_ch == &ldb->channel[0] || dual) {
> + ldb->ldb_ctrl &= ~0x3;
> + if (mux == 0 || ldb->lvds_mux)
> + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0;
> + else if (mux == 1)
> + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1;
> + }
> + if (imx_ldb_ch == &ldb->channel[1] || dual) {
> + ldb->ldb_ctrl &= ~0xc;
> + if (mux == 1 || ldb->lvds_mux)
> + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1;
> + else if (mux == 0)
> + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0;
> + }
Maybe avoid the magic 0x3 and 0x0c by building from LDB_CHx_MODE_EN_TO_DIx?
> +
> +static void imx_ldb_encoder_disable(struct drm_encoder *encoder)
> +{
> + struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
> + struct imx_ldb *ldb = imx_ldb_ch->ldb;
> +
> + /*
> + * imx_ldb_encoder_disable is called by
> + * drm_helper_disable_unused_functions without
> + * the encoder being enabled before.
> + */
> + if (imx_ldb_ch == &ldb->channel[0] && (ldb->ldb_ctrl & 0x3) == 0)
> + return;
> + else if (imx_ldb_ch == &ldb->channel[1] && (ldb->ldb_ctrl & 0xc) == 0)
> + return;
> +
> + if (imx_ldb_ch == &ldb->channel[0])
> + ldb->ldb_ctrl &= ~0x3;
> + else if (imx_ldb_ch == &ldb->channel[1])
> + ldb->ldb_ctrl &= ~0xc;
> +
Idem magic numbers
Regards,
Martin
next prev parent reply other threads:[~2013-03-27 18:40 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 17:30 [PATCH v2 0/11] LVDS Display Bridge support for i.MX Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 01/11] staging: drm/imx: Add LDB support Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-27 18:40 ` Martin Fuzzey [this message]
2013-03-27 18:40 ` Martin Fuzzey
2013-03-28 10:06 ` Philipp Zabel
2013-03-28 10:06 ` Philipp Zabel
2013-03-28 6:08 ` Shawn Guo
2013-03-28 6:08 ` Shawn Guo
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 9:58 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 02/11] ARM i.MX5: Move IPU clock lookups into device tree Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:04 ` Shawn Guo
2013-03-28 7:04 ` Shawn Guo
2013-03-27 17:30 ` [PATCH v2 03/11] ARM i.MX6q: export imx6q_revision Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:04 ` Shawn Guo
2013-03-28 7:04 ` Shawn Guo
2013-03-27 17:30 ` [PATCH v2 04/11] ARM i.MX6q: Add audio/video PLL post dividers for i.MX6q rev 1.1 Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:20 ` Shawn Guo
2013-03-28 7:20 ` Shawn Guo
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 14:43 ` Shawn Guo
2013-03-28 14:43 ` Shawn Guo
2013-03-28 15:22 ` Philipp Zabel
2013-03-28 15:22 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 05/11] ARM i.MX6q: set the LDB serial clock parent to the video PLL Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 06/11] ARM i.MX: Add imx_clk_divider_flags and imx_clk_mux_flags Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:39 ` Shawn Guo
2013-03-28 7:39 ` Shawn Guo
2013-03-27 17:30 ` [PATCH v2 07/11] ARM i.MX53: fix ldb di divider and selector clocks Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:40 ` Shawn Guo
2013-03-28 7:40 ` Shawn Guo
2013-03-27 17:30 ` [PATCH v2 08/11] ARM i.MX6q: " Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:40 ` Shawn Guo
2013-03-28 7:40 ` Shawn Guo
2013-03-27 17:30 ` [PATCH v2 09/11] ARM i.MX53: Add IOMUXC GPR to device tree Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 10/11] ARM i.MX53: Add LDB device " Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-27 18:43 ` Martin Fuzzey
2013-03-27 18:43 ` Martin Fuzzey
2013-03-28 7:32 ` Shawn Guo
2013-03-28 7:32 ` Shawn Guo
2013-03-28 8:41 ` Martin Fuzzey
2013-03-28 8:41 ` Martin Fuzzey
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 9:58 ` Philipp Zabel
2013-03-27 17:30 ` [PATCH v2 11/11] ARM i.MX6q: " Philipp Zabel
2013-03-27 17:30 ` Philipp Zabel
2013-03-28 7:51 ` Shawn Guo
2013-03-28 7:51 ` Shawn Guo
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 9:58 ` Philipp Zabel
2013-03-28 14:50 ` Shawn Guo
2013-03-28 14:50 ` Shawn Guo
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=51533D33.8060305@parkeon.com \
--to=mfuzzey@parkeon.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.