Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284701
b: refs/heads/master
c: e734ae1
h: refs/heads/master
i:
  284699: f550038
v: v3
  • Loading branch information
Manuel Lauss authored and Ralf Baechle committed Dec 8, 2011
1 parent 44c02a3 commit ff3b14a
Show file tree
Hide file tree
Showing 2 changed files with 58 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: cd671c16f0b18c83d949218867b2d88583080b36
refs/heads/master: e734ae13f125096f8467f90e00c27166860245cd
74 changes: 57 additions & 17 deletions trunk/arch/mips/alchemy/devboards/db1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,6 @@ void __init board_setup(void)
DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);

printk(KERN_INFO "AMD Alchemy %s Board\n", board_type_str());

#if defined(CONFIG_IRDA) && defined(CONFIG_AU1000_FIR)
{
u32 pin_func;

/* Set IRFIRSEL instead of GPIO15 */
pin_func = au_readl(SYS_PINFUNC) | SYS_PF_IRF;
au_writel(pin_func, SYS_PINFUNC);
/* Power off until the driver is in use */
bcsr_mod(BCSR_RESETS, BCSR_RESETS_IRDA_MODE_MASK,
BCSR_RESETS_IRDA_MODE_OFF);
}
#endif
bcsr_write(BCSR_PCMCIA, 0); /* turn off PCMCIA power */

/* Enable GPIO[31:0] inputs */
alchemy_gpio1_input_enable();
}


Expand Down Expand Up @@ -389,6 +372,57 @@ static struct platform_device db1100_mmc1_dev = {
.resource = au1100_mmc1_res,
};

/******************************************************************************/

static void db1000_irda_set_phy_mode(int mode)
{
unsigned short mask = BCSR_RESETS_IRDA_MODE_MASK | BCSR_RESETS_FIR_SEL;

switch (mode) {
case AU1000_IRDA_PHY_MODE_OFF:
bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_OFF);
break;
case AU1000_IRDA_PHY_MODE_SIR:
bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL);
break;
case AU1000_IRDA_PHY_MODE_FIR:
bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL |
BCSR_RESETS_FIR_SEL);
break;
}
}

static struct au1k_irda_platform_data db1000_irda_platdata = {
.set_phy_mode = db1000_irda_set_phy_mode,
};

static struct resource au1000_irda_res[] = {
[0] = {
.start = AU1000_IRDA_PHYS_ADDR,
.end = AU1000_IRDA_PHYS_ADDR + 0x0fff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = AU1000_IRDA_TX_INT,
.end = AU1000_IRDA_TX_INT,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = AU1000_IRDA_RX_INT,
.end = AU1000_IRDA_RX_INT,
.flags = IORESOURCE_IRQ,
},
};

static struct platform_device db1000_irda_dev = {
.name = "au1000-irda",
.id = -1,
.dev = {
.platform_data = &db1000_irda_platdata,
},
.resource = au1000_irda_res,
.num_resources = ARRAY_SIZE(au1000_irda_res),
};

static struct platform_device *db1x00_devs[] = {
&db1x00_codec_dev,
Expand All @@ -397,10 +431,15 @@ static struct platform_device *db1x00_devs[] = {
&db1x00_audio_dev,
};

static struct platform_device *db1000_devs[] = {
&db1000_irda_dev,
};

static struct platform_device *db1100_devs[] = {
&au1100_lcd_device,
&db1100_mmc0_dev,
&db1100_mmc1_dev,
&db1000_irda_dev,
};

static int __init db1000_dev_init(void)
Expand Down Expand Up @@ -434,6 +473,7 @@ static int __init db1000_dev_init(void)
d1 = AU1000_GPIO3_INT;
s0 = AU1000_GPIO1_INT;
s1 = AU1000_GPIO4_INT;
platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs));
} else
return 0; /* unknown board, no further dev setup to do */

Expand Down

0 comments on commit ff3b14a

Please sign in to comment.