devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Yakir Yang <ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	Inki Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Joonyoung Shim
	<jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Seung-Woo Kim
	<sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Kyungmin Park
	<kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Jingoo Han <jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Krzysztof Kozlowski
	<k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org,
	Mark Yao <mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
	djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	Gustavo Padovan
	<gustavo.padovan-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>,
	javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org,
	Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Sean Paul <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	dri-devel@li
Subject: Re: [PATCH v7 10/17] phy: Add driver for rockchip Display Port PHY
Date: Tue, 27 Oct 2015 22:23:22 +0100	[thread overview]
Message-ID: <2304066.jCpsGbPbCP@phil> (raw)
In-Reply-To: <1445655964-15237-5-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

Am Samstag, 24. Oktober 2015, 11:06:04 schrieb Yakir Yang:
> Add phy driver for the Rockchip DisplayPort PHY module. This
> is required to get DisplayPort working in Rockchip SoCs.
> 
> Tested-by: Javier Martinez Canillas <javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org>
> Signed-off-by: Yakir Yang <ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---

> diff --git a/drivers/phy/phy-rockchip-dp.c b/drivers/phy/phy-rockchip-dp.c
> new file mode 100644
> index 0000000..4af19af
> --- /dev/null
> +++ b/drivers/phy/phy-rockchip-dp.c
> @@ -0,0 +1,153 @@
> +/*
> + * Rockchip DP PHY driver
> + *
> + * Copyright (C) 2015 FuZhou Rockchip Co., Ltd.
> + * Author: Yakir Yang <ykk@@rock-chips.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License.
> + */
> +
> +#include <linux/io.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/clk.h>
> +#include <linux/phy/phy.h>
> +#include <linux/regmap.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/platform_device.h>
> +
> +#define GRF_SOC_CON12                   0x0274
> +#define GRF_EDP_REF_CLK_SEL_INTER	BIT(4)
> +#define GRF_EDP_PHY_SIDDQ_WRITE_EN      BIT(21)
> +#define GRF_EDP_PHY_SIDDQ_ON            0
> +#define GRF_EDP_PHY_SIDDQ_OFF           BIT(5)

mixed spacers (tabs and spaces), please use either tabs if you want to
align stuff or a single space.

Also you're mixing the handling here, for SIDDQ you're defining both the
actual bit as well as the write-enable bit, but for CLK_SEL_INTR you're
hard-coding the 16-bit shift down in the code.

You could also just use/copy the HIWORD_MASK macro we use for example
in the clock controller.


> +
> +struct rockchip_dp_phy {
> +	struct device  *dev;
> +	struct regmap  *grf;
> +	struct clk     *phy_24m;
> +};
> +
> +static int rockchip_set_phy_state(struct phy *phy, bool enable)
> +{
> +	struct rockchip_dp_phy *dp = phy_get_drvdata(phy);
> +	int ret;
> +
> +	if (enable) {
> +		ret = regmap_write(dp->grf, GRF_SOC_CON12,
> +				   GRF_EDP_PHY_SIDDQ_WRITE_EN |
> +				   GRF_EDP_PHY_SIDDQ_ON);
> +		if (ret < 0) {
> +			dev_err(dp->dev, "Can't enable PHY power %d\n", ret);
> +			return ret;
> +		}
> +
> +		ret = clk_prepare_enable(dp->phy_24m);
> +

unnecessary empty line after clk_prepare_enable


with these things fixed,
Reviewed-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>


Cheers,
Heiko
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-10-27 21:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 11:23 [PATCH v7 0/17] Add Analogix Core Display Port Driver Yakir Yang
2015-10-23 11:29 ` [PATCH v7 01/17] drm: exynos: dp: convert to drm bridge mode Yakir Yang
2015-10-23 11:29   ` [PATCH v7 02/17] drm: bridge: analogix/dp: split exynos dp driver to bridge directory Yakir Yang
2015-10-23 11:29   ` [PATCH v7 03/17] drm: bridge: analogix/dp: fix some obvious code style Yakir Yang
     [not found]   ` <1445599802-31568-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-23 11:29     ` [PATCH v7 04/17] drm: bridge: analogix/dp: remove duplicate configuration of link rate and link count Yakir Yang
2015-10-23 11:29     ` [PATCH v7 05/17] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & dynamic_range Yakir Yang
     [not found] ` <1445599415-30856-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-24  3:06   ` [PATCH v7 06/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-10-24  3:06     ` [PATCH v7 07/17] ARM: dts: exynos/dp: remove some properties that deprecated by analogix_dp driver Yakir Yang
2015-10-24  3:06     ` [PATCH v7 08/17] drm: rockchip: dp: add rockchip platform dp driver Yakir Yang
     [not found]     ` <1445655964-15237-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-24  3:06       ` [PATCH v7 09/17] Documentation: drm/bridge: add document for analogix_dp Yakir Yang
2015-10-27 21:14         ` Heiko Stuebner
2015-10-28  2:09           ` Yakir Yang
2015-10-24  3:06       ` [PATCH v7 10/17] phy: Add driver for rockchip Display Port PHY Yakir Yang
     [not found]         ` <1445655964-15237-5-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-27 21:23           ` Heiko Stuebner [this message]
2015-10-28  1:46             ` Yakir Yang
2015-10-28  1:49             ` Yakir Yang
2015-10-27 21:04       ` [PATCH v7 06/17] Documentation: drm/bridge: add document for analogix_dp Heiko Stuebner
2015-10-28  2:08         ` Yakir Yang
2015-10-24  3:06   ` [PATCH v7 11/17] Documentation: phy: add document for rockchip dp phy Yakir Yang
2015-10-24  3:06     ` [PATCH v7 12/17] drm: rockchip: vop: add bpc and color mode setting Yakir Yang
2015-10-24  3:06     ` [PATCH v7 13/17] drm: bridge: analogix/dp: add some rk3288 special registers setting Yakir Yang
2015-10-24  3:06     ` [PATCH v7 14/17] drm: bridge: analogix/dp: add max link rate and lane count limit for RK3288 Yakir Yang
2015-10-24  3:06     ` [PATCH v7 15/17] drm: bridge: analogix/dp: try force hpd after plug in lookup failed Yakir Yang
     [not found]     ` <1445656003-15300-1-git-send-email-ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2015-10-27 21:24       ` [PATCH v7 11/17] Documentation: phy: add document for rockchip dp phy Heiko Stuebner
2015-10-28  2:26         ` Yakir Yang
2015-10-27 23:08     ` Heiko Stuebner
2015-10-28  2:26       ` Yakir Yang
2015-10-24  3:21 ` [PATCH v7 16/17] drm: bridge: analogix/dp: move hpd detect to connector detect function Yakir Yang
2015-10-24  3:21   ` [PATCH v7 17/17] drm: bridge: analogix/dp: add edid modes parse in get_modes method Yakir Yang

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=2304066.jCpsGbPbCP@phil \
    --to=heiko-4mtyjxux2i+zqb+pc5nmwq@public.gmane.org \
    --cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=dri-devel@li \
    --cc=gustavo.padovan-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=javier-JPH+aEBZ4P+UEJcrhfAQsw@public.gmane.org \
    --cc=jingoohan1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=jy0922.shim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.yao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=sw0312.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=ykk-TNX95d0MmH7DzftRWevZcw@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).