Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84775
b: refs/heads/master
c: 9a1e8eb
h: refs/heads/master
i:
  84773: 045d62f
  84771: 19c0c91
  84767: 7c37f75
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Feb 8, 2008
1 parent c52bb19 commit c99aabc
Show file tree
Hide file tree
Showing 7 changed files with 547 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8cece84c9f36410de5164735e909603426e4d5f
refs/heads/master: 9a1e8eb1f0b76b5e72a2343ad881c81b08dd6410
54 changes: 54 additions & 0 deletions trunk/arch/avr32/mach-at32ap/at32ap700x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,59 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data,
}
#endif

/* --------------------------------------------------------------------
* PWM
* -------------------------------------------------------------------- */
static struct resource atmel_pwm0_resource[] __initdata = {
PBMEM(0xfff01400),
IRQ(24),
};
static struct clk atmel_pwm0_mck = {
.name = "mck",
.parent = &pbb_clk,
.mode = pbb_clk_mode,
.get_rate = pbb_clk_get_rate,
.index = 5,
};

struct platform_device *__init at32_add_device_pwm(u32 mask)
{
struct platform_device *pdev;

if (!mask)
return NULL;

pdev = platform_device_alloc("atmel_pwm", 0);
if (!pdev)
return NULL;

if (platform_device_add_resources(pdev, atmel_pwm0_resource,
ARRAY_SIZE(atmel_pwm0_resource)))
goto out_free_pdev;

if (platform_device_add_data(pdev, &mask, sizeof(mask)))
goto out_free_pdev;

if (mask & (1 << 0))
select_peripheral(PA(28), PERIPH_A, 0);
if (mask & (1 << 1))
select_peripheral(PA(29), PERIPH_A, 0);
if (mask & (1 << 2))
select_peripheral(PA(21), PERIPH_B, 0);
if (mask & (1 << 3))
select_peripheral(PA(22), PERIPH_B, 0);

atmel_pwm0_mck.dev = &pdev->dev;

platform_device_add(pdev);

return pdev;

out_free_pdev:
platform_device_put(pdev);
return NULL;
}

/* --------------------------------------------------------------------
* SSC
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -1646,6 +1699,7 @@ struct clk *at32_clock_list[] = {
&atmel_usart1_usart,
&atmel_usart2_usart,
&atmel_usart3_usart,
&atmel_pwm0_mck,
#if defined(CONFIG_CPU_AT32AP7000)
&macb0_hclk,
&macb0_pclk,
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ menuconfig MISC_DEVICES

if MISC_DEVICES

config ATMEL_PWM
tristate "Atmel AT32/AT91 PWM support"
depends on AVR32 || ARCH_AT91
help
This option enables device driver support for the PWM channels
on certain Atmel prcoessors. Pulse Width Modulation is used for
purposes including software controlled power-efficent backlights
on LCD displays, motor control, and waveform generation.

config IBM_ASM
tristate "Device driver for IBM RSA service processor"
depends on X86 && PCI && INPUT && EXPERIMENTAL
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/
obj-$(CONFIG_MSI_LAPTOP) += msi-laptop.o
obj-$(CONFIG_ACER_WMI) += acer-wmi.o
obj-$(CONFIG_ASUS_LAPTOP) += asus-laptop.o
obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o
obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
obj-$(CONFIG_TC1100_WMI) += tc1100-wmi.o
obj-$(CONFIG_LKDTM) += lkdtm.o
Expand Down
Loading

0 comments on commit c99aabc

Please sign in to comment.