Implement i2c using gpio for Exynos5 and Odroid-XU

This commit is contained in:
reinoud 2014-08-19 16:18:15 +00:00
parent ef1ba863e5
commit 5d42d105e8
2 changed files with 24 additions and 3 deletions

View File

@ -91,7 +91,7 @@
#define IRQ_CPU_NFIQ_1 IRQ_SPI(67)
#define IRQ_CPU_NFIQ_0 IRQ_SPI(66)
#define IRQ_TMU IRQ_SPI(65)
#define IRQ_I2C IRQ_SPI(64)
#define IRQ_HDMI_I2C IRQ_SPI(64)
#define IRQ_I2C7 IRQ_SPI(63)
#define IRQ_I2C6 IRQ_SPI(62)
#define IRQ_I2C5 IRQ_SPI(61)
@ -229,6 +229,16 @@ const struct exyo_locinfo exynos5_locinfo = {
/* flag signal the use of gpio */
static const struct exyo_locators exynos5_i2c_locators[] = {
/* busname, sdabit, slcbit, func */
{ "iic0", OFFANDSIZE(,I2C0), 0, IRQ_I2C0_USI0, 1 , "GPB3", 0, 1, 2 },
{ "iic1", OFFANDSIZE(,I2C1), 1, IRQ_I2C1_USI1, 1 , "GPB3", 2, 3, 2 },
{ "iic2", OFFANDSIZE(,I2C2), 2, IRQ_I2C2_USI2, 1 , "GPA0", 6, 7, 3 },
{ "iic3", OFFANDSIZE(,I2C3), 3, IRQ_I2C3_USI3, 1 , "GPA1", 2, 3, 3 },
{ "iic4", OFFANDSIZE(,I2C4), 4, IRQ_I2C4, 1 , "GPA2", 0, 1, 3 },
{ "iic5", OFFANDSIZE(,I2C5), 5, IRQ_I2C5, 1 , "GPA2", 2, 3, 3 },
{ "iic6", OFFANDSIZE(,I2C6), 6, IRQ_I2C6, 1 , "GPB1", 3, 4, 4 },
{ "iic7", OFFANDSIZE(,I2C7), 7, IRQ_I2C7, 1 , "GPB2", 2, 3, 3 },
{ "iic8", OFFANDSIZE(,I2CHDMI), 8, IRQ_HDMI_I2C, 0 , "", 0, 0, 0 },
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: odroid_machdep.c,v 1.26 2014/08/14 15:57:51 reinoud Exp $ */
/* $NetBSD: odroid_machdep.c,v 1.27 2014/08/19 16:18:15 reinoud Exp $ */
/*
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.26 2014/08/14 15:57:51 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: odroid_machdep.c,v 1.27 2014/08/19 16:18:15 reinoud Exp $");
#include "opt_evbarm_boardtype.h"
#include "opt_exynos.h"
@ -720,6 +720,17 @@ odroid_device_register(device_t self, void *aux)
/* internal hub IIRC, unknown if this line exists */
//prop_dictionary_set_cstring(dict, "p3v3_en", ">GPA1[3]");
}
if (device_is_a(self, "exyoiic") && (IS_EXYNOS5_P())) {
/* IIC0 not used (NC) */
prop_dictionary_set_bool(dict, "iic1_enable", true);
prop_dictionary_set_bool(dict, "iic2_enable", true);
/* IIC3 not used (NC) */
prop_dictionary_set_bool(dict, "iic4_enable", true);
/* IIC5 not used (NC) */
/* IIC6 used differently (SCLK used as led1) */
/* IIC7 used differently (PWM, though NC) */
/* IIC8 HDMI, not possible trough GPIO */
}
#endif
}