.. | .. |
---|
18 | 18 | #include <linux/i2c.h> |
---|
19 | 19 | #include <linux/io.h> |
---|
20 | 20 | #include <linux/clk.h> |
---|
21 | | -#include <linux/platform_data/at24.h> |
---|
| 21 | +#include <linux/property.h> |
---|
22 | 22 | #include <linux/leds.h> |
---|
23 | 23 | #include <linux/mtd/mtd.h> |
---|
24 | 24 | #include <linux/mtd/partitions.h> |
---|
25 | 25 | #include <linux/slab.h> |
---|
26 | 26 | #include <linux/mtd/rawnand.h> |
---|
| 27 | +#include <linux/nvmem-provider.h> |
---|
27 | 28 | #include <linux/input.h> |
---|
28 | 29 | #include <linux/spi/spi.h> |
---|
29 | 30 | #include <linux/spi/eeprom.h> |
---|
30 | 31 | #include <linux/v4l2-dv-timings.h> |
---|
31 | 32 | #include <linux/platform_data/ti-aemif.h> |
---|
| 33 | +#include <linux/regulator/fixed.h> |
---|
| 34 | +#include <linux/regulator/machine.h> |
---|
32 | 35 | |
---|
33 | 36 | #include <asm/mach-types.h> |
---|
34 | 37 | #include <asm/mach/arch.h> |
---|
.. | .. |
---|
143 | 146 | .mask_chipsel = BIT(14), |
---|
144 | 147 | .parts = davinci_nand_partitions, |
---|
145 | 148 | .nr_parts = ARRAY_SIZE(davinci_nand_partitions), |
---|
146 | | - .ecc_mode = NAND_ECC_HW, |
---|
| 149 | + .engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST, |
---|
147 | 150 | .bbt_options = NAND_BBT_USE_FLASH, |
---|
148 | 151 | .ecc_bits = 4, |
---|
149 | 152 | }; |
---|
.. | .. |
---|
203 | 206 | .num_resources = ARRAY_SIZE(davinci_aemif_resources), |
---|
204 | 207 | }; |
---|
205 | 208 | |
---|
206 | | -static struct at24_platform_data eeprom_info = { |
---|
207 | | - .byte_len = (256*1024) / 8, |
---|
208 | | - .page_size = 64, |
---|
209 | | - .flags = AT24_FLAG_ADDR16, |
---|
210 | | - .setup = davinci_get_mac_addr, |
---|
211 | | - .context = (void *)0x7f00, |
---|
| 209 | +static struct nvmem_cell_info davinci_nvmem_cells[] = { |
---|
| 210 | + { |
---|
| 211 | + .name = "macaddr", |
---|
| 212 | + .offset = 0x7f00, |
---|
| 213 | + .bytes = ETH_ALEN, |
---|
| 214 | + } |
---|
| 215 | +}; |
---|
| 216 | + |
---|
| 217 | +static struct nvmem_cell_table davinci_nvmem_cell_table = { |
---|
| 218 | + .nvmem_name = "1-00500", |
---|
| 219 | + .cells = davinci_nvmem_cells, |
---|
| 220 | + .ncells = ARRAY_SIZE(davinci_nvmem_cells), |
---|
| 221 | +}; |
---|
| 222 | + |
---|
| 223 | +static struct nvmem_cell_lookup davinci_nvmem_cell_lookup = { |
---|
| 224 | + .nvmem_name = "1-00500", |
---|
| 225 | + .cell_name = "macaddr", |
---|
| 226 | + .dev_id = "davinci_emac.1", |
---|
| 227 | + .con_id = "mac-address", |
---|
| 228 | +}; |
---|
| 229 | + |
---|
| 230 | +static const struct property_entry eeprom_properties[] = { |
---|
| 231 | + PROPERTY_ENTRY_U32("pagesize", 64), |
---|
| 232 | + { } |
---|
212 | 233 | }; |
---|
213 | 234 | |
---|
214 | 235 | static struct i2c_board_info i2c_info[] = { |
---|
215 | 236 | { |
---|
216 | 237 | I2C_BOARD_INFO("24c256", 0x50), |
---|
217 | | - .platform_data = &eeprom_info, |
---|
| 238 | + .properties = eeprom_properties, |
---|
218 | 239 | }, |
---|
219 | 240 | { |
---|
220 | 241 | I2C_BOARD_INFO("tlv320aic3x", 0x18), |
---|
.. | .. |
---|
224 | 245 | static struct davinci_i2c_platform_data i2c_pdata = { |
---|
225 | 246 | .bus_freq = 400 /* kHz */, |
---|
226 | 247 | .bus_delay = 0 /* usec */, |
---|
| 248 | +}; |
---|
| 249 | + |
---|
| 250 | +/* Fixed regulator support */ |
---|
| 251 | +static struct regulator_consumer_supply fixed_supplies_3_3v[] = { |
---|
| 252 | + /* Baseboard 3.3V: 5V -> TPS767D301 -> 3.3V */ |
---|
| 253 | + REGULATOR_SUPPLY("AVDD", "1-0018"), |
---|
| 254 | + REGULATOR_SUPPLY("DRVDD", "1-0018"), |
---|
| 255 | + REGULATOR_SUPPLY("IOVDD", "1-0018"), |
---|
| 256 | +}; |
---|
| 257 | + |
---|
| 258 | +static struct regulator_consumer_supply fixed_supplies_1_8v[] = { |
---|
| 259 | + /* Baseboard 1.8V: 5V -> TPS767D301 -> 1.8V */ |
---|
| 260 | + REGULATOR_SUPPLY("DVDD", "1-0018"), |
---|
227 | 261 | }; |
---|
228 | 262 | |
---|
229 | 263 | static int dm365evm_keyscan_enable(struct device *dev) |
---|
.. | .. |
---|
781 | 815 | if (ret) |
---|
782 | 816 | pr_warn("%s: GPIO init failed: %d\n", __func__, ret); |
---|
783 | 817 | |
---|
| 818 | + regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v, |
---|
| 819 | + ARRAY_SIZE(fixed_supplies_1_8v), 1800000); |
---|
| 820 | + regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v, |
---|
| 821 | + ARRAY_SIZE(fixed_supplies_3_3v), 3300000); |
---|
| 822 | + |
---|
| 823 | + nvmem_add_cell_table(&davinci_nvmem_cell_table); |
---|
| 824 | + nvmem_add_cell_lookups(&davinci_nvmem_cell_lookup, 1); |
---|
| 825 | + |
---|
784 | 826 | evm_init_i2c(); |
---|
785 | 827 | davinci_serial_init(dm365_serial_device); |
---|
786 | 828 | |
---|
.. | .. |
---|
794 | 836 | /* maybe setup mmc1/etc ... _after_ mmc0 */ |
---|
795 | 837 | evm_init_cpld(); |
---|
796 | 838 | |
---|
797 | | -#ifdef CONFIG_SND_DM365_AIC3X_CODEC |
---|
| 839 | +#ifdef CONFIG_SND_SOC_DM365_AIC3X_CODEC |
---|
798 | 840 | dm365_init_asp(); |
---|
799 | | -#elif defined(CONFIG_SND_DM365_VOICE_CODEC) |
---|
| 841 | +#elif defined(CONFIG_SND_SOC_DM365_VOICE_CODEC) |
---|
800 | 842 | dm365_init_vc(); |
---|
801 | 843 | #endif |
---|
802 | 844 | dm365_init_rtc(); |
---|
.. | .. |
---|
809 | 851 | MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM") |
---|
810 | 852 | .atag_offset = 0x100, |
---|
811 | 853 | .map_io = dm365_evm_map_io, |
---|
812 | | - .init_irq = davinci_irq_init, |
---|
| 854 | + .init_irq = dm365_init_irq, |
---|
813 | 855 | .init_time = dm365_init_time, |
---|
814 | 856 | .init_machine = dm365_evm_init, |
---|
815 | 857 | .init_late = davinci_init_late, |
---|