All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	k.kozlowski@samsung.com, tomasz.figa@gmail.com,
	s.nawrocki@samsung.com, kgene@kernel.org
Cc: robh@kernel.org, rjw@rjwysocki.net, robh+dt@kernel.org,
	pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	linux@arm.linux.org.uk, linux.amoon@gmail.com,
	m.reichl@fivetechno.de, tjakobi@math.uni-bielefeld.de,
	inki.dae@samsung.com, cw00.choi@samsung.com,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: [PATCH v2 2/8] PM / devfreq: event: Find the instance of devfreq-event device by using phandle
Date: Fri, 15 Apr 2016 15:32:49 +0900	[thread overview]
Message-ID: <1460701975-24178-3-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1460701975-24178-1-git-send-email-cw00.choi@samsung.com>

This patch use the phandle to find the instance of devfreq-event device in
Device Tree when calling the devfreq_event_get_edev_by_phandle() because there
is two type devfreq-event devices as following:

First case, exynos-ppmu.c driver provides the maximum four event of each PPMU.
So, when getting the instance of devfreq-event device, using the unique name of
struct devfreq_event_desc.

Second case, exynos-nocp.c driver provide the only one event of each NoC Probe
device. So, when getting the instance of devfreq-event device, using the
phandle of each NoC probe device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq-event.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 38bf144ca147..39b048eda2ce 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -235,6 +235,11 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
 
 	mutex_lock(&devfreq_event_list_lock);
 	list_for_each_entry(edev, &devfreq_event_list, node) {
+		if (edev->dev.parent && edev->dev.parent->of_node == node)
+			goto out;
+	}
+
+	list_for_each_entry(edev, &devfreq_event_list, node) {
 		if (!strcmp(edev->desc->name, node->name))
 			goto out;
 	}
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	k.kozlowski@samsung.com, tomasz.figa@gmail.com,
	s.nawrocki@samsung.com, kgene@kernel.org
Cc: mark.rutland@arm.com, linux-samsung-soc@vger.kernel.org,
	linux@arm.linux.org.uk, cw00.choi@samsung.com,
	pawel.moll@arm.com, ijc+devicetree@hellion.org.uk,
	linux.amoon@gmail.com, linux-pm@vger.kernel.org,
	rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
	m.reichl@fivetechno.de, tjakobi@math.uni-bielefeld.de,
	devicetree@vger.kernel.org, robh+dt@kernel.org,
	galak@codeaurora.org, inki.dae@samsung.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/8] PM / devfreq: event: Find the instance of devfreq-event device by using phandle
Date: Fri, 15 Apr 2016 15:32:49 +0900	[thread overview]
Message-ID: <1460701975-24178-3-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1460701975-24178-1-git-send-email-cw00.choi@samsung.com>

This patch use the phandle to find the instance of devfreq-event device in
Device Tree when calling the devfreq_event_get_edev_by_phandle() because there
is two type devfreq-event devices as following:

First case, exynos-ppmu.c driver provides the maximum four event of each PPMU.
So, when getting the instance of devfreq-event device, using the unique name of
struct devfreq_event_desc.

Second case, exynos-nocp.c driver provide the only one event of each NoC Probe
device. So, when getting the instance of devfreq-event device, using the
phandle of each NoC probe device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq-event.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 38bf144ca147..39b048eda2ce 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -235,6 +235,11 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
 
 	mutex_lock(&devfreq_event_list_lock);
 	list_for_each_entry(edev, &devfreq_event_list, node) {
+		if (edev->dev.parent && edev->dev.parent->of_node == node)
+			goto out;
+	}
+
+	list_for_each_entry(edev, &devfreq_event_list, node) {
 		if (!strcmp(edev->desc->name, node->name))
 			goto out;
 	}
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/8] PM / devfreq: event: Find the instance of devfreq-event device by using phandle
Date: Fri, 15 Apr 2016 15:32:49 +0900	[thread overview]
Message-ID: <1460701975-24178-3-git-send-email-cw00.choi@samsung.com> (raw)
In-Reply-To: <1460701975-24178-1-git-send-email-cw00.choi@samsung.com>

This patch use the phandle to find the instance of devfreq-event device in
Device Tree when calling the devfreq_event_get_edev_by_phandle() because there
is two type devfreq-event devices as following:

First case, exynos-ppmu.c driver provides the maximum four event of each PPMU.
So, when getting the instance of devfreq-event device, using the unique name of
struct devfreq_event_desc.

Second case, exynos-nocp.c driver provide the only one event of each NoC Probe
device. So, when getting the instance of devfreq-event device, using the
phandle of each NoC probe device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/devfreq-event.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 38bf144ca147..39b048eda2ce 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -235,6 +235,11 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
 
 	mutex_lock(&devfreq_event_list_lock);
 	list_for_each_entry(edev, &devfreq_event_list, node) {
+		if (edev->dev.parent && edev->dev.parent->of_node == node)
+			goto out;
+	}
+
+	list_for_each_entry(edev, &devfreq_event_list, node) {
 		if (!strcmp(edev->desc->name, node->name))
 			goto out;
 	}
-- 
1.9.1

  parent reply	other threads:[~2016-04-15  6:35 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  6:32 [PATCH v2 0/8] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3 Chanwoo Choi
2016-04-15  6:32 ` Chanwoo Choi
2016-04-15  6:32 ` [PATCH v2 1/8] PM / devfreq: event: Add new Exynos NoC probe driver Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  8:37   ` Krzysztof Kozlowski
2016-04-15  8:37     ` Krzysztof Kozlowski
2016-04-15  6:32 ` Chanwoo Choi [this message]
2016-04-15  6:32   ` [PATCH v2 2/8] PM / devfreq: event: Find the instance of devfreq-event device by using phandle Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  6:32 ` [PATCH v2 3/8] PM / devfreq: exynos: Add the detailed correlation for Exynos5422 bus Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  6:32 ` [PATCH v2 4/8] ARM: dts: Add NoC Probe dt node for Exynos542x SoC Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  9:04   ` Krzysztof Kozlowski
2016-04-15  9:04     ` Krzysztof Kozlowski
2016-04-15  6:32 ` [PATCH v2 5/8] dt-bindings: clock: Add the clock id for ACLK clock of " Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  6:32 ` [PATCH v2 6/8] clk: samsung: exynos542x: Add the clock id for ACLK Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  9:05   ` Krzysztof Kozlowski
2016-04-15  9:05     ` Krzysztof Kozlowski
2016-04-15  9:05     ` Krzysztof Kozlowski
2016-04-15 16:34     ` Sylwester Nawrocki
2016-04-15 16:34       ` Sylwester Nawrocki
2016-04-15  6:32 ` [PATCH v2 7/8] ARM: dts: Add bus nodes using VDD_INT for Exynos542x SoC Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  6:32 ` [PATCH v2 8/8] ARM: dts: Add support of Bus frequency using VDD_INT for exynos5422-odroidxu3 Chanwoo Choi
2016-04-15  6:32   ` Chanwoo Choi
2016-04-15  9:07   ` Krzysztof Kozlowski
2016-04-15  9:07     ` Krzysztof Kozlowski
2016-05-03 10:29 ` [PATCH v2 0/8] PM / devfreq: Add NoCP devfreq-event and support busfreq on exyno5422-odroidxu3 Krzysztof Kozlowski
2016-05-03 10:29   ` Krzysztof Kozlowski
2016-05-03 10:29   ` Krzysztof Kozlowski
2016-05-03 10:48   ` Chanwoo Choi
2016-05-03 10:48     ` Chanwoo Choi

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=1460701975-24178-3-git-send-email-cw00.choi@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=inki.dae@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kgene@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=linux@arm.linux.org.uk \
    --cc=m.reichl@fivetechno.de \
    --cc=mark.rutland@arm.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=pawel.moll@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.nawrocki@samsung.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    --cc=tomasz.figa@gmail.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 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.