From patchwork Sun Apr 10 15:26:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 696621 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3AFQN3R006298 for ; Sun, 10 Apr 2011 15:26:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754036Ab1DJP0X (ORCPT ); Sun, 10 Apr 2011 11:26:23 -0400 Received: from jessica.hrz.tu-chemnitz.de ([134.109.132.47]:44441 "EHLO jessica.hrz.tu-chemnitz.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753995Ab1DJP0W (ORCPT ); Sun, 10 Apr 2011 11:26:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-chemnitz.de; s=dkim2010; h=Message-Id:Date:Subject:Cc:To:From; bh=0POvblnAxyL33LF+LJADMXsw9pkYuu+qZil87aV7jzc=; b=RmL0dhrm2Xy8qMgClsP61DrV6+lfU9xkqH3FVled3117DMWhMad8GyWt5WVwBwfBO3ABmg0ttUkOtjJ3AHXB5oB82fdkmdJK9YLdMDMi8powtFaZzhr0IvUrhWVnM706CTESRcPTisbr5+CLY+ajqTu3bbBNEgAYoEngnfsHrLE=; Received: from 77-64-193-225.dynamic.primacom.net ([77.64.193.225] helo=kongar.lan.local) by jessica.hrz.tu-chemnitz.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.74) (envelope-from ) id 1Q8wWq-00055p-Rk; Sun, 10 Apr 2011 17:26:21 +0200 From: Alexander Stein To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Alexander Stein Subject: [PATCH] gpio-keys: Add input device name support Date: Sun, 10 Apr 2011 17:26:26 +0200 Message-Id: <1302449186-20441-1-git-send-email-alexander.stein@informatik.tu-chemnitz.de> X-Mailer: git-send-email 1.7.4.1 X-Spam-Score: -0.9 (/) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-0.9 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.1 TVD_RCVD_IP TVD_RCVD_IP --- Ende Textanalyse X-Scan-Signature: cb5add96829c288e5da73fa3a8e2275c Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 10 Apr 2011 15:26:23 +0000 (UTC) This patch allows to set a device name which helps distinguishing several gpio-keys devices. Signed-off-by: Alexander Stein --- drivers/input/keyboard/gpio_keys.c | 2 +- include/linux/gpio_keys.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index f319884..3a923b3 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -473,7 +473,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ddata); input_set_drvdata(input, ddata); - input->name = pdev->name; + input->name = pdata->name ? : pdev->name; input->phys = "gpio-keys/input0"; input->dev.parent = &pdev->dev; input->open = gpio_keys_open; diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index c09d7fb..cedc39f 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h @@ -22,6 +22,7 @@ struct gpio_keys_platform_data { unsigned int rep:1; /* enable input subsystem auto repeat */ int (*enable)(struct device *dev); void (*disable)(struct device *dev); + char *name; /* input device name */ }; #endif