From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine02.qualcomm.com ([199.106.114.251]:56470 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752943Ab0HGKpY (ORCPT ); Sat, 7 Aug 2010 06:45:24 -0400 Message-ID: <4C5D3926.6050307@codeaurora.org> Date: Sat, 07 Aug 2010 16:14:54 +0530 From: Trilok Soni MIME-Version: 1.0 Subject: Re: [PATCH 1/1] mouse: add qci touchpad driver References: <1281126776-20014-1-git-send-email-nleeder@codeaurora.org> In-Reply-To: <1281126776-20014-1-git-send-email-nleeder@codeaurora.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: Neil Leeder Cc: Dmitry Torokhov , linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Horace Fu , Mandeep Singh Baines Hi Neil, On 8/7/2010 2:02 AM, Neil Leeder wrote: > This driver is for the QCI trackpad used on Quanta smartbooks > > Review URL: http://codereview.chromium.org/724001 Do we need such URLs? > + > +/* > + * Driver communicates over i2c to nuvoTon WPCE775x Embedded Controller, > + * which has touchpad attached through PS/2 interface. > + */ Why this driver is not developed through MFD architecture then? nuvoTon chip looks like multi-function chip, isn't it? > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define TOUCHPAD_ID_NAME "qci-i2cpad" > +#define TOUCHPAD_NAME "QCI Touchpad" > +#define TOUCHPAD_DEVICE "/qci_touchpad/input0" > +#define TOUCHPAD_CMD_ENABLE 0xF4 > +#define TOUCHPAD_READ_DATA_LEN 3 > + > +struct i2ctpad_drv_data { > + struct i2c_client *ti2c_client; > + struct input_dev *qcitp_dev; > + unsigned int qcitp_gpio; > + unsigned int qcitp_irq; > + char ecdata[8]; > + bool opened; > +}; > + > + > +static const struct i2c_device_id qcitp_idtable[] = { > + { TOUCHPAD_ID_NAME, 0 }, This should be chip name instead of driver or ID name I think. > + > + err = gpio_request(context->qcitp_gpio, "qci-pad"); > + if (err) { > + pr_err("[QCI TouchPad] gpio request failed\n"); > + goto gpio_request_fail; > + } > + > + context->qcitp_irq = gpio_to_irq(context->qcitp_gpio); Please set the direction of the gpio as input, gpio_direction_input, even though gpios are coming as input by default. > + > +static int __devexit qcitp_remove(struct i2c_client *client) > +{ > + struct i2ctpad_drv_data *context = i2c_get_clientdata(client); > + > + free_irq(context->qcitp_irq, context); > + gpio_free(context->qcitp_gpio); > + input_unregister_device(context->qcitp_dev); > + i2c_set_clientdata(client, NULL); Not required in latest kernels. ---Trilok Soni -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.