From patchwork Fri Jan 19 08:17:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 125116 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp185873ljf; Fri, 19 Jan 2018 00:20:03 -0800 (PST) X-Google-Smtp-Source: ACJfBoucDNn3E2XUZ2PUwkLhWcnvz+9fkAsDROvTx6UbdzyFdf0vE7OYtQvrnZxhgdOzXqWUbZx+ X-Received: by 10.99.123.8 with SMTP id w8mr29028380pgc.201.1516350003697; Fri, 19 Jan 2018 00:20:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516350003; cv=none; d=google.com; s=arc-20160816; b=WlXGruXT36WePrazmy9rI17xpXDwWBk2G7FEFnD47aRptjTw1kcT53vsrDO4eiQSyB 0SEPClFcvh2IBgmuE8YiXI5FnxtYQNf7IeMmVNTRp3UcXiXTPtREqQZvqjY5HNxmykjG 9GYkImFsJJdrY7RWhhUAkvwV2PrA2PSh5XQO9+t2FQ3vuMZ0ONpiq0tUy5d7+kYCC4nO EIHGUOzVT8fH5Xe6j8MCv1ABZQCCV5vFkKdeUch8l4E4lMnSyiJ4pE4FelPFHvkTZtxq kZxu+sb3I784kdGIe+5NhcceSxQBC7Xw1Ix/q1X1xeNktR5j0DtSRgV6IWeKWJW8vJfh BWdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=clp4jhnXjs6ovpQZ0KZ3zBUiXWJ+wAv1zb9rGG5F/Ig=; b=USDJ1AwIe7ysuy5Z3xlFyTT3uR+cgMwsA5kbOm40QZPswVGvPWywid2yjsgFTq2Kgf 6jPJ/XBhknzNhT+b+xt6DdHFI8byrqPJQE6ktLQRqKb6/VZUZY8tAzCDJXc3JYtDiibM dXU7enaFTPHN0O45reaFUzOqXkiey6+d9oIW+6eFKr03IhqTJPmvIKKHR1tKwH5VfGH1 OmfeE+qnQWTaqP/DHHaFgxgDhn65hpFVta1ajFGuUD43BmmbAdL082q046Tm/Oro3uhD pIk80fxPDUJIi2pKD6/wqhWXQJGJL3oKociWGxouKCAa1uzWNK2wWjBU2T245rYbszEH gKoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=L5u7xrEF; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si649817pla.372.2018.01.19.00.20.03 for ; Fri, 19 Jan 2018 00:20:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=L5u7xrEF; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754960AbeASIT7 (ORCPT ); Fri, 19 Jan 2018 03:19:59 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38793 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754932AbeASITy (ORCPT ); Fri, 19 Jan 2018 03:19:54 -0500 Received: by mail-wr0-f195.google.com with SMTP id x1so789575wrb.5; Fri, 19 Jan 2018 00:19:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=pqTpDpE0EfIAHU5HP6+cTqF71E4uMjymsJ4lN4MpzPg=; b=L5u7xrEF01OJp/2njY0l4QIxeqT/WMZ5BZvs9jY9MXhfbwHecK10u0AUw5+QJMowmA tLPv0hck+hmuK9irAhJoZmVVTeCWw/I5gGvHbfmmLHJu4B1HBbyAuSf2f5A6ijJk5ZUJ hZsK1honC8bagDcFRkc0/sTNM3fghMiexcksDto7XRRmPyjViyEhpXUl0YV/QAfYSFnR lwC+R9OI718UO83Uc8AQ0i5LzRZ5Owtf+/ZcNAlW0sY1QdGMnflTaEVdMKh7ZSTaobP5 E2MoBRdO8CPWJIHUKIHPyDf7r0k8Fg3Cg0mgcl4vlAssLeMGuGJqnM5D3oLrUMJ+bY/v S24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pqTpDpE0EfIAHU5HP6+cTqF71E4uMjymsJ4lN4MpzPg=; b=c6pNrGAheVYYQzBgOfD9UXuzcGtey2bgR2+Gm2nzdx5dXL1wZ6trfYEeBty2JNEQhA xDTcGgneCt405fumW0mrdJy2YlvoKxOFsWNumGB7hSpb3YP4WxEyiW+ybnPUuFol5yVs inI2bMcici7/ki3gSRkUDuSaWNwoV/qESUgol+XXM0dYpaG10xzmchVA/w5kk+FqBkBo ovbloAlnqFZb/EUs141v9NcIb239Pi9O538VUUajYz8BT3gZ+Zvyy0vnz9DVEumDdht+ aSi2EmVusE2uOvwPRgV60taTppIoakUm9fBvIat300elBtbmL7bY62G/6ErmiDETSeX0 VNCg== X-Gm-Message-State: AKwxytc2B+qHh/u34eKj6jCE8qxfJV1EhLxjCbH+cWUOW7u2EKt426sr mJl+6RV9H369X4Ku5hdjco8= X-Received: by 10.223.145.198 with SMTP id 64mr7574270wri.53.1516349993245; Fri, 19 Jan 2018 00:19:53 -0800 (PST) Received: from Red.local (LFbn-MAR-1-494-174.w2-15.abo.wanadoo.fr. [2.15.82.174]) by smtp.googlemail.com with ESMTPSA id 2sm712269wmk.28.2018.01.19.00.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 00:19:52 -0800 (PST) From: Corentin Labbe To: alexandre.belloni@free-electrons.com, dmitry.torokhov@gmail.com, nicolas.ferre@microchip.com, egtvedt@samfundet.no Cc: linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH] input: touchscreen: remove atmel-wm97xx Date: Fri, 19 Jan 2018 09:17:45 +0100 Message-Id: <20180119081745.17557-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since AVR32 arch is gone, atmel-wm97xx driver is useless. Remove it. Signed-off-by: Corentin Labbe --- drivers/input/touchscreen/Kconfig | 15 -- drivers/input/touchscreen/Makefile | 1 - drivers/input/touchscreen/atmel-wm97xx.c | 436 ------------------------------- 3 files changed, 452 deletions(-) delete mode 100644 drivers/input/touchscreen/atmel-wm97xx.c -- 2.13.6 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Hans-Christian Noren Egtvedt diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 38a226f9fcbd..4f15496fec8b 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -795,21 +795,6 @@ config TOUCHSCREEN_WM9713 Say Y here to enable support for the Wolfson Microelectronics WM9713 touchscreen controller. -config TOUCHSCREEN_WM97XX_ATMEL - tristate "WM97xx Atmel accelerated touch" - depends on TOUCHSCREEN_WM97XX && AVR32 - help - Say Y here for support for streaming mode with WM97xx touchscreens - on Atmel AT91 or AVR32 systems with an AC97C module. - - Be aware that this will use channel B in the controller for - streaming data, this must not conflict with other AC97C drivers. - - If unsure, say N. - - To compile this driver as a module, choose M here: the module will - be called atmel-wm97xx. - config TOUCHSCREEN_WM97XX_MAINSTONE tristate "WM97xx Mainstone/Palm accelerated touch" depends on TOUCHSCREEN_WM97XX && ARCH_PXA diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index d2a2b3b7af27..dddae7973436 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -97,7 +97,6 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o -obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL) += atmel-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o diff --git a/drivers/input/touchscreen/atmel-wm97xx.c b/drivers/input/touchscreen/atmel-wm97xx.c deleted file mode 100644 index 9140a43cfe20..000000000000 --- a/drivers/input/touchscreen/atmel-wm97xx.c +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Atmel AT91 and AVR32 continuous touch screen driver for Wolfson WM97xx AC97 - * codecs. - * - * Copyright (C) 2008 - 2009 Atmel Corporation - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define AC97C_ICA 0x10 -#define AC97C_CBRHR 0x30 -#define AC97C_CBSR 0x38 -#define AC97C_CBMR 0x3c -#define AC97C_IER 0x54 -#define AC97C_IDR 0x58 - -#define AC97C_RXRDY (1 << 4) -#define AC97C_OVRUN (1 << 5) - -#define AC97C_CMR_SIZE_20 (0 << 16) -#define AC97C_CMR_SIZE_18 (1 << 16) -#define AC97C_CMR_SIZE_16 (2 << 16) -#define AC97C_CMR_SIZE_10 (3 << 16) -#define AC97C_CMR_CEM_LITTLE (1 << 18) -#define AC97C_CMR_CEM_BIG (0 << 18) -#define AC97C_CMR_CENA (1 << 21) - -#define AC97C_INT_CBEVT (1 << 4) - -#define AC97C_SR_CAEVT (1 << 3) - -#define AC97C_CH_MASK(slot) \ - (0x7 << (3 * (slot - 3))) -#define AC97C_CH_ASSIGN(slot, channel) \ - (AC97C_CHANNEL_##channel << (3 * (slot - 3))) -#define AC97C_CHANNEL_NONE 0x0 -#define AC97C_CHANNEL_B 0x2 - -#define ac97c_writel(chip, reg, val) \ - __raw_writel((val), (chip)->regs + AC97C_##reg) -#define ac97c_readl(chip, reg) \ - __raw_readl((chip)->regs + AC97C_##reg) - -#ifdef CONFIG_CPU_AT32AP700X -#define ATMEL_WM97XX_AC97C_IOMEM (0xfff02800) -#define ATMEL_WM97XX_AC97C_IRQ (29) -#define ATMEL_WM97XX_GPIO_DEFAULT (32+16) /* Pin 16 on port B. */ -#else -#error Unknown CPU, this driver only supports AT32AP700X CPUs. -#endif - -struct continuous { - u16 id; /* codec id */ - u8 code; /* continuous code */ - u8 reads; /* number of coord reads per read cycle */ - u32 speed; /* number of coords per second */ -}; - -#define WM_READS(sp) ((sp / HZ) + 1) - -static const struct continuous cinfo[] = { - {WM9705_ID2, 0, WM_READS(94), 94}, - {WM9705_ID2, 1, WM_READS(188), 188}, - {WM9705_ID2, 2, WM_READS(375), 375}, - {WM9705_ID2, 3, WM_READS(750), 750}, - {WM9712_ID2, 0, WM_READS(94), 94}, - {WM9712_ID2, 1, WM_READS(188), 188}, - {WM9712_ID2, 2, WM_READS(375), 375}, - {WM9712_ID2, 3, WM_READS(750), 750}, - {WM9713_ID2, 0, WM_READS(94), 94}, - {WM9713_ID2, 1, WM_READS(120), 120}, - {WM9713_ID2, 2, WM_READS(154), 154}, - {WM9713_ID2, 3, WM_READS(188), 188}, -}; - -/* Continuous speed index. */ -static int sp_idx; - -/* - * Pen sampling frequency (Hz) in continuous mode. - */ -static int cont_rate = 188; -module_param(cont_rate, int, 0); -MODULE_PARM_DESC(cont_rate, "Sampling rate in continuous mode (Hz)"); - -/* - * Pen down detection. - * - * This driver can either poll or use an interrupt to indicate a pen down - * event. If the irq request fails then it will fall back to polling mode. - */ -static int pen_int = 1; -module_param(pen_int, int, 0); -MODULE_PARM_DESC(pen_int, "Pen down detection (1 = interrupt, 0 = polling)"); - -/* - * Pressure readback. - * - * Set to 1 to read back pen down pressure. - */ -static int pressure; -module_param(pressure, int, 0); -MODULE_PARM_DESC(pressure, "Pressure readback (1 = pressure, 0 = no pressure)"); - -/* - * AC97 touch data slot. - * - * Touch screen readback data ac97 slot. - */ -static int ac97_touch_slot = 5; -module_param(ac97_touch_slot, int, 0); -MODULE_PARM_DESC(ac97_touch_slot, "Touch screen data slot AC97 number"); - -/* - * GPIO line number. - * - * Set to GPIO number where the signal from the WM97xx device is hooked up. - */ -static int atmel_gpio_line = ATMEL_WM97XX_GPIO_DEFAULT; -module_param(atmel_gpio_line, int, 0); -MODULE_PARM_DESC(atmel_gpio_line, "GPIO line number connected to WM97xx"); - -struct atmel_wm97xx { - struct wm97xx *wm; - struct timer_list pen_timer; - void __iomem *regs; - unsigned long ac97c_irq; - unsigned long gpio_pen; - unsigned long gpio_irq; - unsigned short x; - unsigned short y; -}; - -static irqreturn_t atmel_wm97xx_channel_b_interrupt(int irq, void *dev_id) -{ - struct atmel_wm97xx *atmel_wm97xx = dev_id; - struct wm97xx *wm = atmel_wm97xx->wm; - int status = ac97c_readl(atmel_wm97xx, CBSR); - irqreturn_t retval = IRQ_NONE; - - if (status & AC97C_OVRUN) { - dev_dbg(&wm->touch_dev->dev, "AC97C overrun\n"); - ac97c_readl(atmel_wm97xx, CBRHR); - retval = IRQ_HANDLED; - } else if (status & AC97C_RXRDY) { - u16 data; - u16 value; - u16 source; - u16 pen_down; - - data = ac97c_readl(atmel_wm97xx, CBRHR); - value = data & 0x0fff; - source = data & WM97XX_ADCSEL_MASK; - pen_down = (data & WM97XX_PEN_DOWN) >> 8; - - if (source == WM97XX_ADCSEL_X) - atmel_wm97xx->x = value; - if (source == WM97XX_ADCSEL_Y) - atmel_wm97xx->y = value; - - if (!pressure && source == WM97XX_ADCSEL_Y) { - input_report_abs(wm->input_dev, ABS_X, atmel_wm97xx->x); - input_report_abs(wm->input_dev, ABS_Y, atmel_wm97xx->y); - input_report_key(wm->input_dev, BTN_TOUCH, pen_down); - input_sync(wm->input_dev); - } else if (pressure && source == WM97XX_ADCSEL_PRES) { - input_report_abs(wm->input_dev, ABS_X, atmel_wm97xx->x); - input_report_abs(wm->input_dev, ABS_Y, atmel_wm97xx->y); - input_report_abs(wm->input_dev, ABS_PRESSURE, value); - input_report_key(wm->input_dev, BTN_TOUCH, value); - input_sync(wm->input_dev); - } - - retval = IRQ_HANDLED; - } - - return retval; -} - -static void atmel_wm97xx_acc_pen_up(struct wm97xx *wm) -{ - struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(wm->touch_dev); - struct input_dev *input_dev = wm->input_dev; - int pen_down = gpio_get_value(atmel_wm97xx->gpio_pen); - - if (pen_down != 0) { - mod_timer(&atmel_wm97xx->pen_timer, - jiffies + msecs_to_jiffies(1)); - } else { - if (pressure) - input_report_abs(input_dev, ABS_PRESSURE, 0); - input_report_key(input_dev, BTN_TOUCH, 0); - input_sync(input_dev); - } -} - -static void atmel_wm97xx_pen_timer(struct timer_list *t) -{ - struct atmel_wm97xx *atmel_wm97xx = from_timer(atmel_wm97xx, t, - pen_timer); - - atmel_wm97xx_acc_pen_up(atmel_wm97xx->wm); -} - -static int atmel_wm97xx_acc_startup(struct wm97xx *wm) -{ - struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(wm->touch_dev); - int idx = 0; - - if (wm->ac97 == NULL) - return -ENODEV; - - for (idx = 0; idx < ARRAY_SIZE(cinfo); idx++) { - if (wm->id != cinfo[idx].id) - continue; - - sp_idx = idx; - - if (cont_rate <= cinfo[idx].speed) - break; - } - - wm->acc_rate = cinfo[sp_idx].code; - wm->acc_slot = ac97_touch_slot; - dev_info(&wm->touch_dev->dev, "atmel accelerated touchscreen driver, " - "%d samples/sec\n", cinfo[sp_idx].speed); - - if (pen_int) { - unsigned long reg; - - wm->pen_irq = atmel_wm97xx->gpio_irq; - - switch (wm->id) { - case WM9712_ID2: /* Fall through. */ - case WM9713_ID2: - /* - * Use GPIO 13 (PEN_DOWN) to assert GPIO line 3 - * (PENDOWN). - */ - wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN, - WM97XX_GPIO_POL_HIGH, - WM97XX_GPIO_STICKY, - WM97XX_GPIO_WAKE); - wm97xx_config_gpio(wm, WM97XX_GPIO_3, WM97XX_GPIO_OUT, - WM97XX_GPIO_POL_HIGH, - WM97XX_GPIO_NOTSTICKY, - WM97XX_GPIO_NOWAKE); - case WM9705_ID2: /* Fall through. */ - /* - * Enable touch data slot in AC97 controller channel B. - */ - reg = ac97c_readl(atmel_wm97xx, ICA); - reg &= ~AC97C_CH_MASK(wm->acc_slot); - reg |= AC97C_CH_ASSIGN(wm->acc_slot, B); - ac97c_writel(atmel_wm97xx, ICA, reg); - - /* - * Enable channel and interrupt for RXRDY and OVERRUN. - */ - ac97c_writel(atmel_wm97xx, CBMR, AC97C_CMR_CENA - | AC97C_CMR_CEM_BIG - | AC97C_CMR_SIZE_16 - | AC97C_OVRUN - | AC97C_RXRDY); - /* Dummy read to empty RXRHR. */ - ac97c_readl(atmel_wm97xx, CBRHR); - /* - * Enable interrupt for channel B in the AC97 - * controller. - */ - ac97c_writel(atmel_wm97xx, IER, AC97C_INT_CBEVT); - break; - default: - dev_err(&wm->touch_dev->dev, "pen down irq not " - "supported on this device\n"); - pen_int = 0; - break; - } - } - - return 0; -} - -static void atmel_wm97xx_acc_shutdown(struct wm97xx *wm) -{ - if (pen_int) { - struct atmel_wm97xx *atmel_wm97xx = - platform_get_drvdata(wm->touch_dev); - unsigned long ica; - - switch (wm->id & 0xffff) { - case WM9705_ID2: /* Fall through. */ - case WM9712_ID2: /* Fall through. */ - case WM9713_ID2: - /* Disable slot and turn off channel B interrupts. */ - ica = ac97c_readl(atmel_wm97xx, ICA); - ica &= ~AC97C_CH_MASK(wm->acc_slot); - ac97c_writel(atmel_wm97xx, ICA, ica); - ac97c_writel(atmel_wm97xx, IDR, AC97C_INT_CBEVT); - ac97c_writel(atmel_wm97xx, CBMR, 0); - wm->pen_irq = 0; - break; - default: - dev_err(&wm->touch_dev->dev, "unknown codec\n"); - break; - } - } -} - -static void atmel_wm97xx_irq_enable(struct wm97xx *wm, int enable) -{ - /* Intentionally left empty. */ -} - -static struct wm97xx_mach_ops atmel_mach_ops = { - .acc_enabled = 1, - .acc_pen_up = atmel_wm97xx_acc_pen_up, - .acc_startup = atmel_wm97xx_acc_startup, - .acc_shutdown = atmel_wm97xx_acc_shutdown, - .irq_enable = atmel_wm97xx_irq_enable, - .irq_gpio = WM97XX_GPIO_3, -}; - -static int __init atmel_wm97xx_probe(struct platform_device *pdev) -{ - struct wm97xx *wm = platform_get_drvdata(pdev); - struct atmel_wm97xx *atmel_wm97xx; - int ret; - - atmel_wm97xx = kzalloc(sizeof(struct atmel_wm97xx), GFP_KERNEL); - if (!atmel_wm97xx) - return -ENOMEM; - - atmel_wm97xx->wm = wm; - atmel_wm97xx->regs = (void *)ATMEL_WM97XX_AC97C_IOMEM; - atmel_wm97xx->ac97c_irq = ATMEL_WM97XX_AC97C_IRQ; - atmel_wm97xx->gpio_pen = atmel_gpio_line; - atmel_wm97xx->gpio_irq = gpio_to_irq(atmel_wm97xx->gpio_pen); - - timer_setup(&atmel_wm97xx->pen_timer, atmel_wm97xx_pen_timer, 0); - - ret = request_irq(atmel_wm97xx->ac97c_irq, - atmel_wm97xx_channel_b_interrupt, - IRQF_SHARED, "atmel-wm97xx-ch-b", atmel_wm97xx); - if (ret) { - dev_dbg(&pdev->dev, "could not request ac97c irq\n"); - goto err; - } - - platform_set_drvdata(pdev, atmel_wm97xx); - - ret = wm97xx_register_mach_ops(wm, &atmel_mach_ops); - if (ret) - goto err_irq; - - return ret; - -err_irq: - free_irq(atmel_wm97xx->ac97c_irq, atmel_wm97xx); -err: - kfree(atmel_wm97xx); - return ret; -} - -static int __exit atmel_wm97xx_remove(struct platform_device *pdev) -{ - struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); - struct wm97xx *wm = atmel_wm97xx->wm; - - ac97c_writel(atmel_wm97xx, IDR, AC97C_INT_CBEVT); - free_irq(atmel_wm97xx->ac97c_irq, atmel_wm97xx); - del_timer_sync(&atmel_wm97xx->pen_timer); - wm97xx_unregister_mach_ops(wm); - kfree(atmel_wm97xx); - - return 0; -} - -#ifdef CONFIG_PM_SLEEP -static int atmel_wm97xx_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); - - ac97c_writel(atmel_wm97xx, IDR, AC97C_INT_CBEVT); - disable_irq(atmel_wm97xx->gpio_irq); - del_timer_sync(&atmel_wm97xx->pen_timer); - - return 0; -} - -static int atmel_wm97xx_resume(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct atmel_wm97xx *atmel_wm97xx = platform_get_drvdata(pdev); - struct wm97xx *wm = atmel_wm97xx->wm; - - if (wm->input_dev->users) { - enable_irq(atmel_wm97xx->gpio_irq); - ac97c_writel(atmel_wm97xx, IER, AC97C_INT_CBEVT); - } - - return 0; -} -#endif - -static SIMPLE_DEV_PM_OPS(atmel_wm97xx_pm_ops, - atmel_wm97xx_suspend, atmel_wm97xx_resume); - -static struct platform_driver atmel_wm97xx_driver = { - .remove = __exit_p(atmel_wm97xx_remove), - .driver = { - .name = "wm97xx-touch", - .pm = &atmel_wm97xx_pm_ops, - }, -}; - -module_platform_driver_probe(atmel_wm97xx_driver, atmel_wm97xx_probe); - -MODULE_AUTHOR("Hans-Christian Egtvedt "); -MODULE_DESCRIPTION("wm97xx continuous touch driver for Atmel AT91 and AVR32"); -MODULE_LICENSE("GPL");