All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cousson, Benoit" <b-cousson@ti.com>
To: Rob Herring <robherring2@gmail.com>
Cc: tony@atomide.com, devicetree-discuss@lists.ozlabs.org,
	grant.likely@secretlab.ca, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Ben Dooks <ben-linux@fluff.org>
Subject: Re: [PATCH v2 02/10] i2c: OMAP: Add DT support for i2c controller
Date: Thu, 15 Dec 2011 17:09:34 +0100	[thread overview]
Message-ID: <4EEA1BBE.2090802@ti.com> (raw)
In-Reply-To: <4EEA16CB.6040708@gmail.com>

On 12/15/2011 4:48 PM, Rob Herring wrote:
> On 12/15/2011 09:05 AM, Cousson, Benoit wrote:

[...]

>> Or using some omap3-i2c or omap4-i2c to determine the proper version and
>> thus populate the right flags during probe.
>>
>
> If that's specific enough, then yes. I meant that if say only the
> omap3578 (making up numbers here) has errata i207, then define a
> compatible string "ti,omap3578-i2c" that implies that and possibly other
> flags.
>
> To put it another way, there are only N valid combinations of flags and
> N is probably fairly small as long as the flags are dictated by the i2c
> h/w rev or how it was integrated into a particular SOC. So you should
> have N compatible strings that reflect those valid combinations. The
> driver can still use the flags internally.
>
> For any flags that are in fact board level configuration, they should be
> broken out as individual properties. Most of these sound like they are
> properties of the h/w and not user configuration of the h/w.

Yes, indeed, I got the point. This is even much better for the 
implementation standpoint. The whole stuff is located inside the driver 
where it should belong.

>> [...]
>>
>>>> @@ -965,6 +956,31 @@ static const struct i2c_algorithm omap_i2c_algo = {
>>>>        .functionality    = omap_i2c_func,
>>>>    };
>>>>
>>>> +#ifdef CONFIG_OF
>>>> +static struct omap_i2c_bus_platform_data omap3_pdata = {
>>>> +    .rev = OMAP_I2C_IP_VERSION_1,
>>>> +};
>>>> +
>>>> +static struct omap_i2c_bus_platform_data omap4_pdata = {
>>>> +    .rev = OMAP_I2C_IP_VERSION_2,
>>>> +};
>>>
>>> This is redundant. The ip version can be determined from the compatible
>>> string.
>>
>> I'm confused...
>> I'm using the compatible string below to chose the proper value.
>> This flag is then used later at runtime.
>> I'm using a pseudo pdata because that driver is still used in old
>> platform that does and will never not have DT support.
>>
>
> After more thought, never mind. You'll probably need it for handling the
> flags as I proposed above.

Yes, I'm taking advantage of the existing pdata structure to provide the 
proper flags.

Thanks for that feedback,
Benoit


WARNING: multiple messages have this Message-ID (diff)
From: b-cousson@ti.com (Cousson, Benoit)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 02/10] i2c: OMAP: Add DT support for i2c controller
Date: Thu, 15 Dec 2011 17:09:34 +0100	[thread overview]
Message-ID: <4EEA1BBE.2090802@ti.com> (raw)
In-Reply-To: <4EEA16CB.6040708@gmail.com>

On 12/15/2011 4:48 PM, Rob Herring wrote:
> On 12/15/2011 09:05 AM, Cousson, Benoit wrote:

[...]

>> Or using some omap3-i2c or omap4-i2c to determine the proper version and
>> thus populate the right flags during probe.
>>
>
> If that's specific enough, then yes. I meant that if say only the
> omap3578 (making up numbers here) has errata i207, then define a
> compatible string "ti,omap3578-i2c" that implies that and possibly other
> flags.
>
> To put it another way, there are only N valid combinations of flags and
> N is probably fairly small as long as the flags are dictated by the i2c
> h/w rev or how it was integrated into a particular SOC. So you should
> have N compatible strings that reflect those valid combinations. The
> driver can still use the flags internally.
>
> For any flags that are in fact board level configuration, they should be
> broken out as individual properties. Most of these sound like they are
> properties of the h/w and not user configuration of the h/w.

Yes, indeed, I got the point. This is even much better for the 
implementation standpoint. The whole stuff is located inside the driver 
where it should belong.

>> [...]
>>
>>>> @@ -965,6 +956,31 @@ static const struct i2c_algorithm omap_i2c_algo = {
>>>>        .functionality    = omap_i2c_func,
>>>>    };
>>>>
>>>> +#ifdef CONFIG_OF
>>>> +static struct omap_i2c_bus_platform_data omap3_pdata = {
>>>> +    .rev = OMAP_I2C_IP_VERSION_1,
>>>> +};
>>>> +
>>>> +static struct omap_i2c_bus_platform_data omap4_pdata = {
>>>> +    .rev = OMAP_I2C_IP_VERSION_2,
>>>> +};
>>>
>>> This is redundant. The ip version can be determined from the compatible
>>> string.
>>
>> I'm confused...
>> I'm using the compatible string below to chose the proper value.
>> This flag is then used later at runtime.
>> I'm using a pseudo pdata because that driver is still used in old
>> platform that does and will never not have DT support.
>>
>
> After more thought, never mind. You'll probably need it for handling the
> flags as I proposed above.

Yes, I'm taking advantage of the existing pdata structure to provide the 
proper flags.

Thanks for that feedback,
Benoit

  reply	other threads:[~2011-12-15 16:09 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 14:02 [PATCH v2 00/10] OMAP4: Add DT support for i2c and twl6030 Benoit Cousson
2011-12-09 14:02 ` Benoit Cousson
2011-12-09 14:02 ` [PATCH v2 01/10] ARM: OMAP2+: pm: Do not init statically the SR and voltage layer with DT Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2012-01-04 18:04   ` Grant Likely
2012-01-04 18:04     ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 02/10] i2c: OMAP: Add DT support for i2c controller Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2011-12-14  1:06   ` Kevin Hilman
2011-12-14  1:06     ` Kevin Hilman
2012-01-04 13:36     ` Cousson, Benoit
2012-01-04 13:36       ` Cousson, Benoit
2012-01-04 18:08       ` Grant Likely
2012-01-04 18:08         ` Grant Likely
2012-01-04 21:28       ` Kevin Hilman
2012-01-04 21:28         ` Kevin Hilman
     [not found]         ` <87obujb1j2.fsf-l0cyMroinI0@public.gmane.org>
2012-01-04 21:56           ` Grant Likely
2012-01-04 21:56             ` Grant Likely
2011-12-14 16:58   ` Rob Herring
2011-12-14 16:58     ` Rob Herring
2011-12-15 15:05     ` Cousson, Benoit
2011-12-15 15:05       ` Cousson, Benoit
2011-12-15 15:48       ` Rob Herring
2011-12-15 15:48         ` Rob Herring
2011-12-15 16:09         ` Cousson, Benoit [this message]
2011-12-15 16:09           ` Cousson, Benoit
     [not found]   ` <1323439361-1647-3-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2011-12-22  8:22     ` Shubhrajyoti
2011-12-22  8:22       ` Shubhrajyoti
2011-12-09 14:02 ` [PATCH v2 03/10] mfd: twl-core: Add initial DT support for twl4030/twl6030 Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2011-12-19 12:03   ` Samuel Ortiz
2011-12-19 12:03     ` Samuel Ortiz
2011-12-19 13:53     ` Cousson, Benoit
2011-12-19 13:53       ` Cousson, Benoit
     [not found]   ` <1323439361-1647-4-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2012-01-04 18:12     ` Grant Likely
2012-01-04 18:12       ` Grant Likely
     [not found]       ` <20120104181224.GJ15503-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-05 10:21         ` Cousson, Benoit
2012-01-05 10:21           ` Cousson, Benoit
2011-12-09 14:02 ` [PATCH v2 04/10] rtc: rtc-twl: Add DT support for RTC inside twl4030/twl6030 Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
     [not found]   ` <1323439361-1647-5-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2011-12-19 16:52     ` Cousson, Benoit
2011-12-19 16:52       ` Cousson, Benoit
2011-12-26  1:18       ` Alessandro Zummo
2011-12-26  1:18         ` Alessandro Zummo
2011-12-20 15:13     ` Cousson, Benoit
2011-12-20 15:13       ` Cousson, Benoit
2012-01-04 18:13     ` Grant Likely
2012-01-04 18:13       ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 05/10] arm/dts: OMAP4: Add i2c controller nodes Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
     [not found]   ` <1323439361-1647-6-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2012-01-04 18:13     ` Grant Likely
2012-01-04 18:13       ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 06/10] arm/dts: OMAP3: " Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
     [not found]   ` <1323439361-1647-7-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2012-01-04 18:14     ` Grant Likely
2012-01-04 18:14       ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 07/10] arm/dts: omap4-panda: Add twl6030 and i2c EEPROM Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2011-12-14  5:06   ` Kevin Hilman
2011-12-14  5:06     ` Kevin Hilman
2011-12-14 16:50     ` Cousson, Benoit
2011-12-14 16:50       ` Cousson, Benoit
2011-12-15  0:31       ` Kevin Hilman
2011-12-15  0:31         ` Kevin Hilman
     [not found]   ` <1323439361-1647-8-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2012-01-04 18:14     ` Grant Likely
2012-01-04 18:14       ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 08/10] arm/dts: omap4-sdp: Add twl6030, i2c3 and i2c4 devices Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2012-01-04 18:14   ` Grant Likely
2012-01-04 18:14     ` Grant Likely
2011-12-09 14:02 ` [PATCH v2 09/10] arm/dts: omap3-beagle: Add twl4030 and i2c EEPROM Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
     [not found]   ` <1323439361-1647-10-git-send-email-b-cousson-l0cyMroinI0@public.gmane.org>
2012-01-04 18:15     ` Grant Likely
2012-01-04 18:15       ` Grant Likely
2012-01-09 23:24   ` Tabi Timur-B04825
2012-01-09 23:24     ` Tabi Timur-B04825
2012-01-10 10:09     ` Cousson, Benoit
2012-01-10 10:09       ` Cousson, Benoit
2011-12-09 14:02 ` [PATCH v2 10/10] ARM: OMAP2+: board-generic: Remove i2c static init Benoit Cousson
2011-12-09 14:02   ` Benoit Cousson
2012-01-04 18:15   ` Grant Likely
2012-01-04 18:15     ` Grant Likely

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=4EEA1BBE.2090802@ti.com \
    --to=b-cousson@ti.com \
    --cc=ben-linux@fluff.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robherring2@gmail.com \
    --cc=tony@atomide.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.