dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Dave Airlie <airlied@gmail.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"sw0312.kim@samsung.com" <sw0312.kim@samsung.com>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v6 06/15] of: add helper for getting endpoint node of specific identifiers
Date: Tue, 23 Jun 2015 11:29:06 +0900	[thread overview]
Message-ID: <5588C472.4060400@samsung.com> (raw)
In-Reply-To: <CAPM=9tydy9NXh-P8=d62tewqtCKwZtd-SJUcb-vM4KMARA+sMA@mail.gmail.com>

On 2015년 06월 23일 09:19, Dave Airlie wrote:
> On 12 June 2015 at 22:59, Hyungwon Hwang <human.hwang@samsung.com> wrote:
>> When there are multiple ports or multiple endpoints in a port, they have to be
>> distinguished by the value of reg property. It is common. The drivers can get
>> the specific endpoint in the specific port via this function. Now the drivers
>> have to implement this code in themselves or have to force the order of dt nodes
>> to get the right node.
>>
>> Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
>> Acked-by: Rob Herring <robh+dt@kernel.org>
> 
> FYI, Since I'm merging this via exynos-next into my tree, it broke
> module builds of exynos, because it doesn't export the symbol it adds,
> I've added a patch to my -next tree to fix it up.
> 
> Inki, in future can you add a modular build to pre-pull testing.

Yes I do. I should have tested the modular build. Sorry for this.

Thanks,
Inki Dae

> 
> Dave.
> 
>> ---
>> Changes before:
>> - Refer https://patchwork.kernel.org/patch/6191751/
>> Changes for v6:
>> - None
>>  drivers/of/base.c        | 33 +++++++++++++++++++++++++++++++++
>>  include/linux/of_graph.h |  8 ++++++++
>>  2 files changed, 41 insertions(+)
>>
>> diff --git a/drivers/of/base.c b/drivers/of/base.c
>> index 99764db..f3b583b 100644
>> --- a/drivers/of/base.c
>> +++ b/drivers/of/base.c
>> @@ -2233,6 +2233,39 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
>>  EXPORT_SYMBOL(of_graph_get_next_endpoint);
>>
>>  /**
>> + * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers
>> + * @parent: pointer to the parent device node
>> + * @port_reg: identifier (value of reg property) of the parent port node
>> + * @reg: identifier (value of reg property) of the endpoint node
>> + *
>> + * Return: An 'endpoint' node pointer which is identified by reg and at the same
>> + * is the child of a port node identified by port_reg. reg and port_reg are
>> + * ignored when they are -1.
>> + */
>> +struct device_node *of_graph_get_endpoint_by_regs(
>> +       const struct device_node *parent, int port_reg, int reg)
>> +{
>> +       struct of_endpoint endpoint;
>> +       struct device_node *node, *prev_node = NULL;
>> +
>> +       while (1) {
>> +               node = of_graph_get_next_endpoint(parent, prev_node);
>> +               of_node_put(prev_node);
>> +               if (!node)
>> +                       break;
>> +
>> +               of_graph_parse_endpoint(node, &endpoint);
>> +               if (((port_reg == -1) || (endpoint.port == port_reg)) &&
>> +                       ((reg == -1) || (endpoint.id == reg)))
>> +                       return node;
>> +
>> +               prev_node = node;
>> +       }
>> +
>> +       return NULL;
>> +}
>> +
>> +/**
>>   * of_graph_get_remote_port_parent() - get remote port's parent node
>>   * @node: pointer to a local endpoint device_node
>>   *
>> diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
>> index 7bc92e0..1c1d5b9 100644
>> --- a/include/linux/of_graph.h
>> +++ b/include/linux/of_graph.h
>> @@ -45,6 +45,8 @@ int of_graph_parse_endpoint(const struct device_node *node,
>>  struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id);
>>  struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
>>                                         struct device_node *previous);
>> +struct device_node *of_graph_get_endpoint_by_regs(
>> +               const struct device_node *parent, int port_reg, int reg);
>>  struct device_node *of_graph_get_remote_port_parent(
>>                                         const struct device_node *node);
>>  struct device_node *of_graph_get_remote_port(const struct device_node *node);
>> @@ -69,6 +71,12 @@ static inline struct device_node *of_graph_get_next_endpoint(
>>         return NULL;
>>  }
>>
>> +struct device_node *of_graph_get_endpoint_by_regs(
>> +               const struct device_node *parent, int port_reg, int reg)
>> +{
>> +       return NULL;
>> +}
>> +
>>  static inline struct device_node *of_graph_get_remote_port_parent(
>>                                         const struct device_node *node)
>>  {
>> --
>> 1.9.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2015-06-23  2:29 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 12:58 [PATCH v6 00/15] Add drivers for Exynos5433 display Hyungwon Hwang
2015-06-12 12:58 ` [PATCH v6 02/15] drm/exynos: Add the dependency for DRM_EXYNOS to DPI/DSI/DP Hyungwon Hwang
2015-06-12 12:58 ` [PATCH v6 03/15] drm/exynos: add drm_iommu_attach_device_if_possible() Hyungwon Hwang
2015-06-12 12:58 ` [PATCH v6 04/15] drm/exynos: fix the input prompt of Exynos7 DECON Hyungwon Hwang
2015-06-12 12:59 ` [PATCH v6 06/15] of: add helper for getting endpoint node of specific identifiers Hyungwon Hwang
2015-06-23  0:19   ` Dave Airlie
2015-06-23  2:29     ` Inki Dae [this message]
2015-06-12 12:59 ` [PATCH v6 07/15] drm/exynos: mic: add MIC driver Hyungwon Hwang
     [not found] ` <1434113958-15877-1-git-send-email-human.hwang-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2015-06-12 12:58   ` [PATCH v6 01/15] drm/exynos: remove the dependency of DP driver for ARCH_EXYNOS Hyungwon Hwang
2015-06-12 12:59   ` [PATCH v6 05/15] drm/exynos: add Exynos5433 decon driver Hyungwon Hwang
2015-06-22 11:16     ` [PATCH v7 " Inki Dae
2015-06-22 11:41       ` Varka Bhadram
2015-06-22 11:57         ` Inki Dae
2015-06-22 11:59           ` Varka Bhadram
2015-06-12 12:59   ` [PATCH v6 08/15] drm/exynos: dsi: rename pll_clk to sclk_clk Hyungwon Hwang
2015-06-22 12:25     ` Inki Dae
2015-06-12 12:59   ` [PATCH v6 09/15] drm/exynos: dsi: add macros for register access Hyungwon Hwang
2015-06-12 12:59   ` [PATCH v6 10/15] drm/exynos: dsi: make use of driver data for static values Hyungwon Hwang
2015-06-12 12:59   ` [PATCH v6 11/15] drm/exynos: dsi: make use of array for clock access Hyungwon Hwang
2015-06-12 12:59   ` [PATCH v6 13/15] drm/exynos: dsi: add support for MIC driver as a bridge Hyungwon Hwang
2015-06-12 12:59   ` [PATCH v6 15/15] ARM: dts: rename the clock of MIPI DSI 'pll_clk' to 'sclk_mipi' Hyungwon Hwang
2015-06-22  9:10     ` Inki Dae
2015-06-22 11:42       ` Inki Dae
2015-06-22 11:59         ` Krzysztof Kozlowski
2015-06-22 12:10           ` Inki Dae
2015-06-22 12:20             ` Krzysztof Kozlowski
2015-06-22 12:35         ` Krzysztof Kozlowski
2015-06-23  2:10           ` Krzysztof Kozlowski
2015-06-23  2:28             ` Inki Dae
2015-06-23  4:00               ` Krzysztof Kozlowski
2015-06-12 12:59   ` [PATCH 1/2] drm/exynos: ipp: fix wrong index referencing a config element Hyungwon Hwang
2015-06-12 13:02     ` Hyungwon Hwang
2015-06-12 12:59   ` [PATCH 2/3] ARM: dts: Add the reference node for syscon to mipi phy for Exynos3250 Hyungwon Hwang
2015-06-12 13:02     ` Hyungwon Hwang
2015-06-12 12:59 ` [PATCH v6 12/15] drm/exynos: dsi: add support for Exynos5433 Hyungwon Hwang
2015-06-12 12:59 ` [PATCH v6 14/15] drm/exynos: dsi: do not set TE GPIO direction by input Hyungwon Hwang
2015-06-12 12:59 ` [PATCH 2/2] drm/exynos: ipp: validate a GEM handle with multiple planes Hyungwon Hwang
2015-06-12 13:02   ` Hyungwon Hwang
2015-06-12 12:59 ` [PATCH] ARM: dts: set display clock correctly for exynos4412-trats2 Hyungwon Hwang
2015-06-12 12:59 ` [PATCH 1/3] drm/panel: add s6e63j0x03 LCD panel driver Hyungwon Hwang
2015-06-12 13:02   ` Hyungwon Hwang
2015-06-12 12:59 ` [PATCH 3/3] ARM: dts: fix the clock-frequency of rinato board's panel Hyungwon Hwang
2015-06-12 13:02   ` Hyungwon Hwang
  -- strict thread matches above, loose matches on Subject: below --
2015-01-19  7:52 [PATCH v3 1/3] ARM: dts: add fimd device support for exynos3250-rinato Hyungwon Hwang
2015-01-19  7:52 ` [PATCH v3 2/3] drm/panel: add s6e63j0x03 LCD panel driver Hyungwon Hwang
2015-02-03 14:00   ` Thierry Reding
2015-06-12 13:03   ` [v3,2/3] " Hyungwon Hwang
2015-01-19  7:52 ` [PATCH v3 3/3] ARM: dts: add Panel device support for exynos3250-rinato Hyungwon Hwang

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=5588C472.4060400@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=airlied@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=sw0312.kim@samsung.com \
    /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