i2c: OF helpers for the i2c API
Subsystems (2)
PATCH v3 3/7 i2c: OF helpers for the i2c API
This patch implements various helpers to support OF bindings for the i2c API.
Signed-off-by Jochen Friedrich <[email protected]>
Acked-by Stephen Rothwell <[email protected]>
--- drivers/of/Kconfig | 6 +++ drivers/of/Makefile | 1 + drivers/of/of_i2c.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/of_i2c.h | 24 ++++++++++ 4 files changed, 146 insertions(+), 0 deletions(-) create mode 100644 drivers/of/of_i2c.c create mode 100644 include/linux/of_i2c.h
Changes to v2:
- make helpers compile as module as well, if i2c-core is compiled as module.
- rename drivers/of/i2c.c to drivers/of/of_i2c.c to avoid module namespace conflict.
drivers/of/Kconfig +6 -0
@@ -1,3 +1,9 @@ config OF_DEVICE def_bool y depends on OF && (SPARC || PPC_OF) + +config OF_I2C + def_tristate I2C + depends on OF && I2C + help + OpenFirmware I2C accessors
drivers/of/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-y = base.o obj-$(CONFIG_OF_DEVICE) += device.o platform.o +obj-$(CONFIG_OF_I2C) += of_i2c.o
drivers/of/of_i2c.c new file +115 -0
115 lines not on this page · raw message
include/linux/of_i2c.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Generic I2C API implementation for PowerPC. +* +* Copyright (c) 2008 Jochen Friedrich <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#ifndef __LINUX_OF_I2C_H +#define __LINUX_OF_I2C_H + +#include <linux/i2c.h> + +#ifdef CONFIG_OF_I2C + +void of_register_i2c_devices (struct i2c_adapter *adap, +struct device_node *adap_node); + +#endif /* CONFIG_OF_I2C */ + +#endif /* __LINUX_OF_I2C_H */
Signature · 7 lines
1.5.5 _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c