[i2c] Fwd: [PATCH 2/3] I2C: at24: add kernel interface for reading/writing EEPROM

Jon Smirl jonsmirl at gmail.com
Tue Aug 26 05:40:50 CEST 2008


On 8/25/08, David Brownell <david-b at pacbell.net> wrote:
> My own comments on this:
>
>         - I'd like to see at24.c use something running before
>           device_initcall, so suitably configured system can
>           have drivers calling platform_device_probe() from
>           their own initcalls and yet have access to the config
>           data from the EEPROMs.
>
>         - Seems to me that "struct at24_iface" should be more
>           generic ... the same notion works for SPI eeproms,
>           NVRAM as found in RTCs, etc.
>
>  Comments?

Would it make sense to use bus notifiers to track the detection of a
at24 chip? I have some MMC code in my tree that is using them.

+static int of_mmc_spi_notify(struct notifier_block *nb, unsigned long action,
+			     void *_dev)
+{
+	struct device *dev = _dev;
+
+	switch (action) {
+	case BUS_NOTIFY_ADD_DEVICE:
+		return of_mmc_spi_add(dev);
+	case BUS_NOTIFY_DEL_DEVICE:
+		return of_mmc_spi_del(dev);
+	};
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block of_mmc_spi_notifier = {
+	.notifier_call = of_mmc_spi_notify,
+};
+

-- 
Jon Smirl
jonsmirl at gmail.com



More information about the i2c mailing list