[PATCH] add pismo support
Mike Frysinger
vapier.adi at gmail.com
Sun Nov 29 10:12:43 EST 2009
On Sun, Nov 29, 2009 at 09:56, Russell King - ARM Linux wrote:
> --- a/drivers/mtd/maps/Kconfig
> +++ b/drivers/mtd/maps/Kconfig
> +config MTD_PISMO
> + tristate "MTD discovery driver for PISMO modules"
> + depends on I2C
> + depends on ARCH_VERSATILE
> + help
> + This driver allows for discovery of PISMO modules - see
> + <http://www.pismoworld.org/>. These are small modules containing
> + up to five memory devices (eg, SRAM, flash, DOC) described by an
> + I2C EEPROM.
> +
> + This driver does not create any MTD maps itself; instead it
> + creates MTD physmap and MTD SRAM platform devices. If you
> + enable this option, you should consider enabling MTD_PHYSMAP
> + and/or MTD_PLATRAM according to the devices on your module.
a sentence telling the module name when built as a module would be good
> +static unsigned int pismo_width_to_bytes(unsigned int width)
> +static int pismo_eeprom_read(struct i2c_client *client, void *buf, u8 addr,
> + size_t size)
> +static int pismo_add_device(struct pismo_data *pismo, int i,
> + struct pismo_mem *region, const char *name, void *pdata, size_t psize)
> +static int pismo_add_nor(struct pismo_data *pismo, int i,
> + struct pismo_mem *region)
> +static int pismo_add_sram(struct pismo_data *pismo, int i,
> + struct pismo_mem *region)
> +static void pismo_add_one(struct pismo_data *pismo, int i,
> + const struct pismo_cs_block *cs, phys_addr_t base)
> +static int __devinit pismo_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
all should be __devinit since they're only called by pismo_probe()
> +static int pismo_init(void)
__init
> + if (sizeof(struct pismo_cs_block) != 48) {
> + pr_err("BUG: PISMO: sizeof(struct pismo_cs_block) wrong\n");
> + return -EINVAL;
> + }
> + if (sizeof(struct pismo_eeprom) != 256) {
> + pr_err("BUG: PISMO: sizeof(struct pismo_eeprom) wrong\n");
> + return -EINVAL;
> + }
BUILD_BUG()
-mike
More information about the linux-mtd
mailing list