i2c: OF helpers for the i2c API
Subsystems (2)
This patch implements various helpers to support OF bindings for the i2c API.
Signed-off-by Jochen Friedrich <[email protected]>
--- drivers/of/Kconfig | 6 +++ drivers/of/Makefile | 1 + drivers/of/i2c.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/of_i2c.h | 24 ++++++++++ 4 files changed, 146 insertions(+), 0 deletions(-) create mode 100644 drivers/of/i2c.c create mode 100644 include/linux/of_i2c.h
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_bool y + depends on OF && PPC_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) += i2c.o
drivers/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 · 1 line
1.5.4.5
From: Jochen Friedrich <[email protected]>
Date: Fri, 11 Apr 2008 16:09:17 +0200
drivers/of/Kconfig line 9
Quoted 6 lines
drivers/of/Kconfig +6
-0+ +config OF_I2C + def_bool y + depends on OF && PPC_OF && I2C + help + OpenFirmware I2C accessors
I wouldn't mind trying to use this infrastructure on sparc64, and I don't see any powerpc specific interfaces being invoked, so if you could remove the PPC_OF requirement I'd appreciate it.
Thanks.
Quoted 4 lines · David Miller
I wouldn't mind trying to use this infrastructure on sparc64, and I don't see any powerpc specific interfaces being invoked, so if you could remove the
PPC_OFrequirement I'd appreciate it.
I've resenf the patch without the dependency on PPC_OF.
Thanks for the comment.
Jochen