From: Jeremiah Mahler <jmmahler@gmail.com>
To: Dudley Du <dudl@cypress.com>
Cc: dmitry.torokhov@gmail.com, mark.rutland@arm.com,
robh+dt@kernel.org, rydberg@euromail.se, bleung@google.com,
devicetree@vger.kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] input: cyapa: add gen6 device module support in driver
Date: Fri, 12 Jun 2015 23:56:45 -0700 [thread overview]
Message-ID: <20150613065645.GB5808@hudson.localdomain> (raw)
In-Reply-To: <1434092198-13018-3-git-send-email-dudl@cypress.com>
Dudley,
A few more spelling errors...
On Fri, Jun 12, 2015 at 02:56:33PM +0800, Dudley Du wrote:
> Based on the cyapa core, add the gen6 trackpad device's basic functions
> supported, so gen6 trackpad device can work with kernel input system.
> And also based on the state parse interface, the cyapa driver can
> automatically determine the attached is gen3, gen5 or gen6 protocol
> trackpad device, then set the correct protocol to work with the attached
> trackpad device.
> TEST=test on Chromebook.
>
> Signed-off-by: Dudley Du <dudl@cypress.com>
> ---
> drivers/input/mouse/Makefile | 2 +-
> drivers/input/mouse/cyapa.c | 22 ++
> drivers/input/mouse/cyapa.h | 15 +
> drivers/input/mouse/cyapa_gen5.c | 69 +++-
> drivers/input/mouse/cyapa_gen6.c | 729 +++++++++++++++++++++++++++++++++++++++
[...]
> +static int cyapa_get_pip_fixed_info(struct cyapa *cyapa,
> + struct pip_fixed_info *pip_info, bool is_bootloader)
> +{
> + u8 resp_data[PIP_READ_SYS_INFO_RESP_LENGTH];
> + int resp_len;
> + u16 product_family;
> + int error;
> +
> + if (is_bootloader) {
> + /* Read Bootlaoder Inforamtion to determine Gen5 or Gen6. */
sp: ^^^^^^^^^^^
> + resp_len = sizeof(resp_data);
> + error = cyapa_i2c_pip_cmd_irq_sync(cyapa,
> + pip_get_bl_info, sizeof(pip_get_bl_info),
> + resp_data, &resp_len,
> + 2000, cyapa_sort_tsg_pip_bl_resp_data,
> + false);
[...]
> +
> + product_family = get_unaligned_le16(&resp_data[7]);
> + if ((product_family & PIP_PRODUCT_FAMILY_MASK) !=
> + PIP_PRODUCT_FAMILY_TRACKPAD)
> + return -EINVAL;
> +
> + pip_info->family_id = resp_data[19];
> + pip_info->silicon_id_low = resp_data[21];
> + pip_info->silicon_id_high = resp_data[22];
> +
> + return 0;
> +
> +}
Why the extra blank line?
> +
> +int cyapa_pip_state_parse(struct cyapa *cyapa, u8 *reg_data, int len)
> +{
> + u8 cmd[] = { 0x01, 0x00};
> + struct pip_fixed_info pip_info;
> + u8 resp_data[PIP_HID_DESCRIPTOR_SIZE];
> + int resp_len;
> + bool is_bootloader;
> + int error;
> +
> + cyapa->state = CYAPA_STATE_NO_DEVICE;
> +
> + /* Try to wake from it deep sleep state if it is. */
> + cyapa_pip_deep_sleep(cyapa, PIP_DEEP_SLEEP_STATE_ON);
> +
> + /* Empty the buffer queue to get fresh data with later commands. */
> + cyapa_empty_pip_output_data(cyapa, NULL, NULL, NULL);
[...]
> +static ssize_t cyapa_gen6_show_baseline(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct cyapa *cyapa = dev_get_drvdata(dev);
> + u8 data[GEN6_MAX_RX_NUM];
> + int data_len;
> + int size = 0;
> + int i;
> + int error;
> + int resume_error;
> +
> + if (!cyapa_is_pip_app_mode(cyapa))
> + return -EBUSY;
> +
> + /* 1. Suspend Scanning*/
space? ^^^
> + error = cyapa_pip_suspend_scanning(cyapa);
> + if (error)
> + return error;
> +
> + /* 2. IDAC and RX Attenuator Calibration Data (Center Frequency). */
> + data_len = sizeof(data);
> + error = cyapa_pip_reterive_data_structure(cyapa, 0, data_len,
> + GEN6_RETERIVE_DATA_ID_RX_ATTENURATOR_IDAC,
> + data, &data_len);
> + if (error)
> + goto resume_scanning;
> +
> + size = scnprintf(buf, PAGE_SIZE, "%d %d %d %d %d %d ",
> + data[0], /* RX Attenuator Mutal */
> + data[1], /* IDAC Mutual */
> + data[2], /* RX Attenuator Self RX */
> + data[3], /* IDAC Self RX */
> + data[4], /* RX Attenuator Self TX */
> + data[5] /* IDAC Self TX */
> + );
> +
> + /* 3. Read Attenuator Trim. */
> + data_len = sizeof(data);
> + error = cyapa_pip_reterive_data_structure(cyapa, 0, data_len,
> + GEN6_RETERIVE_DATA_ID_ATTENURATOR_TRIM,
> + data, &data_len);
> + if (error)
> + goto resume_scanning;
> +
> + /* set attenuator trim values. */
> + for (i = 0; i < data_len; i++)
> + size += scnprintf(buf + size, PAGE_SIZE - size, "%d ", data[i]);
> + size += scnprintf(buf + size, PAGE_SIZE - size, "\n");
> +
> +resume_scanning:
> + /* 4. Resume Scanning*/
space? ^^^
> + resume_error = cyapa_pip_resume_scanning(cyapa);
> + if (resume_error || error) {
> + memset(buf, 0, PAGE_SIZE);
> + return resume_error ? resume_error : error;
> + }
> +
> + return size;
> +}
> +
> +static int cyapa_gen6_operational_check(struct cyapa *cyapa)
> +{
> + struct device *dev = &cyapa->client->dev;
> + int error;
> +
> + if (cyapa->gen != CYAPA_GEN6)
> + return -ENODEV;
> +
> + switch (cyapa->state) {
> + case CYAPA_STATE_GEN6_BL:
> + error = cyapa_pip_bl_exit(cyapa);
> + if (error) {
> + /* Rry to update trackpad product information. */
sp: ^^^
> + cyapa_gen6_bl_read_app_info(cyapa);
> + goto out;
> + }
> +
> + cyapa->state = CYAPA_STATE_GEN6_APP;
> +
> + case CYAPA_STATE_GEN6_APP:
> + /*
> + * If trackpad device in deep sleep mode,
> + * the app command will fail.
> + * So always try to reset trackpad device to full active when
> + * the device state is requeried.
> + */
[...]
--
- Jeremiah Mahler
next prev parent reply other threads:[~2015-06-13 6:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-12 6:56 [PATCH 0/7] instruction of cyapa gen6 and proximity patches Dudley Du
[not found] ` <1434092198-13018-1-git-send-email-dudl-+wT8y+m8/X5BDgjK7y7TUQ@public.gmane.org>
2015-06-12 6:56 ` [PATCH 1/7] input: cyapa: change strings of gen5 to pip in the name when they are shared Dudley Du
2015-06-13 6:34 ` Jeremiah Mahler
2015-06-12 6:56 ` [PATCH 2/7] input: cyapa: add gen6 device module support in driver Dudley Du
2015-06-13 6:56 ` Jeremiah Mahler [this message]
2015-06-15 2:34 ` Dudley Du
2015-06-12 6:56 ` [PATCH 3/7] input: cyapa: add proximity function support for gen5 and gen6 modules Dudley Du
2015-06-12 6:56 ` [PATCH 4/7] input: cyapa: fully support runtime suspend power management Dudley Du
2015-06-12 6:56 ` [PATCH 5/7] input: cyapa: add proximity and interrupt sysfs interfaces support Dudley Du
2015-06-12 11:10 ` Dmitry Torokhov
2015-06-15 2:25 ` Dudley Du
2015-06-12 6:56 ` [PATCH 6/7] input: cyapa: add of match device support and description document Dudley Du
2015-06-13 3:53 ` Jeremiah Mahler
[not found] ` <20150613035358.GA18645-ZO/ZziT/ZXRSq9BJjBFyUp/QNRX+jHPU@public.gmane.org>
2015-06-15 2:31 ` Dudley Du
2015-06-12 6:56 ` [PATCH 7/7] input: cyapa: add CYAP0002 Gen6 device for ACPI configuration Dudley Du
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=20150613065645.GB5808@hudson.localdomain \
--to=jmmahler@gmail.com \
--cc=bleung@google.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dudl@cypress.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=rydberg@euromail.se \
/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