From patchwork Wed Jul 13 13:06:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 971712 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6DD6OUc028295 for ; Wed, 13 Jul 2011 13:07:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752839Ab1GMNHJ (ORCPT ); Wed, 13 Jul 2011 09:07:09 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:45433 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752833Ab1GMNHJ (ORCPT ); Wed, 13 Jul 2011 09:07:09 -0400 Received: by vws1 with SMTP id 1so4168436vws.19 for ; Wed, 13 Jul 2011 06:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=rH4+gvsXA6Vn5TzYfhSnOcFmVdBNT2woigQTI7v/mE4=; b=uPLWYOOZhIWCRw3xRTYh6iWlv4PtLNx96oOIOhA0GXLg3NlQKfAd6K/KlgW6RSlNDK /yMO+MxCbsfitLAEwoHzmtp2fYXbS9bhOoqT42c/GAgHhu10AY4vpDzkuoHwRtl8RXut XhHtYfBVZ6wiHJf5Crzc2M6ZDLpigAOcfzqnc= Received: by 10.220.6.135 with SMTP id 7mr291905vcz.201.1310562428027; Wed, 13 Jul 2011 06:07:08 -0700 (PDT) Received: from [218.172.235.36] (218-172-235-36.dynamic.hinet.net [218.172.235.36]) by mx.google.com with ESMTPS id n2sm2129279vcb.37.2011.07.13.06.07.05 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 06:07:07 -0700 (PDT) Subject: [PATCH] Input: cy8ctmg110_ts - set reset_pin and irq_pin from platform data From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Samuli Konttila , Dmitry Torokhov , Alan Cox , linux-input@vger.kernel.org Date: Wed, 13 Jul 2011 21:06:59 +0800 Message-ID: <1310562419.5753.2.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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]); Wed, 13 Jul 2011 13:07:11 +0000 (UTC) The implementation in cy8ctmg110_probe() does not properly set reset_pin and irq_pin from platform data. Let's fix it. Signed-off-by: Axel Lin --- Current implementation returns -ENODEV if no pdata available. But it does not use the information from pdata. I think currently the driver does not work because both ts->reset_pin and ts->irq_pin are 0, then gpio_request with ts->irq_pin will fail. Just found this bug while reading the code. I don't have this hardware. I appreciate if someone can test it. Axel drivers/input/touchscreen/cy8ctmg110_ts.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c index d7afa20..cd60b3c 100644 --- a/drivers/input/touchscreen/cy8ctmg110_ts.c +++ b/drivers/input/touchscreen/cy8ctmg110_ts.c @@ -193,6 +193,8 @@ static int __devinit cy8ctmg110_probe(struct i2c_client *client, ts->client = client; ts->input = input_dev; + ts->reset_pin = pdata->reset_pin; + ts->irq_pin = pdata->irq_pin; snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&client->dev));