Commit f3344c54 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6

* 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  [AVR32] ARRAY_SIZE() cleanup
  [AVR32] Implement at32_add_device_cf()
  [AVR32] Implement more at32_add_device_foo() functions
  [AVR32] Fix a couple of sparse warnings
  [AVR32] Wire up AT73C213 sound driver on ATSTK1000 board
  [AVR32] Platform code for pata_at32
parents ba1c28a9 2298a1dd
......@@ -16,6 +16,7 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/spi/spi.h>
#include <linux/spi/at73c213.h>
#include <video/atmel_lcdc.h>
......@@ -48,8 +49,27 @@ static struct eth_platform_data __initdata eth_data[2] = {
},
};
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
static struct at73c213_board_info at73c213_data = {
.ssc_id = 0,
.shortname = "AVR32 STK1000 external DAC",
};
#endif
#endif
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
static struct spi_board_info spi0_board_info[] __initdata = {
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
{
/* AT73C213 */
.modalias = "at73c213",
.max_speed_hz = 200000,
.chip_select = 0,
.mode = SPI_MODE_1,
.platform_data = &at73c213_data,
},
#endif
{
/* QVGA display */
.modalias = "ltv350qv",
......@@ -180,6 +200,38 @@ static void setup_j2_leds(void)
}
#endif
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
static void __init at73c213_set_clk(struct at73c213_board_info *info)
{
struct clk *gclk;
struct clk *pll;
gclk = clk_get(NULL, "gclk0");
if (IS_ERR(gclk))
goto err_gclk;
pll = clk_get(NULL, "pll0");
if (IS_ERR(pll))
goto err_pll;
if (clk_set_parent(gclk, pll)) {
pr_debug("STK1000: failed to set pll0 as parent for DAC clock\n");
goto err_set_clk;
}
at32_select_periph(GPIO_PIN_PA(30), GPIO_PERIPH_A, 0);
info->dac_clk = gclk;
err_set_clk:
clk_put(pll);
err_pll:
clk_put(gclk);
err_gclk:
return;
}
#endif
#endif
void __init setup_board(void)
{
#ifdef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
......@@ -248,6 +300,12 @@ static int __init atstk1002_init(void)
setup_j2_leds();
#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
#ifndef CONFIG_BOARD_ATSTK1002_SW1_CUSTOM
at73c213_set_clk(&at73c213_data);
#endif
#endif
return 0;
}
postcore_initcall(atstk1002_init);
This diff is collapsed.
......@@ -142,7 +142,7 @@ static int eic_set_irq_type(unsigned int irq, unsigned int flow_type)
return ret;
}
struct irq_chip eic_chip = {
static struct irq_chip eic_chip = {
.name = "eic",
.ack = eic_ack_irq,
.mask = eic_mask_irq,
......
......@@ -113,8 +113,8 @@
/* Register access macros */
#define pm_readl(reg) \
__raw_readl((void __iomem *)AT32_PM_BASE + PM_##reg)
__raw_readl((void __iomem __force *)AT32_PM_BASE + PM_##reg)
#define pm_writel(reg,value) \
__raw_writel((value), (void __iomem *)AT32_PM_BASE + PM_##reg)
__raw_writel((value), (void __iomem __force *)AT32_PM_BASE + PM_##reg)
#endif /* __ARCH_AVR32_MACH_AT32AP_PM_H__ */
......@@ -79,7 +79,7 @@ static int avr32_timer_calc_div_and_set_jiffies(struct clk *pclk)
{
unsigned int cycles_max = (clocksource_avr32.mask + 1) / 2;
unsigned int divs[] = { 4, 8, 16, 32 };
int divs_size = sizeof(divs) / sizeof(*divs);
int divs_size = ARRAY_SIZE(divs);
int i = 0;
unsigned long count_hz;
unsigned long shift;
......
......@@ -44,6 +44,13 @@ struct usba_platform_data {
struct platform_device *
at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
struct ide_platform_data {
u8 cs;
};
struct platform_device *
at32_add_device_ide(unsigned int id, unsigned int extint,
struct ide_platform_data *data);
/* depending on what's hooked up, not all SSC pins will be used */
#define ATMEL_SSC_TK 0x01
#define ATMEL_SSC_TF 0x02
......@@ -58,4 +65,20 @@ at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
struct platform_device *
at32_add_device_ssc(unsigned int id, unsigned int flags);
struct platform_device *at32_add_device_twi(unsigned int id);
struct platform_device *at32_add_device_mci(unsigned int id);
struct platform_device *at32_add_device_ac97c(unsigned int id);
struct platform_device *at32_add_device_abdac(unsigned int id);
struct cf_platform_data {
int detect_pin;
int reset_pin;
int vcc_pin;
int ready_pin;
u8 cs;
};
struct platform_device *
at32_add_device_cf(unsigned int id, unsigned int extint,
struct cf_platform_data *data);
#endif /* __ASM_ARCH_BOARD_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment