From patchwork Fri Jun 21 18:09:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerhard Sittig X-Patchwork-Id: 2763801 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76AC59F756 for ; Fri, 21 Jun 2013 18:12:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 71BB62012C for ; Fri, 21 Jun 2013 18:12:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D4FC201A2 for ; Fri, 21 Jun 2013 18:12:33 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq5o0-0006mX-RM; Fri, 21 Jun 2013 18:11:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq5nh-00026k-85; Fri, 21 Jun 2013 18:11:09 +0000 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uq5nM-00022I-3u for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2013 18:10:51 +0000 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3bcSc90Pr7z3hhcB; Fri, 21 Jun 2013 20:10:17 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3bcSc873n4zbbj9; Fri, 21 Jun 2013 20:10:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id HzOSMu5kadZE; Fri, 21 Jun 2013 20:10:15 +0200 (CEST) X-Auth-Info: W2iJbpf7t6vtEpWdFf/axCpeKjH0055RbqxPP/Qyf0I= Received: from localhost (kons-4d027c0a.pool.mediaWays.net [77.2.124.10]) by mail.mnet-online.de (Postfix) with ESMTPA; Fri, 21 Jun 2013 20:10:15 +0200 (CEST) From: Gerhard Sittig To: Dmitry Torokhov , linux-input@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Chao Xie Subject: [PATCH v1 03/12] input: matrix-keypad: rename variables and funcs Date: Fri, 21 Jun 2013 20:09:49 +0200 Message-Id: <1371838198-7327-4-git-send-email-gsi@denx.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371838198-7327-1-git-send-email-gsi@denx.de> References: <1371838198-7327-1-git-send-email-gsi@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130621_141049_003585_129B6C75 X-CRM114-Status: GOOD ( 13.66 ) X-Spam-Score: -1.9 (-) Cc: Eric Miao , Detlev Zundel , Arnd Bergmann , Tony Lindgren , Gerhard Sittig , Sekhar Nori , Haojian Zhuang , Marek Vasut , Ralf Baechle , Anatolij Gustschin X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 mechanical edits before code changes, to reduce diffs later on - rename the 'work' member of the driver's private data to better reflect that it's the work routine which scans the matrix after a change of status was detected - rename the __activate_col() routine to better reflect that it takes care of GPIO pins while its caller handles logical matrix lines Signed-off-by: Gerhard Sittig --- drivers/input/keyboard/matrix_keypad.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 71d7719..5b5f86d 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -35,7 +35,7 @@ struct matrix_keypad { DECLARE_BITMAP(disabled_gpios, MATRIX_MAX_ROWS); uint32_t last_key_state[MATRIX_MAX_COLS]; - struct delayed_work work; + struct delayed_work work_scan_matrix; spinlock_t lock; bool scan_pending; bool stopped; @@ -47,8 +47,8 @@ struct matrix_keypad { * minmal side effect when scanning other columns, here it is configured to * be input, and it should work on most platforms. */ -static void __activate_col(const struct matrix_keypad_platform_data *pdata, - int col, bool on) +static void __activate_col_pin(const struct matrix_keypad_platform_data *pdata, + int col, bool on) { bool level_on = !pdata->active_low; @@ -63,7 +63,7 @@ static void __activate_col(const struct matrix_keypad_platform_data *pdata, static void activate_col(const struct matrix_keypad_platform_data *pdata, int col, bool on) { - __activate_col(pdata, col, on); + __activate_col_pin(pdata, col, on); if (on && pdata->col_scan_delay_us) udelay(pdata->col_scan_delay_us); @@ -75,7 +75,7 @@ static void activate_all_cols(const struct matrix_keypad_platform_data *pdata, int col; for (col = 0; col < pdata->num_col_gpios; col++) - __activate_col(pdata, col, on); + __activate_col_pin(pdata, col, on); } static bool row_asserted(const struct matrix_keypad_platform_data *pdata, @@ -116,8 +116,8 @@ static void disable_row_irqs(struct matrix_keypad *keypad) */ static void matrix_keypad_scan(struct work_struct *work) { - struct matrix_keypad *keypad = - container_of(work, struct matrix_keypad, work.work); + struct matrix_keypad *keypad = container_of(work, struct matrix_keypad, + work_scan_matrix.work); struct input_dev *input_dev = keypad->input_dev; const unsigned short *keycodes = input_dev->keycode; const struct matrix_keypad_platform_data *pdata = keypad->pdata; @@ -189,8 +189,8 @@ static irqreturn_t matrix_keypad_interrupt(int irq, void *id) disable_row_irqs(keypad); keypad->scan_pending = true; - schedule_delayed_work(&keypad->work, - msecs_to_jiffies(keypad->pdata->debounce_ms)); + schedule_delayed_work(&keypad->work_scan_matrix, + msecs_to_jiffies(keypad->pdata->debounce_ms)); out: spin_unlock_irqrestore(&keypad->lock, flags); @@ -208,7 +208,7 @@ static int matrix_keypad_start(struct input_dev *dev) * Schedule an immediate key scan to capture current key state; * columns will be activated and IRQs be enabled after the scan. */ - schedule_delayed_work(&keypad->work, 0); + schedule_delayed_work(&keypad->work_scan_matrix, 0); return 0; } @@ -219,7 +219,7 @@ static void matrix_keypad_stop(struct input_dev *dev) keypad->stopped = true; mb(); - flush_work(&keypad->work.work); + flush_work(&keypad->work_scan_matrix.work); /* * matrix_keypad_scan() will leave IRQs enabled; * we should disable them now. @@ -495,7 +495,7 @@ static int matrix_keypad_probe(struct platform_device *pdev) keypad->pdata = pdata; keypad->row_shift = get_count_order(pdata->num_col_gpios); keypad->stopped = true; - INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); + INIT_DELAYED_WORK(&keypad->work_scan_matrix, matrix_keypad_scan); spin_lock_init(&keypad->lock); input_dev->name = pdev->name;