Re: [PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-05 Thread Shubhrajyoti
On Monday 05 November 2012 02:35 PM, Felipe Balbi wrote:
>> egister map is different.
>> > 
>> > So the scheme may still be required.
> fair enough, but drop it from debugging messages.
OK thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-05 Thread Felipe Balbi
Hi,

On Mon, Nov 05, 2012 at 02:14:48PM +0530, Shubhrajyoti wrote:
> On Monday 05 November 2012 01:23 PM, Felipe Balbi wrote:
> > Hi,
> >
> > On Sun, Nov 04, 2012 at 04:14:29PM +0530, Shubhrajyoti D wrote:
> >> The dtrev is used only for the comments. Remove the same and use
> >> the scheme instead to know if it is version2.
> >>
> >> Signed-off-by: Shubhrajyoti D 
> > I would drop dtrev completely and not use scheme to "emulate" it.
> However for ver2 ie omap4plus and previous versions the
> register map is different.
> 
> So the scheme may still be required.

fair enough, but drop it from debugging messages.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-05 Thread Shubhrajyoti
On Monday 05 November 2012 01:23 PM, Felipe Balbi wrote:
> Hi,
>
> On Sun, Nov 04, 2012 at 04:14:29PM +0530, Shubhrajyoti D wrote:
>> The dtrev is used only for the comments. Remove the same and use
>> the scheme instead to know if it is version2.
>>
>> Signed-off-by: Shubhrajyoti D 
> I would drop dtrev completely and not use scheme to "emulate" it.
However for ver2 ie omap4plus and previous versions the
register map is different.

So the scheme may still be required.
>  dtrev
> is wrong and unnecessary; it was only created due to the wrong
> assumption that HW revision register was wrong. Looks like that
> assumption was made based on the driver which is clearly wrong wrt
> revision detection.
>
> Also, when dropping dtrev, also drop it from platform_data and
> omap_hwmod database (could be done on a separate patch).
OK would do that.
>

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-04 Thread Felipe Balbi
Hi,

On Sun, Nov 04, 2012 at 04:14:29PM +0530, Shubhrajyoti D wrote:
> The dtrev is used only for the comments. Remove the same and use
> the scheme instead to know if it is version2.
> 
> Signed-off-by: Shubhrajyoti D 

I would drop dtrev completely and not use scheme to "emulate" it. dtrev
is wrong and unnecessary; it was only created due to the wrong
assumption that HW revision register was wrong. Looks like that
assumption was made based on the driver which is clearly wrong wrt
revision detection.

Also, when dropping dtrev, also drop it from platform_data and
omap_hwmod database (could be done on a separate patch).

-- 
balbi


signature.asc
Description: Digital signature


[PATCHv2 3/7] i2c: omap: remove the dtrev

2012-11-04 Thread Shubhrajyoti D
The dtrev is used only for the comments. Remove the same and use
the scheme instead to know if it is version2.

Signed-off-by: Shubhrajyoti D 
---
 drivers/i2c/busses/i2c-omap.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index e009985..b62cd9d 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -191,7 +191,6 @@ struct omap_i2c_dev {
u32 latency;/* maximum MPU wkup latency */
struct pm_qos_request   pm_qos_request;
u32 speed;  /* Speed of bus in kHz */
-   u32 dtrev;  /* extra revision from DT */
u32 flags;
u16 cmd_err;
u8  *buf;
@@ -1076,7 +1075,7 @@ omap_i2c_probe(struct platform_device *pdev)
int irq;
int r;
u32 rev;
-   u16 minor, major;
+   u16 minor, major, scheme;
 
/* NOTE: driver uses the static register mapping */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1108,7 +1107,6 @@ omap_i2c_probe(struct platform_device *pdev)
u32 freq = 10; /* default to 10 Hz */
 
pdata = match->data;
-   dev->dtrev = pdata->rev;
dev->flags = pdata->flags;
 
of_property_read_u32(node, "clock-frequency", &freq);
@@ -1117,7 +1115,6 @@ omap_i2c_probe(struct platform_device *pdev)
} else if (pdata != NULL) {
dev->speed = pdata->clkrate;
dev->flags = pdata->flags;
-   dev->dtrev = pdata->rev;
}
 
dev->dev = &pdev->dev;
@@ -1146,7 +1143,8 @@ omap_i2c_probe(struct platform_device *pdev)
 */
rev = __raw_readw(dev->base + 0x04);
 
-   switch (OMAP_I2C_SCHEME(rev)) {
+   scheme = OMAP_I2C_SCHEME(rev);
+   switch (scheme) {
case OMAP_I2C_SCHEME_0:
dev->regs = (u8 *)reg_map_ip_v1;
dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff;
@@ -1231,7 +1229,7 @@ omap_i2c_probe(struct platform_device *pdev)
}
 
dev_info(dev->dev, "bus %d rev%d.%d.%d at %d kHz\n", adap->nr,
-dev->dtrev, major, minor, dev->speed);
+scheme, major, minor, dev->speed);
 
of_i2c_register_devices(adap);
 
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html