Tomasz Stanislawski | c40e7e0 | 2011-09-16 18:44:36 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
| 3 | * http://www.samsung.com/ |
| 4 | * |
| 5 | * S5P series device definition for i2c for hdmiphy device |
| 6 | * |
| 7 | * Based on plat-samsung/dev-i2c7.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/gfp.h> |
| 15 | #include <linux/kernel.h> |
| 16 | #include <linux/string.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | |
| 19 | #include <mach/irqs.h> |
| 20 | #include <mach/map.h> |
| 21 | #include <mach/i2c-hdmiphy.h> |
| 22 | |
| 23 | #include <plat/regs-iic.h> |
| 24 | #include <plat/devs.h> |
| 25 | #include <plat/cpu.h> |
| 26 | #include <plat/iic.h> |
| 27 | |
| 28 | static struct resource s5p_i2c_resource[] = { |
| 29 | [0] = { |
| 30 | .start = S5P_PA_IIC_HDMIPHY, |
| 31 | .end = S5P_PA_IIC_HDMIPHY + SZ_4K - 1, |
| 32 | .flags = IORESOURCE_MEM, |
| 33 | }, |
| 34 | [1] = { |
| 35 | .start = IRQ_IIC_HDMIPHY, |
| 36 | .end = IRQ_IIC_HDMIPHY, |
| 37 | .flags = IORESOURCE_IRQ, |
| 38 | }, |
| 39 | }; |
| 40 | |
| 41 | struct platform_device s5p_device_i2c_hdmiphy = { |
| 42 | .name = "s3c2440-hdmiphy-i2c", |
| 43 | .id = -1, |
| 44 | .num_resources = ARRAY_SIZE(s5p_i2c_resource), |
| 45 | .resource = s5p_i2c_resource, |
| 46 | }; |
| 47 | |
| 48 | void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd) |
| 49 | { |
| 50 | struct s3c2410_platform_i2c *npd; |
| 51 | |
| 52 | if (!pd) { |
| 53 | pd = &default_i2c_data; |
| 54 | pd->bus_num = S5P_I2C_HDMIPHY_BUS_NUM; |
| 55 | } |
| 56 | |
| 57 | npd = s3c_set_platdata(pd, sizeof(struct s3c2410_platform_i2c), |
| 58 | &s5p_device_i2c_hdmiphy); |
| 59 | } |