Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752104AbcDKKHK (ORCPT ); Mon, 11 Apr 2016 06:07:10 -0400 Received: from 219-80-251-50.static.tfn.net.tw ([219.80.251.50]:22748 "EHLO mse2.corp.rad-ic.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750839AbcDKKHI (ORCPT ); Mon, 11 Apr 2016 06:07:08 -0400 X-Greylist: delayed 463 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Apr 2016 06:07:07 EDT From: =?big5?B?SmVmZnJleSBMaW4gKKpMuHGzuSk=?= To: Dmitry Torokhov , "jeffrey.lin" CC: "rydberg@euromail.se" , "grant.likely@linaro.org" , "robh+dt@kernel.org" , "jeesw@melfas.com" , "bleung@chromium.org" , "scott.liu@emc.com.tw" , =?big5?B?Um9nZXIgWWFuZyAot6jC7d6zKQ==?= , =?big5?B?S1AgTGkgKKf1qfitvyk=?= , =?big5?B?QWxiZXJ0IFNoaWVoICjBwqpZ3rMp?= , "linux-kernel@vger.kernel.org" , "linux-input@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: RE: [PATCH] driver: input :touchscreen : add Raydium I2C touch driver Thread-Topic: [PATCH] driver: input :touchscreen : add Raydium I2C touch driver Thread-Index: AQHRk8ua8QZtoVMaEkmdxsrfDiizBZ+EgJig Date: Mon, 11 Apr 2016 09:57:21 +0000 Message-ID: <9BE4B49389AB2F41A64A32DFC844F1DF73F1BDB8@RADHCMS5.corp.rad-ic.com> References: <1458883269-3218-1-git-send-email-jeffrey.lin@rad-ic.com> <20160411082428.GA26066@dtor-ws> In-Reply-To: <20160411082428.GA26066@dtor-ws> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.16.126] Content-Type: text/plain; charset="big5" MIME-Version: 1.0 X-MAIL: mse2.corp.rad-ic.com u3B9vOL7083528 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u3BA7KqT000830 Content-Length: 2640 Lines: 76 Hi Dmitry: Thank you for your response. Actually, we didn't implement FW update function on the chromeos device, we just copy function from our previous android device. I'll fix that on the next version. Raydium controller doesn't have access bytes limit, but my previous android experimental device had 60 bytes limit. About reformatting command structure, do you want me to reform all my commands as you said in the mail or just in case of fw update function? If not just in case of FW update, it's better to meet maximum buffer size, like "MAX_PACKET_SIZE". Best Regards ---------------------------------------------------------------------- Jeffrey Lin,?L?q?? ?繩???? Raydium Semiconductor Corporation Tel:(03)666-1818 Ext.4163 Fax:(03)666-1919 -----Original Message----- From: Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com] Sent: Monday, April 11, 2016 4:24 PM To: jeffrey.lin Cc: rydberg@euromail.se; grant.likely@linaro.org; robh+dt@kernel.org; jeesw@melfas.com; bleung@chromium.org; scott.liu@emc.com.tw; Jeffrey Lin (?L?q??); Roger Yang (????޳); KP Li (??????); Albert Shieh (?ªY޳); linux-kernel@vger.kernel.org; linux-input@vger.kernel.org; devicetree@vger.kernel.org Subject: Re: [PATCH] driver: input :touchscreen : add Raydium I2C touch driver Hi Jeffrey, On Fri, Mar 25, 2016 at 01:21:09PM +0800, jeffrey.lin wrote: > +#define MAX_PACKET_SIZE 60 ... > +#define RAYDIUM_FW_PAGESIZE 128 ... > + > +static int raydium_i2c_send(struct i2c_client *client, > + u8 addr, u8 *data, size_t len) > +{ > + u8 buf[MAX_PACKET_SIZE + 1]; > + int tries = 0; > + > + if (len > MAX_PACKET_SIZE) > + return -EINVAL; ... > +static int raydium_i2c_fw_write_page(struct i2c_client *client, > + const void *page) > +{ > + static const u8 ack_ok[] = { 0x55, 0xAA }; > + u8 buf[2]; > + int retry; > + int error; > + > + for (retry = 0; retry < MAX_FW_UPDATE_RETRIES; retry++) { > + error = raydium_i2c_send(client, CMD_BOOT_WRT, > + (u8 *)page, RAYDIUM_FW_PAGESIZE); > + if (error) { > + dev_err(&client->dev, > + "BLDR Write Page failed: %d\n", error); > + continue; > + } Given the above definitions of MAX_PACKET_SIZE and RAYDIUM_FW_PAGESIZE I do not believe that firmware update is working. What is the biggest buffer that can be sent to the device? Maybe we should allocate it dynamically? I am also wondering about formatting command structure as byte sequence. Would it be better to define it as: struct raidium_cmd { u32 bank; int len; u8 cmd[RAIDIUM_MAX_CMD_LEN]; } What is the longest command that the controller supports? (Do not resubmit the driver yet, let's discuss first). Thanks. -- Dmitry