diff options
author | Jon Hunter <jon-hunter@ti.com> | 2013-02-21 14:00:21 -0500 |
---|---|---|
committer | Jon Hunter <jon-hunter@ti.com> | 2013-04-01 15:53:44 -0400 |
commit | 3a544354d5b6e97459ba9c15e9d89dac60023553 (patch) | |
tree | f5c7abe6a0751abf79b9b1a4140c296662c76cd6 /arch/arm/mach-omap2/gpmc.c | |
parent | 012e338625f5ea58d2a16cf98a44779255b458ca (diff) |
ARM: OMAP2+: Don't configure of chip-select options in gpmc_cs_configure()
With the addition of the gpmc_cs_program_settings(), we no longer need
or use gpmc_cs_configure() to configure some of the GPMC chip-select
options. So rename the function to gpmc_configure() and remove code that
modifies options in the CONFIG1 register.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Diffstat (limited to 'arch/arm/mach-omap2/gpmc.c')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index ee5d0e970c62..b22771b4d9f2 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -550,16 +550,14 @@ void gpmc_cs_free(int cs) | |||
550 | EXPORT_SYMBOL(gpmc_cs_free); | 550 | EXPORT_SYMBOL(gpmc_cs_free); |
551 | 551 | ||
552 | /** | 552 | /** |
553 | * gpmc_cs_configure - write request to configure gpmc | 553 | * gpmc_configure - write request to configure gpmc |
554 | * @cs: chip select number | ||
555 | * @cmd: command type | 554 | * @cmd: command type |
556 | * @wval: value to write | 555 | * @wval: value to write |
557 | * @return status of the operation | 556 | * @return status of the operation |
558 | */ | 557 | */ |
559 | int gpmc_cs_configure(int cs, int cmd, int wval) | 558 | int gpmc_configure(int cmd, int wval) |
560 | { | 559 | { |
561 | int err = 0; | 560 | u32 regval; |
562 | u32 regval = 0; | ||
563 | 561 | ||
564 | switch (cmd) { | 562 | switch (cmd) { |
565 | case GPMC_ENABLE_IRQ: | 563 | case GPMC_ENABLE_IRQ: |
@@ -579,47 +577,14 @@ int gpmc_cs_configure(int cs, int cmd, int wval) | |||
579 | gpmc_write_reg(GPMC_CONFIG, regval); | 577 | gpmc_write_reg(GPMC_CONFIG, regval); |
580 | break; | 578 | break; |
581 | 579 | ||
582 | case GPMC_CONFIG_RDY_BSY: | ||
583 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
584 | if (wval) | ||
585 | regval |= WR_RD_PIN_MONITORING; | ||
586 | else | ||
587 | regval &= ~WR_RD_PIN_MONITORING; | ||
588 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
589 | break; | ||
590 | |||
591 | case GPMC_CONFIG_DEV_SIZE: | ||
592 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
593 | |||
594 | /* clear 2 target bits */ | ||
595 | regval &= ~GPMC_CONFIG1_DEVICESIZE(3); | ||
596 | |||
597 | /* set the proper value */ | ||
598 | regval |= GPMC_CONFIG1_DEVICESIZE(wval); | ||
599 | |||
600 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
601 | break; | ||
602 | |||
603 | case GPMC_CONFIG_DEV_TYPE: | ||
604 | regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); | ||
605 | /* clear 4 target bits */ | ||
606 | regval &= ~(GPMC_CONFIG1_DEVICETYPE(3) | | ||
607 | GPMC_CONFIG1_MUXTYPE(3)); | ||
608 | /* set the proper value */ | ||
609 | regval |= GPMC_CONFIG1_DEVICETYPE(wval); | ||
610 | if (wval == GPMC_DEVICETYPE_NOR) | ||
611 | regval |= GPMC_CONFIG1_MUXADDDATA; | ||
612 | gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval); | ||
613 | break; | ||
614 | |||
615 | default: | 580 | default: |
616 | printk(KERN_ERR "gpmc_configure_cs: Not supported\n"); | 581 | pr_err("%s: command not supported\n", __func__); |
617 | err = -EINVAL; | 582 | return -EINVAL; |
618 | } | 583 | } |
619 | 584 | ||
620 | return err; | 585 | return 0; |
621 | } | 586 | } |
622 | EXPORT_SYMBOL(gpmc_cs_configure); | 587 | EXPORT_SYMBOL(gpmc_configure); |
623 | 588 | ||
624 | void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) | 589 | void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs) |
625 | { | 590 | { |