diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2014-08-20 15:36:33 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-09-22 07:35:47 -0400 |
commit | c64bb5f0c26f6ea791270852217b7cb28553ba76 (patch) | |
tree | a553e2b23cff0ea8d4bf256c7417054db6cb781a | |
parent | c02a505e5a7787ee7aa871152ba571e6c1d1dc62 (diff) |
MIPS: Alchemy: DB1300: Add touch penirq support
wire up the WM9713 pendown irq support.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Cc: Linux-MIPS <linux-mips@linux-mips.org>
Patchwork: https://patchwork.linux-mips.org/patch/7563/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/alchemy/devboards/db1300.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c index e476ae9472b9..1c64fdbe4c81 100644 --- a/arch/mips/alchemy/devboards/db1300.c +++ b/arch/mips/alchemy/devboards/db1300.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/smsc911x.h> | 23 | #include <linux/smsc911x.h> |
24 | #include <linux/wm97xx.h> | ||
24 | 25 | ||
25 | #include <asm/mach-au1x00/au1000.h> | 26 | #include <asm/mach-au1x00/au1000.h> |
26 | #include <asm/mach-au1x00/au1100_mmc.h> | 27 | #include <asm/mach-au1x00/au1100_mmc.h> |
@@ -711,6 +712,46 @@ static struct platform_device db1300_lcd_dev = { | |||
711 | 712 | ||
712 | /**********************************************************************/ | 713 | /**********************************************************************/ |
713 | 714 | ||
715 | static void db1300_wm97xx_irqen(struct wm97xx *wm, int enable) | ||
716 | { | ||
717 | if (enable) | ||
718 | enable_irq(DB1300_AC97_PEN_INT); | ||
719 | else | ||
720 | disable_irq_nosync(DB1300_AC97_PEN_INT); | ||
721 | } | ||
722 | |||
723 | static struct wm97xx_mach_ops db1300_wm97xx_ops = { | ||
724 | .irq_enable = db1300_wm97xx_irqen, | ||
725 | .irq_gpio = WM97XX_GPIO_3, | ||
726 | }; | ||
727 | |||
728 | static int db1300_wm97xx_probe(struct platform_device *pdev) | ||
729 | { | ||
730 | struct wm97xx *wm = platform_get_drvdata(pdev); | ||
731 | |||
732 | /* external pendown indicator */ | ||
733 | wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN, | ||
734 | WM97XX_GPIO_POL_LOW, WM97XX_GPIO_STICKY, | ||
735 | WM97XX_GPIO_WAKE); | ||
736 | |||
737 | /* internal "virtual" pendown gpio */ | ||
738 | wm97xx_config_gpio(wm, WM97XX_GPIO_3, WM97XX_GPIO_OUT, | ||
739 | WM97XX_GPIO_POL_LOW, WM97XX_GPIO_NOTSTICKY, | ||
740 | WM97XX_GPIO_NOWAKE); | ||
741 | |||
742 | wm->pen_irq = DB1300_AC97_PEN_INT; | ||
743 | |||
744 | return wm97xx_register_mach_ops(wm, &db1300_wm97xx_ops); | ||
745 | } | ||
746 | |||
747 | static struct platform_driver db1300_wm97xx_driver = { | ||
748 | .driver.name = "wm97xx-touch", | ||
749 | .driver.owner = THIS_MODULE, | ||
750 | .probe = db1300_wm97xx_probe, | ||
751 | }; | ||
752 | |||
753 | /**********************************************************************/ | ||
754 | |||
714 | static struct platform_device *db1300_dev[] __initdata = { | 755 | static struct platform_device *db1300_dev[] __initdata = { |
715 | &db1300_eth_dev, | 756 | &db1300_eth_dev, |
716 | &db1300_i2c_dev, | 757 | &db1300_i2c_dev, |
@@ -755,6 +796,9 @@ int __init db1300_dev_setup(void) | |||
755 | i2c_register_board_info(0, db1300_i2c_devs, | 796 | i2c_register_board_info(0, db1300_i2c_devs, |
756 | ARRAY_SIZE(db1300_i2c_devs)); | 797 | ARRAY_SIZE(db1300_i2c_devs)); |
757 | 798 | ||
799 | if (platform_driver_register(&db1300_wm97xx_driver)) | ||
800 | pr_warn("DB1300: failed to init touch pen irq support!\n"); | ||
801 | |||
758 | /* Audio PSC clock is supplied by codecs (PSC1, 2) */ | 802 | /* Audio PSC clock is supplied by codecs (PSC1, 2) */ |
759 | __raw_writel(PSC_SEL_CLK_SERCLK, | 803 | __raw_writel(PSC_SEL_CLK_SERCLK, |
760 | (void __iomem *)KSEG1ADDR(AU1300_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); | 804 | (void __iomem *)KSEG1ADDR(AU1300_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); |