linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jeffrey Lin (林義章)" <Jeffrey.Lin@rad-ic.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"jeffrey.lin" <yajohn@gmail.com>
Cc: "rydberg@euromail.se" <rydberg@euromail.se>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"jeesw@melfas.com" <jeesw@melfas.com>,
	"bleung@chromium.org" <bleung@chromium.org>,
	"scott.liu@emc.com.tw" <scott.liu@emc.com.tw>,
	"Roger Yang (楊鎮瑋)" <Roger.Yang@rad-ic.com>,
	"KP Li (李昆倍)" <KP.Li@rad-ic.com>,
	"Albert Shieh (謝欣瑋)" <Albert.Shieh@rad-ic.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: RE: [PATCH] driver: input :touchscreen : add Raydium I2C touch driver
Date: Mon, 11 Apr 2016 09:57:21 +0000	[thread overview]
Message-ID: <9BE4B49389AB2F41A64A32DFC844F1DF73F1BDB8@RADHCMS5.corp.rad-ic.com> (raw)
In-Reply-To: <20160411082428.GA26066@dtor-ws>

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,林義章
瑞鼎科技
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 (林義章); Roger Yang (楊鎮瑋); KP Li (李昆倍); Albert Shieh (謝欣瑋); 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

  reply	other threads:[~2016-04-11 10:07 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25  5:21 [PATCH] driver: input :touchscreen : add Raydium I2C touch driver jeffrey.lin
2016-04-11  8:24 ` Dmitry Torokhov
2016-04-11  9:57   ` Jeffrey Lin (林義章) [this message]
2016-04-14  9:28   ` Jeffrey Lin (林義章)
  -- strict thread matches above, loose matches on Subject: below --
2016-05-24  9:05 jeffrey.lin
2016-05-17 15:34 jeffrey.lin
2016-05-11 13:51 jeffrey.lin
2016-04-29  9:45 jeffrey.lin
2016-05-04 22:58 ` Dmitry Torokhov
2016-05-06  8:24 ` jeffrey.lin
2016-05-11 16:04 ` jeffrey.lin
2016-05-13  4:18 ` Dmitry Torokhov
2016-05-13 17:08   ` jeffrey.lin
2016-05-16 15:46   ` jeffrey.lin
2016-05-16 16:41     ` Dmitry Torokhov
2016-05-16 16:43       ` Dmitry Torokhov
2016-05-16 15:57   ` jeffrey.lin
2016-05-17 16:07   ` jeffrey.lin
2016-05-21 18:18     ` Dmitry Torokhov
2016-05-22  9:32   ` jeffrey.lin
2016-05-22 22:37     ` Dmitry Torokhov
2016-05-22  9:35   ` jeffrey.lin
2016-05-23 14:43   ` jeffrey.lin
2016-05-23 16:27     ` Dmitry Torokhov
2016-05-24  9:31   ` jeffrey.lin
2016-05-27 16:34     ` Dmitry Torokhov
2016-04-22 10:01 dan.huang
2016-04-22 22:50 ` Dmitry Torokhov
2016-03-22  6:23 jeffrey.lin
2016-03-15  8:44 jeffrey.lin
2016-03-18 21:04 ` Rob Herring
2016-03-03  6:42 jeffrey.lin
2016-03-10 18:47 ` Dmitry Torokhov
2016-03-11  2:10   ` Jeffrey Lin (林義章)
2016-03-03  2:29 jeffrey.lin
2016-03-03  2:44 ` Joe Perches
2016-03-03  3:14   ` Jeffrey Lin (林義章)
2016-03-03  3:55     ` Joe Perches
2016-02-23  8:11 jeffrey.lin
2016-01-21  4:02 Jeffrey Lin
2016-01-21  9:37 ` Dmitry Torokhov
2016-01-15  3:30 Jeffrey Lin
2016-01-13  7:49 Jeffrey Lin
2016-01-13  8:31 ` Dmitry Torokhov
2016-01-13 19:14 ` Dmitry Torokhov
2016-01-13  6:23 Jeffrey Lin
2016-01-13  6:44 ` Dmitry Torokhov
2016-01-08 15:17 Jeffrey Lin
2016-01-09 19:20 ` Dmitry Torokhov
2015-01-06  9:25 jeffrey.lin
2015-01-06 19:43 ` Jeremiah Mahler
2015-01-07  0:40   ` Dmitry Torokhov
2014-12-08  3:42 jeffrey.lin
2014-12-05  8:15 jeffrey.lin
2014-12-05 15:04 ` Dmitry Torokhov
2014-11-14  7:19 jeffrey.lin
2014-11-14 17:43 ` Benson Leung
2014-11-14 18:00 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9BE4B49389AB2F41A64A32DFC844F1DF73F1BDB8@RADHCMS5.corp.rad-ic.com \
    --to=jeffrey.lin@rad-ic.com \
    --cc=Albert.Shieh@rad-ic.com \
    --cc=KP.Li@rad-ic.com \
    --cc=Roger.Yang@rad-ic.com \
    --cc=bleung@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=jeesw@melfas.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rydberg@euromail.se \
    --cc=scott.liu@emc.com.tw \
    --cc=yajohn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).