From: Andreas Kemnade <andreas@kemnade.info>
To: Alistair Francis <alistair@alistair23.me>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
mylene.josserand@free-electrons.com, linus.walleij@linaro.org,
rydberg@bitmath.org, dmitry.torokhov@gmail.com,
robh+dt@kernel.org, alistair23@gmail.com,
"Mylène Josserand" <mylene.josserand@bootlin.com>,
"Maxime Ripard" <maxime.ripard@bootlin.com>
Subject: Re: [PATCH v2 1/4] Input: Add driver for Cypress Generation 5 touchscreen
Date: Fri, 5 Nov 2021 16:01:51 +0100 [thread overview]
Message-ID: <20211105160151.4d97d587@aktux> (raw)
In-Reply-To: <20211103114830.62711-2-alistair@alistair23.me>
On Wed, 3 Nov 2021 21:48:27 +1000
Alistair Francis <alistair@alistair23.me> wrote:
[...]
> +static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> + const char *name)
> +{
> + struct cyttsp5 *ts;
> + struct cyttsp5_sysinfo *si;
> + int rc = 0, i;
> +
> + ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
> + if (!ts)
> + return -ENOMEM;
> +
> + /* Initialize device info */
> + ts->regmap = regmap;
> + ts->dev = dev;
> + si = &ts->sysinfo;
> + dev_set_drvdata(dev, ts);
> +
> + /* Initialize mutexes and spinlocks */
> + mutex_init(&ts->system_lock);
> +
> + /* Initialize wait queue */
> + init_waitqueue_head(&ts->wait_q);
> +
> + /* Power up the device */
> + ts->vdd = regulator_get(dev, "vdd");
> + if (IS_ERR(ts->vdd)) {
> + rc = PTR_ERR(ts->vdd);
> + dev_set_drvdata(dev, NULL);
> + kfree(ts);
> + return rc;
> + }
> +
> + rc = regulator_enable(ts->vdd);
> + if (rc) {
> + regulator_put(ts->vdd);
> + dev_set_drvdata(dev, NULL);
> + kfree(ts);
> + return rc;
> + }
> +
> + /* Reset the gpio to be in a reset state */
> + ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
so we deassert reset for
> + if (IS_ERR(ts->reset_gpio)) {
> + rc = PTR_ERR(ts->reset_gpio);
> + dev_err(dev, "Failed to request reset gpio, error %d\n", rc);
> + return rc;
> + }
almost no time
> + gpiod_set_value(ts->reset_gpio, 1);
and then assert it, keeping the chip in reset
> +
> + /* Need a delay to have device up */
> + msleep(20);
> +
and why it should wake up?
I reversed the logic here to test. I have
reset-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
in my tests.
> + rc = devm_request_threaded_irq(dev, irq, NULL, cyttsp5_handle_irq,
> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + name, ts);
falling or level low (according to the example in the
dt schema)?
Regards,
Andreas
WARNING: multiple messages have this Message-ID (diff)
From: Andreas Kemnade <andreas@kemnade.info>
To: Alistair Francis <alistair@alistair23.me>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
mylene.josserand@free-electrons.com, linus.walleij@linaro.org,
rydberg@bitmath.org, dmitry.torokhov@gmail.com,
robh+dt@kernel.org, alistair23@gmail.com,
"Mylène Josserand" <mylene.josserand@bootlin.com>,
"Maxime Ripard" <maxime.ripard@bootlin.com>
Subject: Re: [PATCH v2 1/4] Input: Add driver for Cypress Generation 5 touchscreen
Date: Fri, 5 Nov 2021 16:01:51 +0100 [thread overview]
Message-ID: <20211105160151.4d97d587@aktux> (raw)
In-Reply-To: <20211103114830.62711-2-alistair@alistair23.me>
On Wed, 3 Nov 2021 21:48:27 +1000
Alistair Francis <alistair@alistair23.me> wrote:
[...]
> +static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
> + const char *name)
> +{
> + struct cyttsp5 *ts;
> + struct cyttsp5_sysinfo *si;
> + int rc = 0, i;
> +
> + ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL);
> + if (!ts)
> + return -ENOMEM;
> +
> + /* Initialize device info */
> + ts->regmap = regmap;
> + ts->dev = dev;
> + si = &ts->sysinfo;
> + dev_set_drvdata(dev, ts);
> +
> + /* Initialize mutexes and spinlocks */
> + mutex_init(&ts->system_lock);
> +
> + /* Initialize wait queue */
> + init_waitqueue_head(&ts->wait_q);
> +
> + /* Power up the device */
> + ts->vdd = regulator_get(dev, "vdd");
> + if (IS_ERR(ts->vdd)) {
> + rc = PTR_ERR(ts->vdd);
> + dev_set_drvdata(dev, NULL);
> + kfree(ts);
> + return rc;
> + }
> +
> + rc = regulator_enable(ts->vdd);
> + if (rc) {
> + regulator_put(ts->vdd);
> + dev_set_drvdata(dev, NULL);
> + kfree(ts);
> + return rc;
> + }
> +
> + /* Reset the gpio to be in a reset state */
> + ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
so we deassert reset for
> + if (IS_ERR(ts->reset_gpio)) {
> + rc = PTR_ERR(ts->reset_gpio);
> + dev_err(dev, "Failed to request reset gpio, error %d\n", rc);
> + return rc;
> + }
almost no time
> + gpiod_set_value(ts->reset_gpio, 1);
and then assert it, keeping the chip in reset
> +
> + /* Need a delay to have device up */
> + msleep(20);
> +
and why it should wake up?
I reversed the logic here to test. I have
reset-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
in my tests.
> + rc = devm_request_threaded_irq(dev, irq, NULL, cyttsp5_handle_irq,
> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + name, ts);
falling or level low (according to the example in the
dt schema)?
Regards,
Andreas
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-11-05 15:01 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 11:48 [PATCH v2 0/4] Add support for the Cypress cyttsp5 Alistair Francis
2021-11-03 11:48 ` Alistair Francis
2021-11-03 11:48 ` [PATCH v2 1/4] Input: Add driver for Cypress Generation 5 touchscreen Alistair Francis
2021-11-03 11:48 ` Alistair Francis
2021-11-05 15:01 ` Andreas Kemnade [this message]
2021-11-05 15:01 ` Andreas Kemnade
2021-11-06 6:47 ` Dmitry Torokhov
2021-11-06 6:47 ` Dmitry Torokhov
2021-12-01 12:27 ` Alistair Francis
2021-12-01 12:27 ` Alistair Francis
2021-12-13 5:45 ` Dmitry Torokhov
2021-12-13 5:45 ` Dmitry Torokhov
2021-12-13 18:49 ` Andreas Kemnade
2021-12-13 18:49 ` Andreas Kemnade
2021-12-18 22:18 ` Andreas Kemnade
2021-12-18 22:18 ` Andreas Kemnade
2021-12-21 23:28 ` Alistair Francis
2021-12-21 23:28 ` Alistair Francis
2021-12-23 13:47 ` Andy Shevchenko
2021-12-23 13:47 ` Andy Shevchenko
2021-11-03 11:48 ` [PATCH v2 2/4] Documentation: DT: bindings: input: Add documentation for cyttsp5 Alistair Francis
2021-11-03 11:48 ` Alistair Francis
2021-11-03 23:07 ` Rob Herring
2021-11-03 23:07 ` Rob Herring
2021-11-05 14:21 ` Andreas Kemnade
2021-11-05 14:21 ` Andreas Kemnade
2021-11-10 12:59 ` Alistair Francis
2021-11-10 12:59 ` Alistair Francis
2021-11-10 17:36 ` Andreas Kemnade
2021-11-10 17:36 ` Andreas Kemnade
2021-11-11 15:16 ` Linus Walleij
2021-11-11 15:16 ` Linus Walleij
2021-11-18 12:51 ` Alistair Francis
2021-11-18 12:51 ` Alistair Francis
2021-11-03 11:48 ` [PATCH v2 3/4] ARM: imx_v6_v7_defconfig: Enable the cyttsp5 touchscreen Alistair Francis
2021-11-03 11:48 ` Alistair Francis
2021-11-03 11:48 ` [PATCH v2 4/4] ARM: dts: imx7d: remarkable2: Enable the cyttsp5 Alistair Francis
2021-11-03 11:48 ` Alistair Francis
2021-11-06 2:25 ` Dmitry Torokhov
2021-11-06 2:25 ` Dmitry Torokhov
2021-11-05 14:52 ` [PATCH v2 0/4] Add support for the Cypress cyttsp5 Andreas Kemnade
2021-11-05 14:52 ` Andreas Kemnade
2021-11-25 9:44 ` Alistair Francis
2021-11-25 9:44 ` Alistair Francis
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=20211105160151.4d97d587@aktux \
--to=andreas@kemnade.info \
--cc=alistair23@gmail.com \
--cc=alistair@alistair23.me \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mylene.josserand@bootlin.com \
--cc=mylene.josserand@free-electrons.com \
--cc=robh+dt@kernel.org \
--cc=rydberg@bitmath.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.