diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-02 13:34:25 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-02 13:34:25 -0500 |
| commit | 5057bfaff82e12f01a2ffd58f55535cbd7c5c3a2 (patch) | |
| tree | 0397253173308317480ed82f0b75af46cd3f6cb1 /drivers | |
| parent | 6c0ad5dfd3d5ad6def89b485ee52834547da239b (diff) | |
| parent | d702d12167a2c05a346f49aac7a311d597762495 (diff) | |
Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (214 commits)
omap2: Initialize Menelaus and MMC for N8X0
AM3517 EVM: correct typo - tca6416 mispelt as tca6516
AM3517 EVM: Enable I2C support
AM35x: Enable OMAP_MUX in defconfig
AM35x: Add missing GPIO mux config for EHCI port
Zoom3: Defconfig update
omap: i2c: Fix muxing for command line enabled bus
OMAP4: clock: Remove clock hacks from timer-gp.c
OMAP4: clock: Add dummy clock nodes for interface clocks
OMAP4: clock: Rename leaf clock nodes to end with a _ick or _fck
OMAP2+ clock: revise omap2_clk_{disable,enable}()
OMAP2/3 clock: combine OMAP2 & 3 boot-time MPU rate change code
OMAP clockdomain: if no autodeps exist, don't try to add or remove them
OMAP hwmod: add hwmod class support
OMAP hwmod: convert header files with static allocations into C files
OMAP hwmod: convert hwmod to use hardware clock names rather than clkdev dev+con
OMAP clock: add omap_clk_get_by_name() for use by OMAP hwmod core code
OMAP3: clock: add capability to change rate of dpll4_m5_ck_3630
OMAP4 clock: drop the ALWAYS_ENABLED clock flag
OMAP clock: drop RATE_FIXED clock flag
...
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/char/hw_random/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/mfd/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 400 | ||||
| -rw-r--r-- | drivers/mtd/maps/Kconfig | 9 | ||||
| -rw-r--r-- | drivers/mtd/maps/Makefile | 1 | ||||
| -rw-r--r-- | drivers/mtd/maps/omap_nor.c | 188 | ||||
| -rw-r--r-- | drivers/mtd/nand/omap2.c | 35 | ||||
| -rw-r--r-- | drivers/net/smc911x.h | 4 | ||||
| -rw-r--r-- | drivers/spi/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/spi/omap2_mcspi.c | 2 | ||||
| -rw-r--r-- | drivers/usb/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-hcd.c | 2 | ||||
| -rw-r--r-- | drivers/usb/musb/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.c | 2 | ||||
| -rw-r--r-- | drivers/usb/musb/musb_core.h | 2 | ||||
| -rw-r--r-- | drivers/w1/masters/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/watchdog/Kconfig | 2 |
17 files changed, 403 insertions, 260 deletions
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index 6ea1014697d1..d31483c54883 100644 --- a/drivers/char/hw_random/Kconfig +++ b/drivers/char/hw_random/Kconfig | |||
| @@ -114,7 +114,7 @@ config HW_RANDOM_IXP4XX | |||
| 114 | 114 | ||
| 115 | config HW_RANDOM_OMAP | 115 | config HW_RANDOM_OMAP |
| 116 | tristate "OMAP Random Number Generator support" | 116 | tristate "OMAP Random Number Generator support" |
| 117 | depends on HW_RANDOM && (ARCH_OMAP16XX || ARCH_OMAP24XX) | 117 | depends on HW_RANDOM && (ARCH_OMAP16XX || ARCH_OMAP2) |
| 118 | default HW_RANDOM | 118 | default HW_RANDOM |
| 119 | ---help--- | 119 | ---help--- |
| 120 | This driver provides kernel-side support for the Random Number | 120 | This driver provides kernel-side support for the Random Number |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 413576a2f313..b670d10d5c92 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
| @@ -94,7 +94,7 @@ config TPS65010 | |||
| 94 | 94 | ||
| 95 | config MENELAUS | 95 | config MENELAUS |
| 96 | bool "Texas Instruments TWL92330/Menelaus PM chip" | 96 | bool "Texas Instruments TWL92330/Menelaus PM chip" |
| 97 | depends on I2C=y && ARCH_OMAP24XX | 97 | depends on I2C=y && ARCH_OMAP2 |
| 98 | help | 98 | help |
| 99 | If you say yes here you get support for the Texas Instruments | 99 | If you say yes here you get support for the Texas Instruments |
| 100 | TWL92330/Menelaus Power Management chip. This include voltage | 100 | TWL92330/Menelaus Power Management chip. This include voltage |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4b2322518909..83f0affadcae 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #include <linux/mmc/core.h> | 30 | #include <linux/mmc/core.h> |
| 31 | #include <linux/io.h> | 31 | #include <linux/io.h> |
| 32 | #include <linux/semaphore.h> | 32 | #include <linux/semaphore.h> |
| 33 | #include <linux/gpio.h> | ||
| 34 | #include <linux/regulator/consumer.h> | ||
| 33 | #include <plat/dma.h> | 35 | #include <plat/dma.h> |
| 34 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
| 35 | #include <plat/board.h> | 37 | #include <plat/board.h> |
| @@ -146,6 +148,15 @@ struct omap_hsmmc_host { | |||
| 146 | struct clk *fclk; | 148 | struct clk *fclk; |
| 147 | struct clk *iclk; | 149 | struct clk *iclk; |
| 148 | struct clk *dbclk; | 150 | struct clk *dbclk; |
| 151 | /* | ||
| 152 | * vcc == configured supply | ||
| 153 | * vcc_aux == optional | ||
| 154 | * - MMC1, supply for DAT4..DAT7 | ||
| 155 | * - MMC2/MMC2, external level shifter voltage supply, for | ||
| 156 | * chip (SDIO, eMMC, etc) or transceiver (MMC2 only) | ||
| 157 | */ | ||
| 158 | struct regulator *vcc; | ||
| 159 | struct regulator *vcc_aux; | ||
| 149 | struct semaphore sem; | 160 | struct semaphore sem; |
| 150 | struct work_struct mmc_carddetect_work; | 161 | struct work_struct mmc_carddetect_work; |
| 151 | void __iomem *base; | 162 | void __iomem *base; |
| @@ -171,10 +182,337 @@ struct omap_hsmmc_host { | |||
| 171 | int vdd; | 182 | int vdd; |
| 172 | int protect_card; | 183 | int protect_card; |
| 173 | int reqs_blocked; | 184 | int reqs_blocked; |
| 185 | int use_reg; | ||
| 174 | 186 | ||
| 175 | struct omap_mmc_platform_data *pdata; | 187 | struct omap_mmc_platform_data *pdata; |
| 176 | }; | 188 | }; |
| 177 | 189 | ||
| 190 | static int omap_hsmmc_card_detect(struct device *dev, int slot) | ||
| 191 | { | ||
| 192 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
| 193 | |||
| 194 | /* NOTE: assumes card detect signal is active-low */ | ||
| 195 | return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); | ||
| 196 | } | ||
| 197 | |||
| 198 | static int omap_hsmmc_get_wp(struct device *dev, int slot) | ||
| 199 | { | ||
| 200 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
| 201 | |||
| 202 | /* NOTE: assumes write protect signal is active-high */ | ||
| 203 | return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); | ||
| 204 | } | ||
| 205 | |||
| 206 | static int omap_hsmmc_get_cover_state(struct device *dev, int slot) | ||
| 207 | { | ||
| 208 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
| 209 | |||
| 210 | /* NOTE: assumes card detect signal is active-low */ | ||
| 211 | return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); | ||
| 212 | } | ||
| 213 | |||
| 214 | #ifdef CONFIG_PM | ||
| 215 | |||
| 216 | static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot) | ||
| 217 | { | ||
| 218 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
| 219 | |||
| 220 | disable_irq(mmc->slots[0].card_detect_irq); | ||
| 221 | return 0; | ||
| 222 | } | ||
| 223 | |||
| 224 | static int omap_hsmmc_resume_cdirq(struct device *dev, int slot) | ||
| 225 | { | ||
| 226 | struct omap_mmc_platform_data *mmc = dev->platform_data; | ||
| 227 | |||
| 228 | enable_irq(mmc->slots[0].card_detect_irq); | ||
| 229 | return 0; | ||
| 230 | } | ||
| 231 | |||
| 232 | #else | ||
| 233 | |||
| 234 | #define omap_hsmmc_suspend_cdirq NULL | ||
| 235 | #define omap_hsmmc_resume_cdirq NULL | ||
| 236 | |||
| 237 | #endif | ||
| 238 | |||
| 239 | #ifdef CONFIG_REGULATOR | ||
| 240 | |||
| 241 | static int omap_hsmmc_1_set_power(struct device *dev, int slot, int power_on, | ||
| 242 | int vdd) | ||
| 243 | { | ||
| 244 | struct omap_hsmmc_host *host = | ||
| 245 | platform_get_drvdata(to_platform_device(dev)); | ||
| 246 | int ret; | ||
| 247 | |||
| 248 | if (mmc_slot(host).before_set_reg) | ||
| 249 | mmc_slot(host).before_set_reg(dev, slot, power_on, vdd); | ||
| 250 | |||
| 251 | if (power_on) | ||
| 252 | ret = mmc_regulator_set_ocr(host->vcc, vdd); | ||
| 253 | else | ||
| 254 | ret = mmc_regulator_set_ocr(host->vcc, 0); | ||
| 255 | |||
| 256 | if (mmc_slot(host).after_set_reg) | ||
| 257 | mmc_slot(host).after_set_reg(dev, slot, power_on, vdd); | ||
| 258 | |||
| 259 | return ret; | ||
| 260 | } | ||
| 261 | |||
| 262 | static int omap_hsmmc_23_set_power(struct device *dev, int slot, int power_on, | ||
| 263 | int vdd) | ||
| 264 | { | ||
| 265 | struct omap_hsmmc_host *host = | ||
| 266 | platform_get_drvdata(to_platform_device(dev)); | ||
| 267 | int ret = 0; | ||
| 268 | |||
| 269 | /* | ||
| 270 | * If we don't see a Vcc regulator, assume it's a fixed | ||
| 271 | * voltage always-on regulator. | ||
| 272 | */ | ||
| 273 | if (!host->vcc) | ||
| 274 | return 0; | ||
| 275 | |||
| 276 | if (mmc_slot(host).before_set_reg) | ||
| 277 | mmc_slot(host).before_set_reg(dev, slot, power_on, vdd); | ||
| 278 | |||
| 279 | /* | ||
| 280 | * Assume Vcc regulator is used only to power the card ... OMAP | ||
| 281 | * VDDS is used to power the pins, optionally with a transceiver to | ||
| 282 | * support cards using voltages other than VDDS (1.8V nominal). When a | ||
| 283 | * transceiver is used, DAT3..7 are muxed as transceiver control pins. | ||
| 284 | * | ||
| 285 | * In some cases this regulator won't support enable/disable; | ||
| 286 | * e.g. it's a fixed rail for a WLAN chip. | ||
| 287 | * | ||
| 288 | * In other cases vcc_aux switches interface power. Example, for | ||
| 289 | * eMMC cards it represents VccQ. Sometimes transceivers or SDIO | ||
| 290 | * chips/cards need an interface voltage rail too. | ||
| 291 | */ | ||
| 292 | if (power_on) { | ||
| 293 | ret = mmc_regulator_set_ocr(host->vcc, vdd); | ||
| 294 | /* Enable interface voltage rail, if needed */ | ||
| 295 | if (ret == 0 && host->vcc_aux) { | ||
| 296 | ret = regulator_enable(host->vcc_aux); | ||
| 297 | if (ret < 0) | ||
| 298 | ret = mmc_regulator_set_ocr(host->vcc, 0); | ||
| 299 | } | ||
| 300 | } else { | ||
| 301 | if (host->vcc_aux) | ||
| 302 | ret = regulator_disable(host->vcc_aux); | ||
| 303 | if (ret == 0) | ||
| 304 | ret = mmc_regulator_set_ocr(host->vcc, 0); | ||
| 305 | } | ||
| 306 | |||
| 307 | if (mmc_slot(host).after_set_reg) | ||
| 308 | mmc_slot(host).after_set_reg(dev, slot, power_on, vdd); | ||
| 309 | |||
| 310 | return ret; | ||
| 311 | } | ||
| 312 | |||
| 313 | static int omap_hsmmc_1_set_sleep(struct device *dev, int slot, int sleep, | ||
| 314 | int vdd, int cardsleep) | ||
| 315 | { | ||
| 316 | struct omap_hsmmc_host *host = | ||
| 317 | platform_get_drvdata(to_platform_device(dev)); | ||
| 318 | int mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
| 319 | |||
| 320 | return regulator_set_mode(host->vcc, mode); | ||
| 321 | } | ||
| 322 | |||
| 323 | static int omap_hsmmc_23_set_sleep(struct device *dev, int slot, int sleep, | ||
| 324 | int vdd, int cardsleep) | ||
| 325 | { | ||
| 326 | struct omap_hsmmc_host *host = | ||
| 327 | platform_get_drvdata(to_platform_device(dev)); | ||
| 328 | int err, mode; | ||
| 329 | |||
| 330 | /* | ||
| 331 | * If we don't see a Vcc regulator, assume it's a fixed | ||
| 332 | * voltage always-on regulator. | ||
| 333 | */ | ||
| 334 | if (!host->vcc) | ||
| 335 | return 0; | ||
| 336 | |||
| 337 | mode = sleep ? REGULATOR_MODE_STANDBY : REGULATOR_MODE_NORMAL; | ||
| 338 | |||
| 339 | if (!host->vcc_aux) | ||
| 340 | return regulator_set_mode(host->vcc, mode); | ||
| 341 | |||
| 342 | if (cardsleep) { | ||
| 343 | /* VCC can be turned off if card is asleep */ | ||
| 344 | if (sleep) | ||
| 345 | err = mmc_regulator_set_ocr(host->vcc, 0); | ||
| 346 | else | ||
| 347 | err = mmc_regulator_set_ocr(host->vcc, vdd); | ||
| 348 | } else | ||
| 349 | err = regulator_set_mode(host->vcc, mode); | ||
| 350 | if (err) | ||
| 351 | return err; | ||
| 352 | |||
| 353 | if (!mmc_slot(host).vcc_aux_disable_is_sleep) | ||
| 354 | return regulator_set_mode(host->vcc_aux, mode); | ||
| 355 | |||
| 356 | if (sleep) | ||
| 357 | return regulator_disable(host->vcc_aux); | ||
| 358 | else | ||
| 359 | return regulator_enable(host->vcc_aux); | ||
| 360 | } | ||
| 361 | |||
| 362 | static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | ||
| 363 | { | ||
| 364 | struct regulator *reg; | ||
| 365 | int ret = 0; | ||
| 366 | |||
| 367 | switch (host->id) { | ||
| 368 | case OMAP_MMC1_DEVID: | ||
| 369 | /* On-chip level shifting via PBIAS0/PBIAS1 */ | ||
| 370 | mmc_slot(host).set_power = omap_hsmmc_1_set_power; | ||
| 371 | mmc_slot(host).set_sleep = omap_hsmmc_1_set_sleep; | ||
| 372 | break; | ||
| 373 | case OMAP_MMC2_DEVID: | ||
| 374 | case OMAP_MMC3_DEVID: | ||
| 375 | /* Off-chip level shifting, or none */ | ||
| 376 | mmc_slot(host).set_power = omap_hsmmc_23_set_power; | ||
| 377 | mmc_slot(host).set_sleep = omap_hsmmc_23_set_sleep; | ||
| 378 | break; | ||
| 379 | default: | ||
| 380 | pr_err("MMC%d configuration not supported!\n", host->id); | ||
| 381 | return -EINVAL; | ||
| 382 | } | ||
| 383 | |||
| 384 | reg = regulator_get(host->dev, "vmmc"); | ||
| 385 | if (IS_ERR(reg)) { | ||
| 386 | dev_dbg(host->dev, "vmmc regulator missing\n"); | ||
| 387 | /* | ||
| 388 | * HACK: until fixed.c regulator is usable, | ||
| 389 | * we don't require a main regulator | ||
| 390 | * for MMC2 or MMC3 | ||
| 391 | */ | ||
| 392 | if (host->id == OMAP_MMC1_DEVID) { | ||
| 393 | ret = PTR_ERR(reg); | ||
| 394 | goto err; | ||
| 395 | } | ||
| 396 | } else { | ||
| 397 | host->vcc = reg; | ||
| 398 | mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); | ||
| 399 | |||
| 400 | /* Allow an aux regulator */ | ||
| 401 | reg = regulator_get(host->dev, "vmmc_aux"); | ||
| 402 | host->vcc_aux = IS_ERR(reg) ? NULL : reg; | ||
| 403 | |||
| 404 | /* | ||
| 405 | * UGLY HACK: workaround regulator framework bugs. | ||
| 406 | * When the bootloader leaves a supply active, it's | ||
| 407 | * initialized with zero usecount ... and we can't | ||
| 408 | * disable it without first enabling it. Until the | ||
| 409 | * framework is fixed, we need a workaround like this | ||
| 410 | * (which is safe for MMC, but not in general). | ||
| 411 | */ | ||
| 412 | if (regulator_is_enabled(host->vcc) > 0) { | ||
| 413 | regulator_enable(host->vcc); | ||
| 414 | regulator_disable(host->vcc); | ||
| 415 | } | ||
| 416 | if (host->vcc_aux) { | ||
| 417 | if (regulator_is_enabled(reg) > 0) { | ||
| 418 | regulator_enable(reg); | ||
| 419 | regulator_disable(reg); | ||
| 420 | } | ||
| 421 | } | ||
| 422 | } | ||
| 423 | |||
| 424 | return 0; | ||
| 425 | |||
| 426 | err: | ||
| 427 | mmc_slot(host).set_power = NULL; | ||
| 428 | mmc_slot(host).set_sleep = NULL; | ||
| 429 | return ret; | ||
| 430 | } | ||
| 431 | |||
| 432 | static void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) | ||
| 433 | { | ||
| 434 | regulator_put(host->vcc); | ||
| 435 | regulator_put(host->vcc_aux); | ||
| 436 | mmc_slot(host).set_power = NULL; | ||
| 437 | mmc_slot(host).set_sleep = NULL; | ||
| 438 | } | ||
| 439 | |||
| 440 | static inline int omap_hsmmc_have_reg(void) | ||
| 441 | { | ||
| 442 | return 1; | ||
| 443 | } | ||
| 444 | |||
| 445 | #else | ||
| 446 | |||
| 447 | static inline int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | ||
| 448 | { | ||
| 449 | return -EINVAL; | ||
| 450 | } | ||
| 451 | |||
| 452 | static inline void omap_hsmmc_reg_put(struct omap_hsmmc_host *host) | ||
| 453 | { | ||
| 454 | } | ||
| 455 | |||
| 456 | static inline int omap_hsmmc_have_reg(void) | ||
| 457 | { | ||
| 458 | return 0; | ||
| 459 | } | ||
| 460 | |||
| 461 | #endif | ||
| 462 | |||
| 463 | static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) | ||
| 464 | { | ||
| 465 | int ret; | ||
| 466 | |||
| 467 | if (gpio_is_valid(pdata->slots[0].switch_pin)) { | ||
| 468 | pdata->suspend = omap_hsmmc_suspend_cdirq; | ||
| 469 | pdata->resume = omap_hsmmc_resume_cdirq; | ||
| 470 | if (pdata->slots[0].cover) | ||
| 471 | pdata->slots[0].get_cover_state = | ||
| 472 | omap_hsmmc_get_cover_state; | ||
| 473 | else | ||
| 474 | pdata->slots[0].card_detect = omap_hsmmc_card_detect; | ||
| 475 | pdata->slots[0].card_detect_irq = | ||
| 476 | gpio_to_irq(pdata->slots[0].switch_pin); | ||
| 477 | ret = gpio_request(pdata->slots[0].switch_pin, "mmc_cd"); | ||
| 478 | if (ret) | ||
| 479 | return ret; | ||
| 480 | ret = gpio_direction_input(pdata->slots[0].switch_pin); | ||
| 481 | if (ret) | ||
| 482 | goto err_free_sp; | ||
| 483 | } else | ||
| 484 | pdata->slots[0].switch_pin = -EINVAL; | ||
| 485 | |||
| 486 | if (gpio_is_valid(pdata->slots[0].gpio_wp)) { | ||
| 487 | pdata->slots[0].get_ro = omap_hsmmc_get_wp; | ||
| 488 | ret = gpio_request(pdata->slots[0].gpio_wp, "mmc_wp"); | ||
| 489 | if (ret) | ||
| 490 | goto err_free_cd; | ||
| 491 | ret = gpio_direction_input(pdata->slots[0].gpio_wp); | ||
| 492 | if (ret) | ||
| 493 | goto err_free_wp; | ||
| 494 | } else | ||
| 495 | pdata->slots[0].gpio_wp = -EINVAL; | ||
| 496 | |||
| 497 | return 0; | ||
| 498 | |||
| 499 | err_free_wp: | ||
| 500 | gpio_free(pdata->slots[0].gpio_wp); | ||
| 501 | err_free_cd: | ||
| 502 | if (gpio_is_valid(pdata->slots[0].switch_pin)) | ||
| 503 | err_free_sp: | ||
| 504 | gpio_free(pdata->slots[0].switch_pin); | ||
| 505 | return ret; | ||
| 506 | } | ||
| 507 | |||
| 508 | static void omap_hsmmc_gpio_free(struct omap_mmc_platform_data *pdata) | ||
| 509 | { | ||
| 510 | if (gpio_is_valid(pdata->slots[0].gpio_wp)) | ||
| 511 | gpio_free(pdata->slots[0].gpio_wp); | ||
| 512 | if (gpio_is_valid(pdata->slots[0].switch_pin)) | ||
| 513 | gpio_free(pdata->slots[0].switch_pin); | ||
| 514 | } | ||
| 515 | |||
| 178 | /* | 516 | /* |
| 179 | * Stop clock to the card | 517 | * Stop clock to the card |
| 180 | */ | 518 | */ |
| @@ -835,7 +1173,7 @@ static void omap_hsmmc_detect(struct work_struct *work) | |||
| 835 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); | 1173 | sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); |
| 836 | 1174 | ||
| 837 | if (slot->card_detect) | 1175 | if (slot->card_detect) |
| 838 | carddetect = slot->card_detect(slot->card_detect_irq); | 1176 | carddetect = slot->card_detect(host->dev, host->slot_id); |
| 839 | else { | 1177 | else { |
| 840 | omap_hsmmc_protect_card(host); | 1178 | omap_hsmmc_protect_card(host); |
| 841 | carddetect = -ENOSYS; | 1179 | carddetect = -ENOSYS; |
| @@ -1242,7 +1580,7 @@ static int omap_hsmmc_get_cd(struct mmc_host *mmc) | |||
| 1242 | 1580 | ||
| 1243 | if (!mmc_slot(host).card_detect) | 1581 | if (!mmc_slot(host).card_detect) |
| 1244 | return -ENOSYS; | 1582 | return -ENOSYS; |
| 1245 | return mmc_slot(host).card_detect(mmc_slot(host).card_detect_irq); | 1583 | return mmc_slot(host).card_detect(host->dev, host->slot_id); |
| 1246 | } | 1584 | } |
| 1247 | 1585 | ||
| 1248 | static int omap_hsmmc_get_ro(struct mmc_host *mmc) | 1586 | static int omap_hsmmc_get_ro(struct mmc_host *mmc) |
| @@ -1311,7 +1649,7 @@ static int omap_hsmmc_enabled_to_disabled(struct omap_hsmmc_host *host) | |||
| 1311 | if (host->power_mode == MMC_POWER_OFF) | 1649 | if (host->power_mode == MMC_POWER_OFF) |
| 1312 | return 0; | 1650 | return 0; |
| 1313 | 1651 | ||
| 1314 | return msecs_to_jiffies(OMAP_MMC_SLEEP_TIMEOUT); | 1652 | return OMAP_MMC_SLEEP_TIMEOUT; |
| 1315 | } | 1653 | } |
| 1316 | 1654 | ||
| 1317 | /* Handler for [DISABLED -> REGSLEEP / CARDSLEEP] transition */ | 1655 | /* Handler for [DISABLED -> REGSLEEP / CARDSLEEP] transition */ |
| @@ -1347,11 +1685,14 @@ static int omap_hsmmc_disabled_to_sleep(struct omap_hsmmc_host *host) | |||
| 1347 | dev_dbg(mmc_dev(host->mmc), "DISABLED -> %s\n", | 1685 | dev_dbg(mmc_dev(host->mmc), "DISABLED -> %s\n", |
| 1348 | host->dpm_state == CARDSLEEP ? "CARDSLEEP" : "REGSLEEP"); | 1686 | host->dpm_state == CARDSLEEP ? "CARDSLEEP" : "REGSLEEP"); |
| 1349 | 1687 | ||
| 1688 | if (mmc_slot(host).no_off) | ||
| 1689 | return 0; | ||
| 1690 | |||
| 1350 | if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) || | 1691 | if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) || |
| 1351 | mmc_slot(host).card_detect || | 1692 | mmc_slot(host).card_detect || |
| 1352 | (mmc_slot(host).get_cover_state && | 1693 | (mmc_slot(host).get_cover_state && |
| 1353 | mmc_slot(host).get_cover_state(host->dev, host->slot_id))) | 1694 | mmc_slot(host).get_cover_state(host->dev, host->slot_id))) |
| 1354 | return msecs_to_jiffies(OMAP_MMC_OFF_TIMEOUT); | 1695 | return OMAP_MMC_OFF_TIMEOUT; |
| 1355 | 1696 | ||
| 1356 | return 0; | 1697 | return 0; |
| 1357 | } | 1698 | } |
| @@ -1362,6 +1703,9 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host) | |||
| 1362 | if (!mmc_try_claim_host(host->mmc)) | 1703 | if (!mmc_try_claim_host(host->mmc)) |
| 1363 | return 0; | 1704 | return 0; |
| 1364 | 1705 | ||
| 1706 | if (mmc_slot(host).no_off) | ||
| 1707 | return 0; | ||
| 1708 | |||
| 1365 | if (!((host->mmc->caps & MMC_CAP_NONREMOVABLE) || | 1709 | if (!((host->mmc->caps & MMC_CAP_NONREMOVABLE) || |
| 1366 | mmc_slot(host).card_detect || | 1710 | mmc_slot(host).card_detect || |
| 1367 | (mmc_slot(host).get_cover_state && | 1711 | (mmc_slot(host).get_cover_state && |
| @@ -1616,7 +1960,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1616 | struct mmc_host *mmc; | 1960 | struct mmc_host *mmc; |
| 1617 | struct omap_hsmmc_host *host = NULL; | 1961 | struct omap_hsmmc_host *host = NULL; |
| 1618 | struct resource *res; | 1962 | struct resource *res; |
| 1619 | int ret = 0, irq; | 1963 | int ret, irq; |
| 1620 | 1964 | ||
| 1621 | if (pdata == NULL) { | 1965 | if (pdata == NULL) { |
| 1622 | dev_err(&pdev->dev, "Platform Data is missing\n"); | 1966 | dev_err(&pdev->dev, "Platform Data is missing\n"); |
| @@ -1638,10 +1982,14 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1638 | if (res == NULL) | 1982 | if (res == NULL) |
| 1639 | return -EBUSY; | 1983 | return -EBUSY; |
| 1640 | 1984 | ||
| 1985 | ret = omap_hsmmc_gpio_init(pdata); | ||
| 1986 | if (ret) | ||
| 1987 | goto err; | ||
| 1988 | |||
| 1641 | mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); | 1989 | mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); |
| 1642 | if (!mmc) { | 1990 | if (!mmc) { |
| 1643 | ret = -ENOMEM; | 1991 | ret = -ENOMEM; |
| 1644 | goto err; | 1992 | goto err_alloc; |
| 1645 | } | 1993 | } |
| 1646 | 1994 | ||
| 1647 | host = mmc_priv(mmc); | 1995 | host = mmc_priv(mmc); |
| @@ -1656,7 +2004,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1656 | host->slot_id = 0; | 2004 | host->slot_id = 0; |
| 1657 | host->mapbase = res->start; | 2005 | host->mapbase = res->start; |
| 1658 | host->base = ioremap(host->mapbase, SZ_4K); | 2006 | host->base = ioremap(host->mapbase, SZ_4K); |
| 1659 | host->power_mode = -1; | 2007 | host->power_mode = MMC_POWER_OFF; |
| 1660 | 2008 | ||
| 1661 | platform_set_drvdata(pdev, host); | 2009 | platform_set_drvdata(pdev, host); |
| 1662 | INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect); | 2010 | INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect); |
| @@ -1666,6 +2014,13 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1666 | else | 2014 | else |
| 1667 | mmc->ops = &omap_hsmmc_ops; | 2015 | mmc->ops = &omap_hsmmc_ops; |
| 1668 | 2016 | ||
| 2017 | /* | ||
| 2018 | * If regulator_disable can only put vcc_aux to sleep then there is | ||
| 2019 | * no off state. | ||
| 2020 | */ | ||
| 2021 | if (mmc_slot(host).vcc_aux_disable_is_sleep) | ||
| 2022 | mmc_slot(host).no_off = 1; | ||
| 2023 | |||
| 1669 | mmc->f_min = 400000; | 2024 | mmc->f_min = 400000; |
| 1670 | mmc->f_max = 52000000; | 2025 | mmc->f_max = 52000000; |
| 1671 | 2026 | ||
| @@ -1781,7 +2136,6 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1781 | goto err_irq; | 2136 | goto err_irq; |
| 1782 | } | 2137 | } |
| 1783 | 2138 | ||
| 1784 | /* initialize power supplies, gpios, etc */ | ||
| 1785 | if (pdata->init != NULL) { | 2139 | if (pdata->init != NULL) { |
| 1786 | if (pdata->init(&pdev->dev) != 0) { | 2140 | if (pdata->init(&pdev->dev) != 0) { |
| 1787 | dev_dbg(mmc_dev(host->mmc), | 2141 | dev_dbg(mmc_dev(host->mmc), |
| @@ -1789,6 +2143,14 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1789 | goto err_irq_cd_init; | 2143 | goto err_irq_cd_init; |
| 1790 | } | 2144 | } |
| 1791 | } | 2145 | } |
| 2146 | |||
| 2147 | if (omap_hsmmc_have_reg() && !mmc_slot(host).set_power) { | ||
| 2148 | ret = omap_hsmmc_reg_get(host); | ||
| 2149 | if (ret) | ||
| 2150 | goto err_reg; | ||
| 2151 | host->use_reg = 1; | ||
| 2152 | } | ||
| 2153 | |||
| 1792 | mmc->ocr_avail = mmc_slot(host).ocr_mask; | 2154 | mmc->ocr_avail = mmc_slot(host).ocr_mask; |
| 1793 | 2155 | ||
| 1794 | /* Request IRQ for card detect */ | 2156 | /* Request IRQ for card detect */ |
| @@ -1823,19 +2185,22 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
| 1823 | ret = device_create_file(&mmc->class_dev, | 2185 | ret = device_create_file(&mmc->class_dev, |
| 1824 | &dev_attr_cover_switch); | 2186 | &dev_attr_cover_switch); |
| 1825 | if (ret < 0) | 2187 | if (ret < 0) |
| 1826 | goto err_cover_switch; | 2188 | goto err_slot_name; |
| 1827 | } | 2189 | } |
| 1828 | 2190 | ||
| 1829 | omap_hsmmc_debugfs(mmc); | 2191 | omap_hsmmc_debugfs(mmc); |
| 1830 | 2192 | ||
| 1831 | return 0; | 2193 | return 0; |
| 1832 | 2194 | ||
| 1833 | err_cover_switch: | ||
| 1834 | device_remove_file(&mmc->class_dev, &dev_attr_cover_switch); | ||
| 1835 | err_slot_name: | 2195 | err_slot_name: |
| 1836 | mmc_remove_host(mmc); | 2196 | mmc_remove_host(mmc); |
| 1837 | err_irq_cd: | ||
| 1838 | free_irq(mmc_slot(host).card_detect_irq, host); | 2197 | free_irq(mmc_slot(host).card_detect_irq, host); |
| 2198 | err_irq_cd: | ||
| 2199 | if (host->use_reg) | ||
| 2200 | omap_hsmmc_reg_put(host); | ||
| 2201 | err_reg: | ||
| 2202 | if (host->pdata->cleanup) | ||
| 2203 | host->pdata->cleanup(&pdev->dev); | ||
| 1839 | err_irq_cd_init: | 2204 | err_irq_cd_init: |
| 1840 | free_irq(host->irq, host); | 2205 | free_irq(host->irq, host); |
| 1841 | err_irq: | 2206 | err_irq: |
| @@ -1847,14 +2212,14 @@ err_irq: | |||
| 1847 | clk_disable(host->dbclk); | 2212 | clk_disable(host->dbclk); |
| 1848 | clk_put(host->dbclk); | 2213 | clk_put(host->dbclk); |
| 1849 | } | 2214 | } |
| 1850 | |||
| 1851 | err1: | 2215 | err1: |
| 1852 | iounmap(host->base); | 2216 | iounmap(host->base); |
| 2217 | platform_set_drvdata(pdev, NULL); | ||
| 2218 | mmc_free_host(mmc); | ||
| 2219 | err_alloc: | ||
| 2220 | omap_hsmmc_gpio_free(pdata); | ||
| 1853 | err: | 2221 | err: |
| 1854 | dev_dbg(mmc_dev(host->mmc), "Probe Failed\n"); | ||
| 1855 | release_mem_region(res->start, res->end - res->start + 1); | 2222 | release_mem_region(res->start, res->end - res->start + 1); |
| 1856 | if (host) | ||
| 1857 | mmc_free_host(mmc); | ||
| 1858 | return ret; | 2223 | return ret; |
| 1859 | } | 2224 | } |
| 1860 | 2225 | ||
| @@ -1866,6 +2231,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev) | |||
| 1866 | if (host) { | 2231 | if (host) { |
| 1867 | mmc_host_enable(host->mmc); | 2232 | mmc_host_enable(host->mmc); |
| 1868 | mmc_remove_host(host->mmc); | 2233 | mmc_remove_host(host->mmc); |
| 2234 | if (host->use_reg) | ||
| 2235 | omap_hsmmc_reg_put(host); | ||
| 1869 | if (host->pdata->cleanup) | 2236 | if (host->pdata->cleanup) |
| 1870 | host->pdata->cleanup(&pdev->dev); | 2237 | host->pdata->cleanup(&pdev->dev); |
| 1871 | free_irq(host->irq, host); | 2238 | free_irq(host->irq, host); |
| @@ -1884,6 +2251,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev) | |||
| 1884 | 2251 | ||
| 1885 | mmc_free_host(host->mmc); | 2252 | mmc_free_host(host->mmc); |
| 1886 | iounmap(host->base); | 2253 | iounmap(host->base); |
| 2254 | omap_hsmmc_gpio_free(pdev->dev.platform_data); | ||
| 1887 | } | 2255 | } |
| 1888 | 2256 | ||
| 1889 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2257 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 2bb03a8b9ef1..aa2807d0ce72 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
| @@ -422,15 +422,6 @@ config MTD_H720X | |||
| 422 | This enables access to the flash chips on the Hynix evaluation boards. | 422 | This enables access to the flash chips on the Hynix evaluation boards. |
| 423 | If you have such a board, say 'Y'. | 423 | If you have such a board, say 'Y'. |
| 424 | 424 | ||
| 425 | config MTD_OMAP_NOR | ||
| 426 | tristate "TI OMAP board mappings" | ||
| 427 | depends on MTD_CFI && ARCH_OMAP | ||
| 428 | help | ||
| 429 | This enables access to the NOR flash chips on TI OMAP-based | ||
| 430 | boards defining flash platform devices and flash platform data. | ||
| 431 | These boards include the Innovator, H2, H3, OSK, Perseus2, and | ||
| 432 | more. If you have such a board, say 'Y'. | ||
| 433 | |||
| 434 | # This needs CFI or JEDEC, depending on the cards found. | 425 | # This needs CFI or JEDEC, depending on the cards found. |
| 435 | config MTD_PCI | 426 | config MTD_PCI |
| 436 | tristate "PCI MTD driver" | 427 | tristate "PCI MTD driver" |
diff --git a/drivers/mtd/maps/Makefile b/drivers/mtd/maps/Makefile index a44919f3f3d2..bb035cd54c72 100644 --- a/drivers/mtd/maps/Makefile +++ b/drivers/mtd/maps/Makefile | |||
| @@ -54,7 +54,6 @@ obj-$(CONFIG_MTD_IXP2000) += ixp2000.o | |||
| 54 | obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o | 54 | obj-$(CONFIG_MTD_WRSBC8260) += wr_sbc82xx_flash.o |
| 55 | obj-$(CONFIG_MTD_DMV182) += dmv182.o | 55 | obj-$(CONFIG_MTD_DMV182) += dmv182.o |
| 56 | obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o | 56 | obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o |
| 57 | obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o | ||
| 58 | obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o | 57 | obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o |
| 59 | obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o | 58 | obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o |
| 60 | obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o | 59 | obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o |
diff --git a/drivers/mtd/maps/omap_nor.c b/drivers/mtd/maps/omap_nor.c index ead0b2fab670..e69de29bb2d1 100644 --- a/drivers/mtd/maps/omap_nor.c +++ b/drivers/mtd/maps/omap_nor.c | |||
| @@ -1,188 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Flash memory support for various TI OMAP boards | ||
| 3 | * | ||
| 4 | * Copyright (C) 2001-2002 MontaVista Software Inc. | ||
| 5 | * Copyright (C) 2003-2004 Texas Instruments | ||
| 6 | * Copyright (C) 2004 Nokia Corporation | ||
| 7 | * | ||
| 8 | * Assembled using driver code copyright the companies above | ||
| 9 | * and written by David Brownell, Jian Zhang <jzhang@ti.com>, | ||
| 10 | * Tony Lindgren <tony@atomide.com> and others. | ||
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify it | ||
| 13 | * under the terms of the GNU General Public License as published by the | ||
| 14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 15 | * option) any later version. | ||
| 16 | * | ||
| 17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
| 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
| 20 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
| 23 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
| 24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 27 | * | ||
| 28 | * You should have received a copy of the GNU General Public License along | ||
| 29 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 31 | */ | ||
| 32 | |||
| 33 | #include <linux/platform_device.h> | ||
| 34 | #include <linux/module.h> | ||
| 35 | #include <linux/types.h> | ||
| 36 | #include <linux/kernel.h> | ||
| 37 | #include <linux/init.h> | ||
| 38 | #include <linux/ioport.h> | ||
| 39 | #include <linux/slab.h> | ||
| 40 | |||
| 41 | #include <linux/mtd/mtd.h> | ||
| 42 | #include <linux/mtd/map.h> | ||
| 43 | #include <linux/mtd/partitions.h> | ||
| 44 | |||
| 45 | #include <asm/io.h> | ||
| 46 | #include <mach/hardware.h> | ||
| 47 | #include <asm/mach/flash.h> | ||
| 48 | #include <plat/tc.h> | ||
| 49 | |||
| 50 | #ifdef CONFIG_MTD_PARTITIONS | ||
| 51 | static const char *part_probes[] = { /* "RedBoot", */ "cmdlinepart", NULL }; | ||
| 52 | #endif | ||
| 53 | |||
| 54 | struct omapflash_info { | ||
| 55 | struct mtd_partition *parts; | ||
| 56 | struct mtd_info *mtd; | ||
| 57 | struct map_info map; | ||
| 58 | }; | ||
| 59 | |||
| 60 | static void omap_set_vpp(struct map_info *map, int enable) | ||
| 61 | { | ||
| 62 | static int count; | ||
| 63 | u32 l; | ||
| 64 | |||
| 65 | if (cpu_class_is_omap1()) { | ||
| 66 | if (enable) { | ||
| 67 | if (count++ == 0) { | ||
| 68 | l = omap_readl(EMIFS_CONFIG); | ||
| 69 | l |= OMAP_EMIFS_CONFIG_WP; | ||
| 70 | omap_writel(l, EMIFS_CONFIG); | ||
| 71 | } | ||
| 72 | } else { | ||
| 73 | if (count && (--count == 0)) { | ||
| 74 | l = omap_readl(EMIFS_CONFIG); | ||
| 75 | l &= ~OMAP_EMIFS_CONFIG_WP; | ||
| 76 | omap_writel(l, EMIFS_CONFIG); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | } | ||
| 80 | } | ||
| 81 | |||
| 82 | static int __init omapflash_probe(struct platform_device *pdev) | ||
| 83 | { | ||
| 84 | int err; | ||
| 85 | struct omapflash_info *info; | ||
| 86 | struct flash_platform_data *pdata = pdev->dev.platform_data; | ||
| 87 | struct resource *res = pdev->resource; | ||
| 88 | unsigned long size = res->end - res->start + 1; | ||
| 89 | |||
| 90 | info = kzalloc(sizeof(struct omapflash_info), GFP_KERNEL); | ||
| 91 | if (!info) | ||
| 92 | return -ENOMEM; | ||
| 93 | |||
| 94 | if (!request_mem_region(res->start, size, "flash")) { | ||
| 95 | err = -EBUSY; | ||
| 96 | goto out_free_info; | ||
| 97 | } | ||
| 98 | |||
| 99 | info->map.virt = ioremap(res->start, size); | ||
| 100 | if (!info->map.virt) { | ||
| 101 | err = -ENOMEM; | ||
| 102 | goto out_release_mem_region; | ||
| 103 | } | ||
| 104 | info->map.name = dev_name(&pdev->dev); | ||
| 105 | info->map.phys = res->start; | ||
| 106 | info->map.size = size; | ||
| 107 | info->map.bankwidth = pdata->width; | ||
| 108 | info->map.set_vpp = omap_set_vpp; | ||
| 109 | |||
| 110 | simple_map_init(&info->map); | ||
| 111 | info->mtd = do_map_probe(pdata->map_name, &info->map); | ||
| 112 | if (!info->mtd) { | ||
| 113 | err = -EIO; | ||
| 114 | goto out_iounmap; | ||
| 115 | } | ||
| 116 | info->mtd->owner = THIS_MODULE; | ||
| 117 | |||
| 118 | info->mtd->dev.parent = &pdev->dev; | ||
| 119 | |||
| 120 | #ifdef CONFIG_MTD_PARTITIONS | ||
| 121 | err = parse_mtd_partitions(info->mtd, part_probes, &info->parts, 0); | ||
| 122 | if (err > 0) | ||
| 123 | add_mtd_partitions(info->mtd, info->parts, err); | ||
| 124 | else if (err <= 0 && pdata->parts) | ||
| 125 | add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts); | ||
| 126 | else | ||
| 127 | #endif | ||
| 128 | add_mtd_device(info->mtd); | ||
| 129 | |||
| 130 | platform_set_drvdata(pdev, info); | ||
| 131 | |||
| 132 | return 0; | ||
| 133 | |||
| 134 | out_iounmap: | ||
| 135 | iounmap(info->map.virt); | ||
| 136 | out_release_mem_region: | ||
| 137 | release_mem_region(res->start, size); | ||
| 138 | out_free_info: | ||
| 139 | kfree(info); | ||
| 140 | |||
| 141 | return err; | ||
| 142 | } | ||
| 143 | |||
| 144 | static int __exit omapflash_remove(struct platform_device *pdev) | ||
| 145 | { | ||
| 146 | struct omapflash_info *info = platform_get_drvdata(pdev); | ||
| 147 | |||
| 148 | platform_set_drvdata(pdev, NULL); | ||
| 149 | |||
| 150 | if (info) { | ||
| 151 | if (info->parts) { | ||
| 152 | del_mtd_partitions(info->mtd); | ||
| 153 | kfree(info->parts); | ||
| 154 | } else | ||
| 155 | del_mtd_device(info->mtd); | ||
| 156 | map_destroy(info->mtd); | ||
| 157 | release_mem_region(info->map.phys, info->map.size); | ||
| 158 | iounmap((void __iomem *) info->map.virt); | ||
| 159 | kfree(info); | ||
| 160 | } | ||
| 161 | |||
| 162 | return 0; | ||
| 163 | } | ||
| 164 | |||
| 165 | static struct platform_driver omapflash_driver = { | ||
| 166 | .remove = __exit_p(omapflash_remove), | ||
| 167 | .driver = { | ||
| 168 | .name = "omapflash", | ||
| 169 | .owner = THIS_MODULE, | ||
| 170 | }, | ||
| 171 | }; | ||
| 172 | |||
| 173 | static int __init omapflash_init(void) | ||
| 174 | { | ||
| 175 | return platform_driver_probe(&omapflash_driver, omapflash_probe); | ||
| 176 | } | ||
| 177 | |||
| 178 | static void __exit omapflash_exit(void) | ||
| 179 | { | ||
| 180 | platform_driver_unregister(&omapflash_driver); | ||
| 181 | } | ||
| 182 | |||
| 183 | module_init(omapflash_init); | ||
| 184 | module_exit(omapflash_exit); | ||
| 185 | |||
| 186 | MODULE_LICENSE("GPL"); | ||
| 187 | MODULE_DESCRIPTION("MTD NOR map driver for TI OMAP boards"); | ||
| 188 | MODULE_ALIAS("platform:omapflash"); | ||
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 1bb799f0125c..26aec0080184 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
| @@ -30,12 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | #define DRIVER_NAME "omap2-nand" | 31 | #define DRIVER_NAME "omap2-nand" |
| 32 | 32 | ||
| 33 | /* size (4 KiB) for IO mapping */ | ||
| 34 | #define NAND_IO_SIZE SZ_4K | ||
| 35 | |||
| 36 | #define NAND_WP_OFF 0 | 33 | #define NAND_WP_OFF 0 |
| 37 | #define NAND_WP_BIT 0x00000010 | 34 | #define NAND_WP_BIT 0x00000010 |
| 38 | #define WR_RD_PIN_MONITORING 0x00600000 | ||
| 39 | 35 | ||
| 40 | #define GPMC_BUF_FULL 0x00000001 | 36 | #define GPMC_BUF_FULL 0x00000001 |
| 41 | #define GPMC_BUF_EMPTY 0x00000000 | 37 | #define GPMC_BUF_EMPTY 0x00000000 |
| @@ -882,8 +878,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 882 | struct omap_nand_info *info; | 878 | struct omap_nand_info *info; |
| 883 | struct omap_nand_platform_data *pdata; | 879 | struct omap_nand_platform_data *pdata; |
| 884 | int err; | 880 | int err; |
| 885 | unsigned long val; | ||
| 886 | |||
| 887 | 881 | ||
| 888 | pdata = pdev->dev.platform_data; | 882 | pdata = pdev->dev.platform_data; |
| 889 | if (pdata == NULL) { | 883 | if (pdata == NULL) { |
| @@ -905,28 +899,14 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 905 | info->gpmc_cs = pdata->cs; | 899 | info->gpmc_cs = pdata->cs; |
| 906 | info->gpmc_baseaddr = pdata->gpmc_baseaddr; | 900 | info->gpmc_baseaddr = pdata->gpmc_baseaddr; |
| 907 | info->gpmc_cs_baseaddr = pdata->gpmc_cs_baseaddr; | 901 | info->gpmc_cs_baseaddr = pdata->gpmc_cs_baseaddr; |
| 902 | info->phys_base = pdata->phys_base; | ||
| 908 | 903 | ||
| 909 | info->mtd.priv = &info->nand; | 904 | info->mtd.priv = &info->nand; |
| 910 | info->mtd.name = dev_name(&pdev->dev); | 905 | info->mtd.name = dev_name(&pdev->dev); |
| 911 | info->mtd.owner = THIS_MODULE; | 906 | info->mtd.owner = THIS_MODULE; |
| 912 | 907 | ||
| 913 | err = gpmc_cs_request(info->gpmc_cs, NAND_IO_SIZE, &info->phys_base); | 908 | info->nand.options |= pdata->devsize ? NAND_BUSWIDTH_16 : 0; |
| 914 | if (err < 0) { | 909 | info->nand.options |= NAND_SKIP_BBTSCAN; |
| 915 | dev_err(&pdev->dev, "Cannot request GPMC CS\n"); | ||
| 916 | goto out_free_info; | ||
| 917 | } | ||
| 918 | |||
| 919 | /* Enable RD PIN Monitoring Reg */ | ||
| 920 | if (pdata->dev_ready) { | ||
| 921 | val = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG1); | ||
| 922 | val |= WR_RD_PIN_MONITORING; | ||
| 923 | gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG1, val); | ||
| 924 | } | ||
| 925 | |||
| 926 | val = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG7); | ||
| 927 | val &= ~(0xf << 8); | ||
| 928 | val |= (0xc & 0xf) << 8; | ||
| 929 | gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG7, val); | ||
| 930 | 910 | ||
| 931 | /* NAND write protect off */ | 911 | /* NAND write protect off */ |
| 932 | omap_nand_wp(&info->mtd, NAND_WP_OFF); | 912 | omap_nand_wp(&info->mtd, NAND_WP_OFF); |
| @@ -934,7 +914,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 934 | if (!request_mem_region(info->phys_base, NAND_IO_SIZE, | 914 | if (!request_mem_region(info->phys_base, NAND_IO_SIZE, |
| 935 | pdev->dev.driver->name)) { | 915 | pdev->dev.driver->name)) { |
| 936 | err = -EBUSY; | 916 | err = -EBUSY; |
| 937 | goto out_free_cs; | 917 | goto out_free_info; |
| 938 | } | 918 | } |
| 939 | 919 | ||
| 940 | info->nand.IO_ADDR_R = ioremap(info->phys_base, NAND_IO_SIZE); | 920 | info->nand.IO_ADDR_R = ioremap(info->phys_base, NAND_IO_SIZE); |
| @@ -963,11 +943,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 963 | info->nand.chip_delay = 50; | 943 | info->nand.chip_delay = 50; |
| 964 | } | 944 | } |
| 965 | 945 | ||
| 966 | info->nand.options |= NAND_SKIP_BBTSCAN; | ||
| 967 | if ((gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG1) & 0x3000) | ||
| 968 | == 0x1000) | ||
| 969 | info->nand.options |= NAND_BUSWIDTH_16; | ||
| 970 | |||
| 971 | if (use_prefetch) { | 946 | if (use_prefetch) { |
| 972 | /* copy the virtual address of nand base for fifo access */ | 947 | /* copy the virtual address of nand base for fifo access */ |
| 973 | info->nand_pref_fifo_add = info->nand.IO_ADDR_R; | 948 | info->nand_pref_fifo_add = info->nand.IO_ADDR_R; |
| @@ -1043,8 +1018,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev) | |||
| 1043 | 1018 | ||
| 1044 | out_release_mem_region: | 1019 | out_release_mem_region: |
| 1045 | release_mem_region(info->phys_base, NAND_IO_SIZE); | 1020 | release_mem_region(info->phys_base, NAND_IO_SIZE); |
| 1046 | out_free_cs: | ||
| 1047 | gpmc_cs_free(info->gpmc_cs); | ||
| 1048 | out_free_info: | 1021 | out_free_info: |
| 1049 | kfree(info); | 1022 | kfree(info); |
| 1050 | 1023 | ||
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h index 05adb6a666cf..3269292efecc 100644 --- a/drivers/net/smc911x.h +++ b/drivers/net/smc911x.h | |||
| @@ -42,12 +42,12 @@ | |||
| 42 | #define SMC_USE_16BIT 0 | 42 | #define SMC_USE_16BIT 0 |
| 43 | #define SMC_USE_32BIT 1 | 43 | #define SMC_USE_32BIT 1 |
| 44 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | 44 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW |
| 45 | #elif defined(CONFIG_ARCH_OMAP34XX) | 45 | #elif defined(CONFIG_ARCH_OMAP3) |
| 46 | #define SMC_USE_16BIT 0 | 46 | #define SMC_USE_16BIT 0 |
| 47 | #define SMC_USE_32BIT 1 | 47 | #define SMC_USE_32BIT 1 |
| 48 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | 48 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW |
| 49 | #define SMC_MEM_RESERVED 1 | 49 | #define SMC_MEM_RESERVED 1 |
| 50 | #elif defined(CONFIG_ARCH_OMAP24XX) | 50 | #elif defined(CONFIG_ARCH_OMAP2) |
| 51 | #define SMC_USE_16BIT 0 | 51 | #define SMC_USE_16BIT 0 |
| 52 | #define SMC_USE_32BIT 1 | 52 | #define SMC_USE_32BIT 1 |
| 53 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | 53 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW |
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 0fee95cd9a49..a191fa2be7c5 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig | |||
| @@ -181,7 +181,7 @@ config SPI_OMAP_UWIRE | |||
| 181 | 181 | ||
| 182 | config SPI_OMAP24XX | 182 | config SPI_OMAP24XX |
| 183 | tristate "McSPI driver for OMAP24xx/OMAP34xx" | 183 | tristate "McSPI driver for OMAP24xx/OMAP34xx" |
| 184 | depends on ARCH_OMAP24XX || ARCH_OMAP34XX | 184 | depends on ARCH_OMAP2 || ARCH_OMAP3 |
| 185 | help | 185 | help |
| 186 | SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI | 186 | SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI |
| 187 | (McSPI) modules. | 187 | (McSPI) modules. |
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index bf5f95a19413..715c518b1b68 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c | |||
| @@ -1014,7 +1014,7 @@ static u8 __initdata spi2_txdma_id[] = { | |||
| 1014 | OMAP24XX_DMA_SPI2_TX1, | 1014 | OMAP24XX_DMA_SPI2_TX1, |
| 1015 | }; | 1015 | }; |
| 1016 | 1016 | ||
| 1017 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP34XX) \ | 1017 | #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) \ |
| 1018 | || defined(CONFIG_ARCH_OMAP4) | 1018 | || defined(CONFIG_ARCH_OMAP4) |
| 1019 | static u8 __initdata spi3_rxdma_id[] = { | 1019 | static u8 __initdata spi3_rxdma_id[] = { |
| 1020 | OMAP24XX_DMA_SPI3_RX0, | 1020 | OMAP24XX_DMA_SPI3_RX0, |
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 81aac7f4ca59..4f5bb5698f5d 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig | |||
| @@ -61,7 +61,7 @@ config USB_ARCH_HAS_EHCI | |||
| 61 | default y if ARCH_W90X900 | 61 | default y if ARCH_W90X900 |
| 62 | default y if ARCH_AT91SAM9G45 | 62 | default y if ARCH_AT91SAM9G45 |
| 63 | default y if ARCH_MXC | 63 | default y if ARCH_MXC |
| 64 | default y if ARCH_OMAP34XX | 64 | default y if ARCH_OMAP3 |
| 65 | default PCI | 65 | default PCI |
| 66 | 66 | ||
| 67 | # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface. | 67 | # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface. |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 1ec3857f22e6..d8d6d3461d32 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
| @@ -1118,7 +1118,7 @@ MODULE_LICENSE ("GPL"); | |||
| 1118 | #define PLATFORM_DRIVER ehci_hcd_au1xxx_driver | 1118 | #define PLATFORM_DRIVER ehci_hcd_au1xxx_driver |
| 1119 | #endif | 1119 | #endif |
| 1120 | 1120 | ||
| 1121 | #ifdef CONFIG_ARCH_OMAP34XX | 1121 | #ifdef CONFIG_ARCH_OMAP3 |
| 1122 | #include "ehci-omap.c" | 1122 | #include "ehci-omap.c" |
| 1123 | #define PLATFORM_DRIVER ehci_hcd_omap_driver | 1123 | #define PLATFORM_DRIVER ehci_hcd_omap_driver |
| 1124 | #endif | 1124 | #endif |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index d9db86498022..b4c783c284ba 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
| @@ -37,7 +37,7 @@ config USB_MUSB_SOC | |||
| 37 | depends on USB_MUSB_HDRC | 37 | depends on USB_MUSB_HDRC |
| 38 | default y if ARCH_DAVINCI | 38 | default y if ARCH_DAVINCI |
| 39 | default y if ARCH_OMAP2430 | 39 | default y if ARCH_OMAP2430 |
| 40 | default y if ARCH_OMAP34XX | 40 | default y if ARCH_OMAP3 |
| 41 | default y if (BF54x && !BF544) | 41 | default y if (BF54x && !BF544) |
| 42 | default y if (BF52x && !BF522 && !BF523) | 42 | default y if (BF52x && !BF522 && !BF523) |
| 43 | 43 | ||
| @@ -48,7 +48,7 @@ comment "OMAP 243x high speed USB support" | |||
| 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 | 48 | depends on USB_MUSB_HDRC && ARCH_OMAP2430 |
| 49 | 49 | ||
| 50 | comment "OMAP 343x high speed USB support" | 50 | comment "OMAP 343x high speed USB support" |
| 51 | depends on USB_MUSB_HDRC && ARCH_OMAP34XX | 51 | depends on USB_MUSB_HDRC && ARCH_OMAP3 |
| 52 | 52 | ||
| 53 | comment "Blackfin high speed USB Support" | 53 | comment "Blackfin high speed USB Support" |
| 54 | depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523)) | 54 | depends on USB_MUSB_HDRC && ((BF54x && !BF544) || (BF52x && !BF522 && !BF523)) |
| @@ -153,7 +153,7 @@ config MUSB_PIO_ONLY | |||
| 153 | config USB_INVENTRA_DMA | 153 | config USB_INVENTRA_DMA |
| 154 | bool | 154 | bool |
| 155 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY | 155 | depends on USB_MUSB_HDRC && !MUSB_PIO_ONLY |
| 156 | default ARCH_OMAP2430 || ARCH_OMAP34XX || BLACKFIN | 156 | default ARCH_OMAP2430 || ARCH_OMAP3 || BLACKFIN |
| 157 | help | 157 | help |
| 158 | Enable DMA transfers using Mentor's engine. | 158 | Enable DMA transfers using Mentor's engine. |
| 159 | 159 | ||
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 5eb9318cff77..738efd8063b5 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
| @@ -1000,7 +1000,7 @@ static void musb_shutdown(struct platform_device *pdev) | |||
| 1000 | * more than selecting one of a bunch of predefined configurations. | 1000 | * more than selecting one of a bunch of predefined configurations. |
| 1001 | */ | 1001 | */ |
| 1002 | #if defined(CONFIG_USB_TUSB6010) || \ | 1002 | #if defined(CONFIG_USB_TUSB6010) || \ |
| 1003 | defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP34XX) | 1003 | defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) |
| 1004 | static ushort __initdata fifo_mode = 4; | 1004 | static ushort __initdata fifo_mode = 4; |
| 1005 | #else | 1005 | #else |
| 1006 | static ushort __initdata fifo_mode = 2; | 1006 | static ushort __initdata fifo_mode = 2; |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 03d50909b078..5514c7ee85bd 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
| @@ -562,7 +562,7 @@ extern void musb_hnp_stop(struct musb *musb); | |||
| 562 | extern int musb_platform_set_mode(struct musb *musb, u8 musb_mode); | 562 | extern int musb_platform_set_mode(struct musb *musb, u8 musb_mode); |
| 563 | 563 | ||
| 564 | #if defined(CONFIG_USB_TUSB6010) || defined(CONFIG_BLACKFIN) || \ | 564 | #if defined(CONFIG_USB_TUSB6010) || defined(CONFIG_BLACKFIN) || \ |
| 565 | defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP34XX) | 565 | defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) |
| 566 | extern void musb_platform_try_idle(struct musb *musb, unsigned long timeout); | 566 | extern void musb_platform_try_idle(struct musb *musb, unsigned long timeout); |
| 567 | #else | 567 | #else |
| 568 | #define musb_platform_try_idle(x, y) do {} while (0) | 568 | #define musb_platform_try_idle(x, y) do {} while (0) |
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig index 3195fb8b7d9a..80b3b123dd7f 100644 --- a/drivers/w1/masters/Kconfig +++ b/drivers/w1/masters/Kconfig | |||
| @@ -60,7 +60,7 @@ config W1_MASTER_GPIO | |||
| 60 | 60 | ||
| 61 | config HDQ_MASTER_OMAP | 61 | config HDQ_MASTER_OMAP |
| 62 | tristate "OMAP HDQ driver" | 62 | tristate "OMAP HDQ driver" |
| 63 | depends on ARCH_OMAP2430 || ARCH_OMAP34XX | 63 | depends on ARCH_OMAP2430 || ARCH_OMAP3 |
| 64 | help | 64 | help |
| 65 | Say Y here if you want support for the 1-wire or HDQ Interface | 65 | Say Y here if you want support for the 1-wire or HDQ Interface |
| 66 | on an OMAP processor. | 66 | on an OMAP processor. |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 050ee147592f..3da3f48720a7 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -194,7 +194,7 @@ config EP93XX_WATCHDOG | |||
| 194 | 194 | ||
| 195 | config OMAP_WATCHDOG | 195 | config OMAP_WATCHDOG |
| 196 | tristate "OMAP Watchdog" | 196 | tristate "OMAP Watchdog" |
| 197 | depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX | 197 | depends on ARCH_OMAP16XX || ARCH_OMAP2 || ARCH_OMAP3 |
| 198 | help | 198 | help |
| 199 | Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog. Say 'Y' | 199 | Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog. Say 'Y' |
| 200 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog timer. | 200 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430 watchdog timer. |
