1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/plat-iop/i2c.c
5 * Author: Nicolas Pitre <nico@cam.org>
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>
20 #include <asm/pgtable.h>
22 #include <asm/mach/map.h>
23 #include <asm/setup.h>
24 #include <asm/memory.h>
25 #include <asm/mach/arch.h>
32 * Each of the I2C busses have corresponding GPIO lines, and the driver
33 * need to access these directly to drive the bus low at times.
36 struct gpiod_lookup_table iop3xx_i2c0_gpio_lookup
= {
37 .dev_id
= "IOP3xx-I2C.0",
39 GPIO_LOOKUP("gpio-iop", 7, "scl", GPIO_ACTIVE_HIGH
),
40 GPIO_LOOKUP("gpio-iop", 6, "sda", GPIO_ACTIVE_HIGH
),
45 struct gpiod_lookup_table iop3xx_i2c1_gpio_lookup
= {
46 .dev_id
= "IOP3xx-I2C.1",
48 GPIO_LOOKUP("gpio-iop", 5, "scl", GPIO_ACTIVE_HIGH
),
49 GPIO_LOOKUP("gpio-iop", 4, "sda", GPIO_ACTIVE_HIGH
),
54 static struct resource iop3xx_i2c0_resources
[] = {
58 .flags
= IORESOURCE_MEM
,
61 .start
= IRQ_IOP32X_I2C_0
,
62 .end
= IRQ_IOP32X_I2C_0
,
63 .flags
= IORESOURCE_IRQ
,
67 struct platform_device iop3xx_i2c0_device
= {
71 .resource
= iop3xx_i2c0_resources
,
75 static struct resource iop3xx_i2c1_resources
[] = {
79 .flags
= IORESOURCE_MEM
,
82 .start
= IRQ_IOP32X_I2C_1
,
83 .end
= IRQ_IOP32X_I2C_1
,
84 .flags
= IORESOURCE_IRQ
,
88 struct platform_device iop3xx_i2c1_device
= {
92 .resource
= iop3xx_i2c1_resources
,