1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/plat-iop/i2c.c
6 * Copyright (C) 2001 MontaVista Software, Inc.
7 * Copyright (C) 2004 Intel Corporation.
11 #include <linux/init.h>
12 #include <linux/major.h>
14 #include <linux/platform_device.h>
15 #include <linux/serial.h>
16 #include <linux/tty.h>
17 #include <linux/serial_core.h>
19 #include <linux/gpio/machine.h>
21 #include <asm/mach/map.h>
22 #include <asm/setup.h>
23 #include <asm/memory.h>
24 #include <asm/mach/arch.h>
31 * Each of the I2C busses have corresponding GPIO lines, and the driver
32 * need to access these directly to drive the bus low at times.
35 struct gpiod_lookup_table iop3xx_i2c0_gpio_lookup = {
36 .dev_id = "IOP3xx-I2C.0",
38 GPIO_LOOKUP("gpio-iop", 7, "scl", GPIO_ACTIVE_HIGH),
39 GPIO_LOOKUP("gpio-iop", 6, "sda", GPIO_ACTIVE_HIGH),
44 struct gpiod_lookup_table iop3xx_i2c1_gpio_lookup = {
45 .dev_id = "IOP3xx-I2C.1",
47 GPIO_LOOKUP("gpio-iop", 5, "scl", GPIO_ACTIVE_HIGH),
48 GPIO_LOOKUP("gpio-iop", 4, "sda", GPIO_ACTIVE_HIGH),
53 static struct resource iop3xx_i2c0_resources[] = {
57 .flags = IORESOURCE_MEM,
60 .start = IRQ_IOP32X_I2C_0,
61 .end = IRQ_IOP32X_I2C_0,
62 .flags = IORESOURCE_IRQ,
66 struct platform_device iop3xx_i2c0_device = {
70 .resource = iop3xx_i2c0_resources,
74 static struct resource iop3xx_i2c1_resources[] = {
78 .flags = IORESOURCE_MEM,
81 .start = IRQ_IOP32X_I2C_1,
82 .end = IRQ_IOP32X_I2C_1,
83 .flags = IORESOURCE_IRQ,
87 struct platform_device iop3xx_i2c1_device = {
91 .resource = iop3xx_i2c1_resources,