linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: Octeon: Register EEPROM device on the I2C bus

To: Yang Shi <yang.shi@windriver.com>
Subject: Re: [PATCH] MIPS: Octeon: Register EEPROM device on the I2C bus
From: Jean Delvare <khali@linux-fr.org>
Date: Fri, 5 Mar 2010 11:52:13 +0100
Cc: Michael Lawnick <ml.lawnick@gmx.de>, Wolfram Sang <w.sang@pengutronix.de>, ddaney@caviumnetworks.com, ben-linux@fluff.org, ralf@linux-mips.org, linux-mips@linux-mips.org, linux-i2c@vger.kernel.org, Konstantin Lazarev <klazarev@sbcglobal.net>
In-reply-to: <4B90DF48.50005@windriver.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1267772895-25409-1-git-send-email-yang.shi@windriver.com> <20100305071130.GB21925@pengutronix.de> <4B90B341.9000601@windriver.com> <20100305074155.GD21925@pengutronix.de> <4B90B888.6060005@windriver.com> <20100305095040.6ab4612c@hyperion.delvare> <4B90D85E.6040308@gmx.de> <4B90DF48.50005@windriver.com>
Sender: linux-mips-bounce@linux-mips.org
On Fri, 05 Mar 2010 18:39:04 +0800, Yang Shi wrote:
> Hi guys,
> 
> Thanks for you guys kind advice. I think I find the cause. I coded a 
> wrong eeprom type, "at24" can't work here, it should be "24c64". It 
> works with AT24 eeprom driver, but I'm not sure if this is the right type.

Actually, "at24" can work but you have to provide extra parameters
detailing the size, page size etc. of the EEPROM. All the "24cXX" names
are shortcuts with predefined sizes.

> 
> So, a possible correct to the patch is that:
> 
> +{
> +    I2C_BOARD_INFO("24c64",·0x50),
> +},

Well, what EEPROM type do you have exactly? 24c64 is for 64 kbit (8
kByte) EEPROMs using 16-bit addressing. You must use the correct type,
otherwise the at24 driver will misbehave. I am a little surprised
because originally you went for "eeprom" which is not compatible with
"24c64" (8-bit vs. 16-bit addressing).

Also note that you may want to provide specific page size if you have
tight control over what hardware is used and you intend to write to the
EEPROM on a regular basis. The driver defaults to safe but slow
settings.

OTOH, if you do _not_ want to write to the EEPROM, you want to provide
the AT24_FLAG_READONLY flag.

-- 
Jean Delvare

<Prev in Thread] Current Thread [Next in Thread>