All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V3] i2c: mxc: refactor i2c driver and support dm
Date: Wed, 13 May 2015 07:08:14 +0200	[thread overview]
Message-ID: <5552DC3E.5050107@denx.de> (raw)
In-Reply-To: <CAPnjgZ28oRySf=L2-DU8zYHec0Qmry_g92egMoV=LcnCYVkOCA@mail.gmail.com>

Hello Simon,

Am 13.05.2015 03:44, schrieb Simon Glass:
> Hi,
>
> On 12 May 2015 at 19:09, Fan Peng <Peng.Fan@freescale.com> wrote:
>>
>> Hi,
>>
>> Is there any further comments? Or this patch will be applied?
>>
>
> I can apply it if you like - Heiko what do you prefer?

Yes, please. Thanks.

bye,
Heiko
>
> - Simon
>
>> Regards,
>> Peng.
>>
>> -----Original Message-----
>> From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
>> Sent: Wednesday, May 06, 2015 4:56 AM
>> To: Fan Peng-B51431
>> Cc: Stefano Babic; Heiko Schocher; Marek Va?ut; Nikita Kiryanov; U-Boot Mailing List
>> Subject: Re: [PATCH V3] i2c: mxc: refactor i2c driver and support dm
>>
>> On 27 April 2015 at 07:36, Peng Fan <Peng.Fan@freescale.com> wrote:
>>>
>>> 1. Introduce a new structure `struct mxc_i2c_bus`, this structure will
>>>     used for non-DM and DM.
>>> 2. Remove `struct mxc_i2c_regs` structure, but use register offset to access
>>>     registers based on `base` entry of `struct mxc_i2c_bus`.
>>> 3. Remove most `#ifdef I2C_QUIRK_REG`. Using driver_data to contain platform
>>>     flags. A new flag is introduced, I2C_QUIRK_FLAG.
>>> 4. Most functions use `struct mxc_i2c_bus` as one of the parameters.
>>>     Make most functions common to DM and non-DM, try to avoid duplicated code.
>>> 5. Support DM. Pinmux setting is still set by setup_i2c, but we do not
>>>     need bus_i2c_init for DM.
>>> 6. struct i2c_parms and struct sram_data are removed.
>>> 7. Remove bus_i2c_read bus_i2c_write prototype in header file. The frist
>>>     paramter of bus_i2c_init is modified to i2c index. Add new prototype
>>>     i2c_idle_bus and force_idle_bus. Since bus_i2c_init is not good for
>>>     DM I2C and pinctrl is missed, we use a weak function for i2c_idle_bus
>>>     for DM part.
>>>     Board file take the responsibility to implement this function, like this:
>>>     "
>>>     int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
>>>     {
>>>             if (i2c_bus->index == 0)
>>>                     force_idle_bus(i2c_pads_info0);
>>>             else if (i2c_bus->index == 1)
>>>                     force_idle_bus(i2c_pads_info1);
>>>             else
>>>                     xxxxxx
>>>     }
>>>     "
>>>
>>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>>> ---
>>>
>>> Changes v3:
>>>   1. remove bus_i2c_init for DM, introuduce a weak function i2c_idle_bus.
>>>   2. remove static return type for force_idle_bus, since we need to call
>>>      it in i2c_idle_bus which may be implemented in board file. This does
>>>      not hurt for non-DM.
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>>
>>>
>>> Changes v2:
>>>   1. Refactor driver, remove register access based on structure, but use
>>>     'base + offset'
>>>   2. Introduce mxc_i2c_bus structure
>>>   3. Introduce I2C_QUIRK_FLAG and remove most I2C_QUIRK_REG and use
>>>      driver_data to contain the flags for different platforms  4. Avoid
>>> duplicated code between DM and non-DM part  5. The function name
>>> i2c_init_transfer is not changed.
>>>   6. Remove bus_i2c_read/write prototype from header file  7. change
>>> bus_i2c_init's first parameter to i2c index  8. Rename patch name,
>>> since refactor non-DM part.
>>>
>>>   arch/arm/imx-common/i2c-mxv7.c            |   7 +-
>>>   arch/arm/include/asm/imx-common/mxc_i2c.h |  38 +-
>>>   drivers/i2c/mxc_i2c.c                     | 575 ++++++++++++++++++++----------
>>>   3 files changed, 426 insertions(+), 194 deletions(-)
>>>
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2015-05-13  5:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27 13:36 [U-Boot] [PATCH V3] i2c: mxc: refactor i2c driver and support dm Peng Fan
2015-05-05 20:56 ` Simon Glass
2015-05-13  1:09   ` Fan Peng
2015-05-13  1:44     ` Simon Glass
2015-05-13  5:08       ` Heiko Schocher [this message]
2015-05-13 15:24     ` Simon Glass
2015-05-14  2:35       ` Fan Peng

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=5552DC3E.5050107@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.