devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: "jeffrey.lin" <yajohn@gmail.com>
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@rad-ic.com, roger.yang@rad-ic.com, KP.li@rad-ic.com,
	albert.shieh@rad-ic.com, 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
Date: Mon, 11 Apr 2016 01:24:28 -0700	[thread overview]
Message-ID: <20160411082428.GA26066@dtor-ws> (raw)
In-Reply-To: <1458883269-3218-1-git-send-email-jeffrey.lin@rad-ic.com>

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  8:24 UTC|newest]

Thread overview: 42+ 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 [this message]
2016-04-11  9:57   ` Jeffrey Lin (林義章)
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-05 10:23   ` Jeffrey Lin (林義章)
2016-05-05 10:25   ` Jeffrey Lin (林義章)
2016-05-06  8:24 ` jeffrey.lin
2016-05-11 16:04 ` jeffrey.lin
     [not found] ` <1461923113-426-1-git-send-email-jeffrey.lin-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
2016-05-13  4:18   ` Dmitry Torokhov
2016-05-13 17:08     ` jeffrey.lin
2016-05-16 15:46     ` jeffrey.lin
     [not found]       ` <1463413611-367-1-git-send-email-jeffrey.lin-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
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
     [not found]       ` <1463501223-20723-1-git-send-email-jeffrey.lin-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
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
     [not found]       ` <1464014633-20829-1-git-send-email-jeffrey.lin-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
2016-05-23 16:27         ` Dmitry Torokhov
2016-05-24  9:31     ` jeffrey.lin
     [not found]       ` <1464082301-11539-1-git-send-email-jeffrey.lin-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
2016-05-27 16:34         ` Dmitry Torokhov
2016-04-22 10:01 dan.huang
     [not found] ` <1461319268-362-1-git-send-email-dan.huang-s3Ivl27awEzQT0dZR+AlfA@public.gmane.org>
2016-04-22 22:50   ` Dmitry Torokhov
2016-04-25  2:48     ` yajohn lin
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

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=20160411082428.GA26066@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=KP.li@rad-ic.com \
    --cc=albert.shieh@rad-ic.com \
    --cc=bleung@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jeesw@melfas.com \
    --cc=jeffrey.lin@rad-ic.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=roger.yang@rad-ic.com \
    --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).