From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] driver: i2c:s3c24x0: init each channel during probe
Date: Mon, 25 Nov 2013 07:46:27 +0100 [thread overview]
Message-ID: <5292F243.5030304@denx.de> (raw)
In-Reply-To: <CAHfPSqDOd4ycBLki8__EWY_i72-ybTNJ11R315_FWsn6QpQz5w@mail.gmail.com>
Hello Naveen,
Am 22.11.2013 09:50, schrieb Naveen Krishna Ch:
> Hello All,
>
> On 22 November 2013 14:18, Naveen Krishna Chatradhi
> <ch.naveen@samsung.com> wrote:
>> Each I2C channel must be inited during the probe and then set "active"
>> instead of initing the channel for every time we select the bus
>> using "i2c dev bus"
>>
>> Signed-off-by: Naveen Krishna Chatradhi<ch.naveen@samsung.com>
>> ---
>> drivers/i2c/s3c24x0_i2c.c | 29 +++++++++++++----------------
>> 1 file changed, 13 insertions(+), 16 deletions(-)
This patch do not apply based on the patches from Piotr Wilczek, see
[U-Boot,V2,1/2] driver:i2c:s3c24x0: adapt driver to new i2c
http://patchwork.ozlabs.org/patch/292705/
[U-Boot,2/2] driver:i2c:s3c24x0: fix clock init for hsi2c
http://patchwork.ozlabs.org/patch/292706/
Could you rebase your patch on base of this two patches?
Thanks!
>> diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
>> index f77a9d1..7136771 100644
>> --- a/drivers/i2c/s3c24x0_i2c.c
>> +++ b/drivers/i2c/s3c24x0_i2c.c
>> @@ -408,22 +408,7 @@ static void exynos5_i2c_reset(struct s3c24x0_i2c_bus *i2c_bus)
>> #ifdef CONFIG_I2C_MULTI_BUS
>> int i2c_set_bus_num(unsigned int bus)
>> {
>> - struct s3c24x0_i2c_bus *i2c_bus;
>> -
>> - i2c_bus = get_bus(bus);
>> - if (!i2c_bus)
>> - return -1;
>> g_current_bus = bus;
>> -
>> - if (i2c_bus->is_highspeed) {
>> - if (hsi2c_get_clk_details(i2c_bus))
>> - return -1;
>> - hsi2c_ch_init(i2c_bus);
>> - } else {
>> - i2c_ch_init(i2c_bus->regs, i2c_bus->clock_frequency,
>> - CONFIG_SYS_I2C_SLAVE);
>> - }
>> -
>> return 0;
>> }
>>
>> @@ -989,7 +974,6 @@ static void process_nodes(const void *blob, int node_list[], int count,
>> continue;
>>
>> bus =&i2c_bus[i];
>> - bus->active = true;
>> bus->is_highspeed = is_highspeed;
>>
>> if (is_highspeed)
>> @@ -1009,6 +993,19 @@ static void process_nodes(const void *blob, int node_list[], int count,
>>
>> /* Mark position as used */
>> node_list[i] = -1;
>> +
>> + if (bus->is_highspeed) {
>> + if (hsi2c_get_clk_details(bus)) {
>> + bus->active = false;
>> + break;
>> + }
>> + hsi2c_ch_init(bus);
>> + exynos5_i2c_reset(bus);
>
> HSI2C module on Exynos5260 needs a reset of module during reset.
> Similar patch is being posted for kernel at
> http://www.kernelhub.org/?msg=365741&p=2
>
> As this is a one time activity, guess resetting all channels is not a problem.
Ok, from my side.
> I can implement a "SoC type quirk" to distinguish otherwise.
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
prev parent reply other threads:[~2013-11-25 6:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 8:48 [U-Boot] [PATCH] driver: i2c:s3c24x0: init each channel during probe Naveen Krishna Chatradhi
2013-11-22 8:50 ` Naveen Krishna Ch
2013-11-25 6:46 ` Heiko Schocher [this message]
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=5292F243.5030304@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/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.