Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116219
b: refs/heads/master
c: 1c1b6ff
h: refs/heads/master
i:
  116217: 6d5d486
  116215: b187674
v: v3
  • Loading branch information
Dmitry Baryshkov authored and Samuel Ortiz committed Oct 19, 2008
1 parent 4219b98 commit 397a656
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 80e74a805f0a6662b9b8de519439afd06ac35427
refs/heads/master: 1c1b6ffce5737d764cc474b9bd6677bb9a344094
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-pxa/include/mach/tosa.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
* TC6393XB GPIOs
*/
#define TOSA_TC6393XB_GPIO_BASE (NR_BUILTIN_GPIO + 2 * 12)
#define TOSA_TC6393XB_GPIO(i) (TOSA_TC6393XB_GPIO_BASE + (i))
#define TOSA_TC6393XB_GPIO_BIT(gpio) (1 << (gpio - TOSA_TC6393XB_GPIO_BASE))

#define TOSA_GPIO_TG_ON (TOSA_TC6393XB_GPIO_BASE + 0)
#define TOSA_GPIO_L_MUTE (TOSA_TC6393XB_GPIO_BASE + 1)
Expand Down
35 changes: 29 additions & 6 deletions trunk/arch/arm/mach-pxa/tosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,16 +706,39 @@ static struct tmio_nand_data tosa_tc6393xb_nand_config = {
.badblock_pattern = &tosa_tc6393xb_nand_bbt,
};

static struct tc6393xb_platform_data tosa_tc6393xb_setup = {
static int tosa_tc6393xb_setup(struct platform_device *dev)
{
int rc;

rc = gpio_request(TOSA_GPIO_CARD_VCC_ON, "CARD_VCC_ON");
if (rc)
goto err_req;

rc = gpio_direction_output(TOSA_GPIO_CARD_VCC_ON, 1);
if (rc)
goto err_dir;

return rc;

err_dir:
gpio_free(TOSA_GPIO_CARD_VCC_ON);
err_req:
return rc;
}

static void tosa_tc6393xb_teardown(struct platform_device *dev)
{
gpio_free(TOSA_GPIO_CARD_VCC_ON);
}

static struct tc6393xb_platform_data tosa_tc6393xb_data = {
.scr_pll2cr = 0x0cc1,
.scr_gper = 0x3300,
.scr_gpo_dsr =
TOSA_TC6393XB_GPIO_BIT(TOSA_GPIO_CARD_VCC_ON),
.scr_gpo_doecr =
TOSA_TC6393XB_GPIO_BIT(TOSA_GPIO_CARD_VCC_ON),

.irq_base = IRQ_BOARD_START,
.gpio_base = TOSA_TC6393XB_GPIO_BASE,
.setup = tosa_tc6393xb_setup,
.teardown = tosa_tc6393xb_teardown,

.enable = tosa_tc6393xb_enable,
.disable = tosa_tc6393xb_disable,
Expand All @@ -730,7 +753,7 @@ static struct platform_device tc6393xb_device = {
.name = "tc6393xb",
.id = -1,
.dev = {
.platform_data = &tosa_tc6393xb_setup,
.platform_data = &tosa_tc6393xb_data,
},
.num_resources = ARRAY_SIZE(tc6393xb_resources),
.resource = tc6393xb_resources,
Expand Down
21 changes: 14 additions & 7 deletions trunk/drivers/mfd/tc6393xb.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,6 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)

tc6393xb->suspend_state.fer = 0;

for (i = 0; i < 3; i++) {
tc6393xb->suspend_state.gpo_dsr[i] =
(tcpd->scr_gpo_dsr >> (8 * i)) & 0xff;
tc6393xb->suspend_state.gpo_doecr[i] =
(tcpd->scr_gpo_doecr >> (8 * i)) & 0xff;
}

tc6393xb->suspend_state.ccr = SCR_CCR_UNK1 |
SCR_CCR_HCLK_48;

Expand All @@ -488,6 +481,12 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)

tc6393xb_attach_irq(dev);

if (tcpd->setup) {
ret = tcpd->setup(dev);
if (ret)
goto err_setup;
}

tc6393xb_cells[TC6393XB_CELL_NAND].driver_data = tcpd->nand_data;
tc6393xb_cells[TC6393XB_CELL_NAND].platform_data =
&tc6393xb_cells[TC6393XB_CELL_NAND];
Expand All @@ -506,6 +505,10 @@ static int __devinit tc6393xb_probe(struct platform_device *dev)
if (!ret)
return 0;

if (tcpd->teardown)
tcpd->teardown(dev);

err_setup:
tc6393xb_detach_irq(dev);

err_gpio_add:
Expand Down Expand Up @@ -535,6 +538,10 @@ static int __devexit tc6393xb_remove(struct platform_device *dev)
int ret;

mfd_remove_devices(&dev->dev);

if (tcpd->teardown)
tcpd->teardown(dev);

tc6393xb_detach_irq(dev);

if (tc6393xb->gpio.base != -1) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/mfd/tc6393xb.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
struct tc6393xb_platform_data {
u16 scr_pll2cr; /* PLL2 Control */
u16 scr_gper; /* GP Enable */
u32 scr_gpo_doecr; /* GPO Data OE Control */
u32 scr_gpo_dsr; /* GPO Data Set */

int (*enable)(struct platform_device *dev);
int (*disable)(struct platform_device *dev);
Expand All @@ -31,6 +29,8 @@ struct tc6393xb_platform_data {

int irq_base; /* base for subdevice irqs */
int gpio_base;
int (*setup)(struct platform_device *dev);
void (*teardown)(struct platform_device *dev);

struct tmio_nand_data *nand_data;
};
Expand Down

0 comments on commit 397a656

Please sign in to comment.