From patchwork Thu Feb 6 02:15:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Heiny X-Patchwork-Id: 3592651 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BFF2FC02DC for ; Thu, 6 Feb 2014 02:16:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2043C2012F for ; Thu, 6 Feb 2014 02:16:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF396200F3 for ; Thu, 6 Feb 2014 02:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbaBFCQP (ORCPT ); Wed, 5 Feb 2014 21:16:15 -0500 Received: from us-mx2.synaptics.com ([192.147.44.131]:40288 "EHLO us-mx2.synaptics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529AbaBFCQO (ORCPT ); Wed, 5 Feb 2014 21:16:14 -0500 Received: from unknown (HELO securemail.synaptics.com) ([172.20.21.135]) by us-mx2.synaptics.com with ESMTP; 05 Feb 2014 18:16:10 -0800 Received: from USW-OWA1.synaptics-inc.local ([10.20.24.16]) by securemail.synaptics.com (PGP Universal service); Wed, 05 Feb 2014 18:03:58 -0800 X-PGP-Universal: processed; by securemail.synaptics.com on Wed, 05 Feb 2014 18:03:58 -0800 Received: from brontomerus.synaptics.com (10.3.20.103) by USW-OWA1.synaptics-inc.local (10.20.24.15) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 5 Feb 2014 18:16:29 -0800 From: Christopher Heiny To: Dmitry Torokhov CC: Linux Input , Christopher Heiny , Andrew Duggan , Vincent Huang , Vivian Ly , Daniel Rosenberg , Jean Delvare , Joerie de Gram , Linus Walleij , Benjamin Tissoires , David Herrmann , Jiri Kosina Subject: [PATCH] input synaptics-rmi4: rmi_driver.c tidying Date: Wed, 5 Feb 2014 18:15:49 -0800 Message-ID: <1391652949-21083-1-git-send-email-cheiny@synaptics.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.3.20.103] X-Brightmail-Tracker: AAAAAQAAAWE= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove pdt_mutex, since it's no longer needed. Remove obsolete comment in rmi_drive_irq_save(). Fix some operator spacing (or lack thereof) in rmi_drive_irq_save(). Remove XXX comment about F01 ordering. New structure doesn't require F01 to be first. Signed-off-by: Christopher Heiny Cc: Dmitry Torokhov Cc: Benjamin Tissoires Cc: Linux Walleij Cc: David Herrmann Cc: Jiri Kosina --- drivers/input/rmi4/rmi_driver.c | 24 ++---------------------- drivers/input/rmi4/rmi_driver.h | 1 - 2 files changed, 2 insertions(+), 23 deletions(-) -- 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 diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c index 96bb47d..2943b2c4 100644 --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -347,21 +347,15 @@ static int rmi_driver_irq_save(struct rmi_device *rmi_dev, if (!data->irq_stored) { /* Save current enabled interrupts */ retval = rmi_read_block(rmi_dev, - data->f01_container->fd.control_base_addr+1, + data->f01_container->fd.control_base_addr + 1, data->irq_mask_store, data->num_of_irq_regs); if (retval < 0) { dev_err(dev, "%s: Failed to read enabled interrupts!", __func__); goto error_unlock; } - /* - * Disable every interrupt except for function 54 - * TODO:Will also want to not disable function 1-like functions. - * No need to take care of this now, since there's no good way - * to identify them. - */ retval = rmi_write_block(rmi_dev, - data->f01_container->fd.control_base_addr+1, + data->f01_container->fd.control_base_addr + 1, new_ints, data->num_of_irq_regs); if (retval < 0) { dev_err(dev, "%s: Failed to change enabled interrupts!", @@ -562,24 +556,15 @@ static int rmi_scan_pdt(struct rmi_device *rmi_dev, void *ctx, void *ctx, const struct pdt_entry *entry)) { - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev); int page; int retval = RMI_SCAN_DONE; - /* - * TODO: With F01 and reflash as part of the core now, is this - * lock still required? - */ - mutex_lock(&data->pdt_mutex); - for (page = 0; page <= RMI4_MAX_PAGE; page++) { retval = rmi_scan_pdt_page(rmi_dev, page, ctx, callback); if (retval != RMI_SCAN_CONTINUE) break; } - mutex_unlock(&data->pdt_mutex); - return retval < 0 ? retval : 0; } @@ -829,7 +814,6 @@ static int rmi_driver_probe(struct device *dev) INIT_LIST_HEAD(&data->function_list); data->rmi_dev = rmi_dev; dev_set_drvdata(&rmi_dev->dev, data); - mutex_init(&data->pdt_mutex); /* * Right before a warm boot, the sensor might be in some unusual state, @@ -897,10 +881,6 @@ static int rmi_driver_probe(struct device *dev) data->current_irq_mask = irq_memory + size * 2; data->irq_mask_store = irq_memory + size * 3; - /* - * XXX need to make sure we create F01 first... - * XXX or do we? It might not be required in the updated structure. - */ irq_count = 0; dev_dbg(dev, "Creating functions."); retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function); diff --git a/drivers/input/rmi4/rmi_driver.h b/drivers/input/rmi4/rmi_driver.h index d071ff5..a22a4e6 100644 --- a/drivers/input/rmi4/rmi_driver.h +++ b/drivers/input/rmi4/rmi_driver.h @@ -56,7 +56,6 @@ struct rmi_driver_data { struct work_struct poll_work; ktime_t poll_interval; - struct mutex pdt_mutex; u8 pdt_props; u8 bsr;