linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank
Date: Thu, 25 Aug 2016 23:41:04 +0900	[thread overview]
Message-ID: <CA+Ln22Guw1LghdV64cSKjByDExr+2HnvEK7DNkYz+XPAmVuAzA@mail.gmail.com> (raw)
In-Reply-To: <CA+Ln22Ew=8S382zn+M8Ys5vztqvzp1+3EOTKtd81WSfuSyvY6w@mail.gmail.com>

2016-08-25 23:30 GMT+09:00 Tomasz Figa <tomasz.figa@gmail.com>:
>> +       }
>> +
>> +#define EXYNOS_PIN_BANK_EINTN_EXT(pins, reg, id, pctl_idx, eint_idx)   \
>> +       {                                               \
>> +               .type           = &bank_type_off,       \
>> +               .pctl_offset    = reg,                  \
>> +               .nr_pins        = pins,                 \
>> +               .eint_type      = EINT_TYPE_NONE,       \
>> +               .name           = id,                   \
>> +               .pctl_res_idx   = pctl_idx,             \
>> +               .eint_res_idx   = eint_dix              \
>> +       }
>
> Your patch 4/7 doesn't seem to use this one, so this is dead code for
> the time being. Please add when there is real need for it.
>
> Also it doesn't really make much sense to have index for both pctl and
> eint. Please define first entry of regs property as always pointing to
> pctl registers and by also eint registers for usual controllers. Then
> second regs entry would be eint registers for controllers with
> separate register blocks. Then there is only a need to have
> eint_res_idx in the driver and no need for pctl_res_idx, because it
> would be always 0.

Ah, sorry, I got confused again by which registers are where in these
GPF banks. Let's make it the other way around and make DT contain eint
registers in first regs entry and hardcode eint_res_idx to 0 for the
time being. However it should be still beneficial to refactor the code
and calculate per-bank eint_base to avoid adding the offset every
time, similarly to pctl_base/offset, from my suggestion below.

>> @@ -345,7 +346,8 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata,
>>                         ((b->pin_base + b->nr_pins - 1) < pin))
>>                 b++;
>>
>> -       *reg = drvdata->virt_base + b->pctl_offset;
>> +       pctl_res_idx = b->pctl_res_idx;
>> +       *reg = drvdata->virt_base[pctl_res_idx] + b->pctl_offset;
>
> I suggested something slightly different. Instead of
> bank::pctl_res_idx, I proposed bank::pctl_base.
> bank_info::pctl_res_idx would be specified only in init driver data
> and bank::pctl_base would be calculated at probe time as
> drvdata->virt_base[bank_info->pctl_res_idx] + bank_info->pctl_offset.
> This would eliminate the need to do any indexing and adding further in
> the code and make things simpler.
>
> Taking my other comments above, pctl part would be unchanged and only
> eint addresses and offsets would be affected.

Ah, scratch this one sentence. I got confused with the register layout
again, sorry. Please refactor both eint and pctl as I suggested in the
upper paragraph.

Best regards,
Tomasz

  reply	other threads:[~2016-08-25 14:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 13:49 [PATCH v2 0/7] arm64: dts: Add the dts file for Exynos5433 and TM/TM2E board Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 1/7] clocksource: exynos_mct: Add the support for ARM64 Chanwoo Choi
2016-08-26 16:02   ` Krzysztof Kozlowski
2016-09-08 11:04   ` Daniel Lezcano
     [not found]     ` <CGME20160916111052eucas1p1fb19531ab7b3e53f6fdeb4fa0e8a5449@eucas1p1.samsung.com>
2016-09-16 11:10       ` Krzysztof Kozlowski
2016-08-24 13:49 ` [PATCH v2 2/7] Documentation: bindings: Add Exynos5433 PMU compatible Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 3/7] pinctrl: samsung: Add the support the multiple IORESOURCE_MEM for one pin-bank Chanwoo Choi
2016-08-25 14:30   ` Tomasz Figa
2016-08-25 14:41     ` Tomasz Figa [this message]
2016-09-05  8:08       ` Chanwoo Choi
2016-09-20  1:03         ` Tomasz Figa
2016-08-24 13:49 ` [PATCH v2 4/7] pinctrl: samsung: Add GPF support for Exynos5433 Chanwoo Choi
2016-08-25 14:34   ` Tomasz Figa
2016-08-24 13:49 ` [PATCH v2 5/7] arm64: dts: exynos: Add dts files for Samsung Exynos5433 64bit SoC Chanwoo Choi
2016-08-26 16:14   ` Krzysztof Kozlowski
2016-09-02  9:54     ` Chanwoo Choi
2016-08-26 17:49   ` Javier Martinez Canillas
2016-09-02 10:59     ` Chanwoo Choi
2016-09-07  7:55       ` Javier Martinez Canillas
2016-10-04 13:37   ` Geert Uytterhoeven
2016-10-04 13:46     ` Krzysztof Kozlowski
2016-08-24 13:49 ` [PATCH v2 6/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2 board Chanwoo Choi
2016-08-25  9:28   ` kbuild test robot
2016-08-26 16:32   ` Krzysztof Kozlowski
2016-08-26 17:11     ` Krzysztof Kozlowski
2016-08-26 20:46     ` Chanwoo Choi
2016-08-26 18:30   ` Javier Martinez Canillas
2016-08-26 18:35     ` Javier Martinez Canillas
2016-09-02 11:29     ` Chanwoo Choi
2016-09-07  8:08       ` Javier Martinez Canillas
2016-08-30 17:11   ` Rob Herring
2016-08-31  1:24     ` Chanwoo Choi
2016-08-24 13:49 ` [PATCH v2 7/7] arm64: dts: exynos: Add dts file for Exynos5433-based TM2E board Chanwoo Choi
2016-08-26 18:32   ` Javier Martinez Canillas

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=CA+Ln22Guw1LghdV64cSKjByDExr+2HnvEK7DNkYz+XPAmVuAzA@mail.gmail.com \
    --to=tomasz.figa@gmail.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;
as well as URLs for NNTP newsgroup(s).