lkml.org 
[lkml]   [2014]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v13 10/12] input: cyapa: add gen5 trackpad device read baseline function support
Dudley,

On Tue, Dec 09, 2014 at 05:11:42PM +0800, Dudley Du wrote:
> Add read baseline function supported for gen5 trackpad device,
> it can be used through sysfs baseline interface.
> TEST=test on Chromebooks.
>
> Signed-off-by: Dudley Du <dudley.dulixin@gmail.com>
> ---
[...]
> return 0;
> }
>
> +static int cyapa_gen5_resume_scanning(struct cyapa *cyapa)
> +{
> + u8 cmd[7] = { 0x04, 0x00, 0x05, 0x00, 0x2f, 0x00, 0x04 };
> + u8 resp_data[6];
> + int resp_len;
> + int error;
> +
> + /* Try to dump all bufferred data before doing command. */
^^^^^^^^^
buffered

And there are three more below.

> + cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);
> +
> + resp_len = 6;
> + error = cyapa_i2c_pip_cmd_irq_sync(cyapa,
> + cmd, 7,
> + resp_data, &resp_len,
> + 500, cyapa_gen5_sort_tsg_pip_app_resp_data, true);
> + if (error || !VALID_CMD_RESP_HEADER(resp_data, 0x04))
> + return -EINVAL;
> +
> + /* Try to dump all bufferred data when resuming scanning. */
> + cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);
> +
> + return 0;
> +}
> +
> +static int cyapa_gen5_suspend_scanning(struct cyapa *cyapa)
> +{
> + u8 cmd[7] = { 0x04, 0x00, 0x05, 0x00, 0x2f, 0x00, 0x03 };
> + u8 resp_data[6];
> + int resp_len;
> + int error;
> +
> + /* Try to dump all bufferred data before doing command. */
> + cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);
> +
> + resp_len = 6;
> + error = cyapa_i2c_pip_cmd_irq_sync(cyapa,
> + cmd, 7,
> + resp_data, &resp_len,
> + 500, cyapa_gen5_sort_tsg_pip_app_resp_data, true);
> + if (error || !VALID_CMD_RESP_HEADER(resp_data, 0x03))
> + return -EINVAL;
> +
> + /* Try to dump all bufferred data when suspending scanning. */
> + cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);
> +
> + return 0;
> +}
> +
[...]

--
- Jeremiah Mahler


\
 
 \ /
  Last update: 2014-12-10 05:41    [W:0.124 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site