From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 05/16] pinctrl: samsung: Parse bank-specific eint offset from DT
Date: Fri, 28 Sep 2012 16:28:36 +0200 [thread overview]
Message-ID: <1348842527-22460-6-git-send-email-t.figa@samsung.com> (raw)
In-Reply-To: <1348842527-22460-1-git-send-email-t.figa@samsung.com>
Some SoCs, like Exynos4x12, have non-linear layout of EINT control
registers and so current way of calculating register addresses does not
work correctly for them.
This patch adds parsing of samsung,eint-offset property from bank nodes
and uses the read values instead of calculating the offsets from bank
index.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
---
drivers/pinctrl/pinctrl-exynos.c | 5 ++---
drivers/pinctrl/pinctrl-samsung.c | 5 +++++
drivers/pinctrl/pinctrl-samsung.h | 1 +
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c
index 134fecf..340bfc2 100644
--- a/drivers/pinctrl/pinctrl-exynos.c
+++ b/drivers/pinctrl/pinctrl-exynos.c
@@ -146,7 +146,7 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw,
struct samsung_pin_bank *bank = d->ctrl->pin_banks;
struct exynos_geint_data *eint_data;
unsigned int nr_banks = d->ctrl->nr_banks, idx;
- unsigned int irq_base = 0, eint_offset = 0;
+ unsigned int irq_base = 0;
if (hw >= d->ctrl->nr_gint) {
dev_err(d->dev, "unsupported ext-gpio interrupt\n");
@@ -159,7 +159,6 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw,
if ((hw >= irq_base) && (hw < (irq_base + bank->nr_pins)))
break;
irq_base += bank->nr_pins;
- eint_offset += 4;
}
if (idx == nr_banks) {
@@ -175,7 +174,7 @@ static struct exynos_geint_data *exynos_get_eint_data(irq_hw_number_t hw,
eint_data->bank = bank;
eint_data->pin = hw - irq_base;
- eint_data->eint_offset = eint_offset;
+ eint_data->eint_offset = bank->eint_offset;
return eint_data;
}
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index e828a0e..962320b 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -859,6 +859,11 @@ static int samsung_pinctrl_parse_dt_bank(struct samsung_pin_bank *bank,
bank->eint_type = EINT_TYPE_GPIO;
+ ret = of_property_read_u32(np, "samsung,eint-offset", &val);
+ if (ret)
+ return ret;
+ bank->eint_offset = val;
+
return 0;
}
diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h
index db1907c..72303f1 100644
--- a/drivers/pinctrl/pinctrl-samsung.h
+++ b/drivers/pinctrl/pinctrl-samsung.h
@@ -122,6 +122,7 @@ struct samsung_pin_bank {
u8 conpdn_width;
u8 pudpdn_width;
enum eint_type eint_type;
+ u32 eint_offset;
u32 irq_base;
const char *name;
};
--
1.7.12
next prev parent reply other threads:[~2012-09-28 14:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 14:28 [RFC PATCH 00/16] pinctrl: samsung: Usability and extensibiltiy improvements Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 01/16] pinctrl: exynos: Parse wakeup-eint parameters from DT Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 02/16] pinctrl: samsung: Detect and handle unsupported configuration types Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 03/16] pinctrl: samsung: Parse pin banks from DT Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 04/16] pinctrl: exynos: Remove static platform-specific data Tomasz Figa
2012-09-28 14:28 ` Tomasz Figa [this message]
2012-09-28 14:28 ` [RFC PATCH 06/16] pinctrl: samsung: Hold OF node of pin bank in bank struct Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 07/16] pinctrl: samsung: Hold pointer to driver data " Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 08/16] pinctrl: exynos: Use one IRQ domain per pin bank Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 09/16] pinctrl: samsung: Do not pass gpio_chip to pin_to_reg_bank Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 10/16] pinctrl: samsung: Use one GPIO chip per pin bank Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 11/16] pinctrl: samsung: Use per-bank IRQ domain for wake-up interrupts Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 12/16] pinctrl: exynos: Set pin function to EINT in irq_set_type of wake-up EINT Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 13/16] pinctrl: samsung: Parse offsets of particular registers from DT Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 14/16] ARM: dts: exynos4210: Remove legacy gpio nodes Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 15/16] ARM: dts: exynos4210: Add platform-specific descriptions for pin controllers Tomasz Figa
2012-09-28 14:28 ` [RFC PATCH 16/16] Documentation: Update samsung-pinctrl device tree bindings documentation Tomasz Figa
2012-10-04 19:23 ` Stephen Warren
2012-10-01 6:58 ` [RFC PATCH 00/16] pinctrl: samsung: Usability and extensibiltiy improvements Linus Walleij
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=1348842527-22460-6-git-send-email-t.figa@samsung.com \
--to=t.figa@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox