| .. | .. |
|---|
| 22 | 22 | #include <linux/gpio.h> |
|---|
| 23 | 23 | #include <linux/platform_device.h> |
|---|
| 24 | 24 | #include <linux/i2c.h> |
|---|
| 25 | | -#include <linux/platform_data/at24.h> |
|---|
| 25 | +#include <linux/property.h> |
|---|
| 26 | 26 | #include <linux/platform_data/pcf857x.h> |
|---|
| 27 | 27 | #include <linux/platform_data/ti-aemif.h> |
|---|
| 28 | 28 | |
|---|
| .. | .. |
|---|
| 32 | 32 | #include <linux/mtd/mtd.h> |
|---|
| 33 | 33 | #include <linux/mtd/rawnand.h> |
|---|
| 34 | 34 | #include <linux/mtd/partitions.h> |
|---|
| 35 | +#include <linux/nvmem-provider.h> |
|---|
| 35 | 36 | #include <linux/clk.h> |
|---|
| 36 | 37 | #include <linux/export.h> |
|---|
| 37 | 38 | #include <linux/platform_data/gpio-davinci.h> |
|---|
| .. | .. |
|---|
| 43 | 44 | #include <asm/mach/arch.h> |
|---|
| 44 | 45 | |
|---|
| 45 | 46 | #include <mach/common.h> |
|---|
| 46 | | -#include <mach/irqs.h> |
|---|
| 47 | 47 | #include <mach/serial.h> |
|---|
| 48 | 48 | |
|---|
| 49 | 49 | #include "davinci.h" |
|---|
| 50 | +#include "irqs.h" |
|---|
| 50 | 51 | |
|---|
| 51 | 52 | #define NAND_BLOCK_SIZE SZ_128K |
|---|
| 52 | 53 | |
|---|
| .. | .. |
|---|
| 90 | 91 | .mask_ale = 0x40000, |
|---|
| 91 | 92 | .parts = davinci_nand_partitions, |
|---|
| 92 | 93 | .nr_parts = ARRAY_SIZE(davinci_nand_partitions), |
|---|
| 93 | | - .ecc_mode = NAND_ECC_HW, |
|---|
| 94 | + .engine_type = NAND_ECC_ENGINE_TYPE_ON_HOST, |
|---|
| 94 | 95 | .ecc_bits = 1, |
|---|
| 95 | 96 | .options = 0, |
|---|
| 96 | 97 | }; |
|---|
| .. | .. |
|---|
| 159 | 160 | #define DM646X_EVM_ATA_PWD BIT(1) |
|---|
| 160 | 161 | |
|---|
| 161 | 162 | /* CPLD Register 0 Client: used for I/O Control */ |
|---|
| 162 | | -static int cpld_reg0_probe(struct i2c_client *client, |
|---|
| 163 | | - const struct i2c_device_id *id) |
|---|
| 163 | +static int cpld_reg0_probe(struct i2c_client *client) |
|---|
| 164 | 164 | { |
|---|
| 165 | 165 | if (HAS_ATA) { |
|---|
| 166 | 166 | u8 data; |
|---|
| .. | .. |
|---|
| 196 | 196 | static struct i2c_driver dm6467evm_cpld_driver = { |
|---|
| 197 | 197 | .driver.name = "cpld_reg0", |
|---|
| 198 | 198 | .id_table = cpld_reg_ids, |
|---|
| 199 | | - .probe = cpld_reg0_probe, |
|---|
| 199 | + .probe_new = cpld_reg0_probe, |
|---|
| 200 | 200 | }; |
|---|
| 201 | 201 | |
|---|
| 202 | 202 | /* LEDS */ |
|---|
| .. | .. |
|---|
| 266 | 266 | evm_sw_gpio[i] = gpio++; |
|---|
| 267 | 267 | |
|---|
| 268 | 268 | status = gpio_direction_input(evm_sw_gpio[i]); |
|---|
| 269 | | - if (status) { |
|---|
| 270 | | - gpio_free(evm_sw_gpio[i]); |
|---|
| 271 | | - evm_sw_gpio[i] = -EINVAL; |
|---|
| 269 | + if (status) |
|---|
| 272 | 270 | goto out_free; |
|---|
| 273 | | - } |
|---|
| 274 | 271 | |
|---|
| 275 | 272 | status = gpio_export(evm_sw_gpio[i], 0); |
|---|
| 276 | | - if (status) { |
|---|
| 277 | | - gpio_free(evm_sw_gpio[i]); |
|---|
| 278 | | - evm_sw_gpio[i] = -EINVAL; |
|---|
| 273 | + if (status) |
|---|
| 279 | 274 | goto out_free; |
|---|
| 280 | | - } |
|---|
| 281 | 275 | } |
|---|
| 282 | | - return status; |
|---|
| 276 | + return 0; |
|---|
| 277 | + |
|---|
| 283 | 278 | out_free: |
|---|
| 284 | 279 | for (i = 0; i < 4; ++i) { |
|---|
| 285 | 280 | if (evm_sw_gpio[i] != -EINVAL) { |
|---|
| .. | .. |
|---|
| 342 | 337 | * - ... newer boards may have more |
|---|
| 343 | 338 | */ |
|---|
| 344 | 339 | |
|---|
| 345 | | -static struct at24_platform_data eeprom_info = { |
|---|
| 346 | | - .byte_len = (256*1024) / 8, |
|---|
| 347 | | - .page_size = 64, |
|---|
| 348 | | - .flags = AT24_FLAG_ADDR16, |
|---|
| 349 | | - .setup = davinci_get_mac_addr, |
|---|
| 350 | | - .context = (void *)0x7f00, |
|---|
| 340 | +static struct nvmem_cell_info dm646x_evm_nvmem_cells[] = { |
|---|
| 341 | + { |
|---|
| 342 | + .name = "macaddr", |
|---|
| 343 | + .offset = 0x7f00, |
|---|
| 344 | + .bytes = ETH_ALEN, |
|---|
| 345 | + } |
|---|
| 346 | +}; |
|---|
| 347 | + |
|---|
| 348 | +static struct nvmem_cell_table dm646x_evm_nvmem_cell_table = { |
|---|
| 349 | + .nvmem_name = "1-00500", |
|---|
| 350 | + .cells = dm646x_evm_nvmem_cells, |
|---|
| 351 | + .ncells = ARRAY_SIZE(dm646x_evm_nvmem_cells), |
|---|
| 352 | +}; |
|---|
| 353 | + |
|---|
| 354 | +static struct nvmem_cell_lookup dm646x_evm_nvmem_cell_lookup = { |
|---|
| 355 | + .nvmem_name = "1-00500", |
|---|
| 356 | + .cell_name = "macaddr", |
|---|
| 357 | + .dev_id = "davinci_emac.1", |
|---|
| 358 | + .con_id = "mac-address", |
|---|
| 359 | +}; |
|---|
| 360 | + |
|---|
| 361 | +static const struct property_entry eeprom_properties[] = { |
|---|
| 362 | + PROPERTY_ENTRY_U32("pagesize", 64), |
|---|
| 363 | + { } |
|---|
| 351 | 364 | }; |
|---|
| 352 | 365 | #endif |
|---|
| 353 | 366 | |
|---|
| .. | .. |
|---|
| 383 | 396 | #ifdef CONFIG_I2C |
|---|
| 384 | 397 | static struct i2c_client *cpld_client; |
|---|
| 385 | 398 | |
|---|
| 386 | | -static int cpld_video_probe(struct i2c_client *client, |
|---|
| 387 | | - const struct i2c_device_id *id) |
|---|
| 399 | +static int cpld_video_probe(struct i2c_client *client) |
|---|
| 388 | 400 | { |
|---|
| 389 | 401 | cpld_client = client; |
|---|
| 390 | 402 | return 0; |
|---|
| .. | .. |
|---|
| 405 | 417 | .driver = { |
|---|
| 406 | 418 | .name = "cpld_video", |
|---|
| 407 | 419 | }, |
|---|
| 408 | | - .probe = cpld_video_probe, |
|---|
| 420 | + .probe_new = cpld_video_probe, |
|---|
| 409 | 421 | .remove = cpld_video_remove, |
|---|
| 410 | 422 | .id_table = cpld_video_id, |
|---|
| 411 | 423 | }; |
|---|
| .. | .. |
|---|
| 418 | 430 | static struct i2c_board_info __initdata i2c_info[] = { |
|---|
| 419 | 431 | { |
|---|
| 420 | 432 | I2C_BOARD_INFO("24c256", 0x50), |
|---|
| 421 | | - .platform_data = &eeprom_info, |
|---|
| 433 | + .properties = eeprom_properties, |
|---|
| 422 | 434 | }, |
|---|
| 423 | 435 | { |
|---|
| 424 | 436 | I2C_BOARD_INFO("pcf8574a", 0x38), |
|---|
| .. | .. |
|---|
| 815 | 827 | pr_warn("%s: GPIO init failed: %d\n", __func__, ret); |
|---|
| 816 | 828 | |
|---|
| 817 | 829 | #ifdef CONFIG_I2C |
|---|
| 830 | + nvmem_add_cell_table(&dm646x_evm_nvmem_cell_table); |
|---|
| 831 | + nvmem_add_cell_lookups(&dm646x_evm_nvmem_cell_lookup, 1); |
|---|
| 818 | 832 | evm_init_i2c(); |
|---|
| 819 | 833 | #endif |
|---|
| 820 | 834 | |
|---|
| .. | .. |
|---|
| 839 | 853 | MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM") |
|---|
| 840 | 854 | .atag_offset = 0x100, |
|---|
| 841 | 855 | .map_io = davinci_map_io, |
|---|
| 842 | | - .init_irq = davinci_irq_init, |
|---|
| 856 | + .init_irq = dm646x_init_irq, |
|---|
| 843 | 857 | .init_time = dm646x_evm_init_time, |
|---|
| 844 | 858 | .init_machine = evm_init, |
|---|
| 845 | 859 | .init_late = davinci_init_late, |
|---|
| .. | .. |
|---|
| 849 | 863 | MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") |
|---|
| 850 | 864 | .atag_offset = 0x100, |
|---|
| 851 | 865 | .map_io = davinci_map_io, |
|---|
| 852 | | - .init_irq = davinci_irq_init, |
|---|
| 866 | + .init_irq = dm646x_init_irq, |
|---|
| 853 | 867 | .init_time = dm6467t_evm_init_time, |
|---|
| 854 | 868 | .init_machine = evm_init, |
|---|
| 855 | 869 | .init_late = davinci_init_late, |
|---|