From patchwork Tue Nov 9 02:15:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jooaun X-Patchwork-Id: 309982 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 oA92G8VF031966 for ; Tue, 9 Nov 2010 02:16:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752370Ab0KICP6 (ORCPT ); Mon, 8 Nov 2010 21:15:58 -0500 Received: from mail-yx0-f174.google.com ([209.85.213.174]:64206 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752148Ab0KICP5 (ORCPT ); Mon, 8 Nov 2010 21:15:57 -0500 Received: by yxk8 with SMTP id 8so3945261yxk.19 for ; Mon, 08 Nov 2010 18:15:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=rkyKgEm3fkA7+t3/6jWX+ISUwb8akNIsnpxE1hcyxTQ=; b=MYNO/c1ecRYdLSsrNNTKM3hKzXd5NMMLH2kHkVRXSmHTMCC1sp8JtgVOfFt3/fMwRg Gt4twykAWrP6CnhBkdgeFw1cP7RUvBS+DO9ueFy2lA/rojPr5PgMCIk4SMgNVkc1oi3X sjajFFmQm7Yn86oafwcuWHp7yk6ClOxMDjkCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=dLxSbtMSM8zdsGR2aF7ZdsliCP7sj8zl9K5VM2OzlnNQ9dOVO1uu1oz0VbppihghaE LMLqT9Po41xKNL1RFjkMgQf9CHki6ClSPTnBlT7/kHxKbulvuDAFdDggEbCCPI8l9b/x khW+D26+hefE3YkpbViFWUTkdikyijGqg7FMo= Received: by 10.151.7.5 with SMTP id k5mr9786042ybi.152.1289268956976; Mon, 08 Nov 2010 18:15:56 -0800 (PST) Received: from localhost.localdomain (203-206-227-95.perm.iinet.net.au [203.206.227.95]) by mx.google.com with ESMTPS id j27sm449455yha.30.2010.11.08.18.15.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 18:15:56 -0800 (PST) From: jooaun To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, raphaelpereira@gmail.com, jooaun Subject: [PATCH 5/8] qt2160: fix starting of device calibration Date: Tue, 9 Nov 2010 13:15:08 +1100 Message-Id: <1289268911-32322-5-git-send-email-jasaw81@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1289268911-32322-1-git-send-email-jasaw81@gmail.com> References: <1289268911-32322-1-git-send-email-jasaw81@gmail.com> 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 09 Nov 2010 02:16:09 +0000 (UTC) diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 0d662e2..7647849 100755 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -264,27 +264,6 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg) return ret; } -static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) -{ - int error; - - error = i2c_smbus_write_byte(client, reg); - if (error) { - dev_err(&client->dev, - "couldn't send request. Returned %d\n", error); - return error; - } - - error = i2c_smbus_write_byte(client, data); - if (error) { - dev_err(&client->dev, - "couldn't write data. Returned %d\n", error); - return error; - } - - return error; -} - static int __devinit qt2160_configure_device(struct i2c_client *client, struct qt2160_data *qt2160) { @@ -489,7 +468,7 @@ static int __devinit qt2160_probe(struct i2c_client *client, } /* Calibrate device */ - error = qt2160_write(client, QT2160_CMD_CALIBRATE, 1); + error = i2c_smbus_write_byte_data(client, QT2160_CMD_CALIBRATE, 1); if (error) { dev_err(&client->dev, "failed to calibrate device\n"); goto err_free_mem;