Add i2c locators, add a i2c bus indexer and provide function prototype for the
pinset to pindata function.
This commit is contained in:
parent
3619c72c99
commit
56e033dde9
@ -265,6 +265,7 @@
|
||||
|
||||
static const struct exyo_locators exynos4_locators[] = {
|
||||
{ "exyogpio", 0, 0, NOPORT, NOINTR, 0 },
|
||||
{ "exyoiic", 0, 0, NOPORT, NOINTR, 0 },
|
||||
{ "mct", OFFANDSIZE(,MCT), NOPORT, IRQ_G0_IRQ, 0 },
|
||||
{ "exyowdt", OFFANDSIZE(,WDT), NOPORT, IRQ_WDT, 0 },
|
||||
{ "sscom", OFFANDSIZE(,UART0), 0, IRQ_UART0, 0 },
|
||||
@ -278,3 +279,25 @@ const struct exyo_locinfo exynos4_locinfo = {
|
||||
.locators = exynos4_locators,
|
||||
.nlocators = __arraycount(exynos4_locators)
|
||||
};
|
||||
|
||||
|
||||
/* flag signal the use of gpio */
|
||||
static const struct exyo_locators exynos4_i2c_locators[] = {
|
||||
/* busname, sdabit, slcbit, func */
|
||||
{ "iic0", OFFANDSIZE(,I2C0), 0, IRQ_I2C0, 1 , "GPD1", 0, 1, 2 },
|
||||
{ "iic1", OFFANDSIZE(,I2C1), 1, IRQ_I2C1, 1 , "GPD1", 2, 3, 2 },
|
||||
{ "iic2", OFFANDSIZE(,I2C2), 2, IRQ_I2C2, 1 , "GPA0", 6, 7, 2 },
|
||||
{ "iic3", OFFANDSIZE(,I2C3), 3, IRQ_I2C3, 1 , "GPA1", 2, 3, 3 },
|
||||
{ "iic4", OFFANDSIZE(,I2C4), 4, IRQ_I2C4, 1 , "GPB", 0, 1, 3 },
|
||||
{ "iic5", OFFANDSIZE(,I2C5), 5, IRQ_I2C5, 1 , "GPB", 2, 3, 3 },
|
||||
{ "iic6", OFFANDSIZE(,I2C6), 6, IRQ_I2C6, 1 , "GPC1", 3, 4, 4 },
|
||||
{ "iic7", OFFANDSIZE(,I2C7), 7, IRQ_I2C7, 1 , "GPD0", 2, 3, 3 },
|
||||
{ "iic8", OFFANDSIZE(,I2CHDMI), 8, IRQ_HDMI_I2C, 0 , "", 0, 0, 0 },
|
||||
};
|
||||
|
||||
|
||||
const struct exyo_locinfo exynos4_i2c_locinfo = {
|
||||
.locators = exynos4_i2c_locators,
|
||||
.nlocators = __arraycount(exynos4_i2c_locators)
|
||||
};
|
||||
|
||||
|
@ -224,3 +224,15 @@ const struct exyo_locinfo exynos5_locinfo = {
|
||||
.locators = exynos5_locators,
|
||||
.nlocators = __arraycount(exynos5_locators)
|
||||
};
|
||||
|
||||
|
||||
/* flag signal the use of gpio */
|
||||
static const struct exyo_locators exynos5_i2c_locators[] = {
|
||||
};
|
||||
|
||||
|
||||
const struct exyo_locinfo exynos5_i2c_locinfo = {
|
||||
.locators = exynos5_i2c_locators,
|
||||
.nlocators = __arraycount(exynos5_i2c_locators)
|
||||
};
|
||||
|
||||
|
@ -35,13 +35,16 @@
|
||||
|
||||
#include <arm/samsung/exynos_var.h>
|
||||
|
||||
|
||||
struct exyo_locinfo {
|
||||
const struct exyo_locators *locators;
|
||||
size_t nlocators;
|
||||
};
|
||||
|
||||
extern const struct exyo_locinfo exynos4_locinfo;
|
||||
extern const struct exyo_locinfo exynos4_i2c_locinfo;
|
||||
extern const struct exyo_locinfo exynos5_locinfo;
|
||||
extern const struct exyo_locinfo exynos5_i2c_locinfo;
|
||||
|
||||
/* XXXNH needed? */
|
||||
#define NOPORT EXYOCF_PORT_DEFAULT
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exynos_var.h,v 1.8 2014/05/10 20:24:06 reinoud Exp $ */
|
||||
/* $NetBSD: exynos_var.h,v 1.9 2014/05/16 10:04:58 reinoud Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
@ -72,6 +72,10 @@ struct exyo_locators {
|
||||
int loc_port;
|
||||
int loc_intr;
|
||||
int loc_flags;
|
||||
|
||||
/* for i2c: */
|
||||
const char *loc_gpio_bus;
|
||||
uint8_t loc_sda, loc_slc, loc_func;
|
||||
};
|
||||
|
||||
#if 0
|
||||
@ -97,7 +101,7 @@ struct exyo_attach_args {
|
||||
struct exynos_gpio_pinset {
|
||||
char pinset_group[10];
|
||||
uint8_t pinset_func;
|
||||
uint32_t pinset_mask;
|
||||
uint8_t pinset_mask;
|
||||
};
|
||||
|
||||
struct exynos_gpio_pindata {
|
||||
@ -106,6 +110,11 @@ struct exynos_gpio_pindata {
|
||||
};
|
||||
|
||||
|
||||
#define EXYNOS_MAX_IIC_BUSSES 9
|
||||
struct i2c_controller;
|
||||
extern struct i2c_controller *exynos_i2cbus[EXYNOS_MAX_IIC_BUSSES];
|
||||
|
||||
|
||||
extern struct bus_space exynos_bs_tag;
|
||||
extern struct bus_space exynos_a4x_bs_tag;
|
||||
extern struct arm32_bus_dma_tag exynos_bus_dma_tag;
|
||||
@ -126,6 +135,8 @@ extern void exynos_wdt_reset(void);
|
||||
extern bool exynos_gpio_pinset_available(const struct exynos_gpio_pinset *);
|
||||
extern void exynos_gpio_pinset_acquire(const struct exynos_gpio_pinset *);
|
||||
extern void exynos_gpio_pinset_release(const struct exynos_gpio_pinset *);
|
||||
extern void exynos_gpio_pinset_to_pindata(const struct exynos_gpio_pinset *,
|
||||
int pinnr, struct exynos_gpio_pindata *);
|
||||
extern bool exynos_gpio_pin_reserve(const char *, struct exynos_gpio_pindata *);
|
||||
|
||||
static inline void
|
||||
|
Loading…
x
Reference in New Issue
Block a user