[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DBVG9ID1KS59.27QTXCZOWJVNM@linaro.org>
Date: Wed, 06 Aug 2025 16:28:54 +0100
From: "Alexey Klimov" <alexey.klimov@...aro.org>
To: "Griffin Kroah-Hartman" <griffin.kroah@...rphone.com>, "Dmitry Torokhov"
<dmitry.torokhov@...il.com>, "Rob Herring" <robh@...nel.org>, "Krzysztof
Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley" <conor+dt@...nel.org>,
"Bjorn Andersson" <andersson@...nel.org>, "Konrad Dybcio"
<konradybcio@...nel.org>, "Luca Weiss" <luca.weiss@...rphone.com>
Cc: <linux-input@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH 2/3] Input: aw86927 - add driver for Awinic AW86927
Hi Griffin,
On Wed Aug 6, 2025 at 4:10 PM BST, Griffin Kroah-Hartman wrote:
> Add support for the I2C-connected Awinic AW86927 LRA haptic driver.
>
> This driver includes a hardcoded sine waveform to be uploaded to the
> AW86927's SRAM for haptic playback.
> This driver does not currently support all the capabilities of the
> AW86927, such as F0 calibration, RTP mode, and CONT mode.
>
> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@...rphone.com>
> ---
> drivers/input/misc/Kconfig | 11 +
> drivers/input/misc/Makefile | 1 +
> drivers/input/misc/aw86927.c | 841 +++++++++++++++++++++++++++++++++++++++++++
[...]
> +static int aw86927_probe(struct i2c_client *client)
> +{
> + struct aw86927_data *haptics;
> + unsigned int read_buf;
> + int err;
> +
> + haptics = devm_kzalloc(&client->dev, sizeof(struct aw86927_data), GFP_KERNEL);
> + if (!haptics)
> + return -ENOMEM;
> +
> + haptics->dev = &client->dev;
> + haptics->client = client;
> +
> + i2c_set_clientdata(client, haptics);
> + dev_set_drvdata(&client->dev, haptics);
> +
> + haptics->regmap = devm_regmap_init_i2c(client, &aw86927_regmap_config);
> + if (IS_ERR(haptics->regmap))
> + return dev_err_probe(haptics->dev, PTR_ERR(haptics->regmap),
> + "Failed to allocate register map\n");
> +
> + haptics->input_dev = devm_input_allocate_device(haptics->dev);
> + if (!haptics->input_dev)
> + return -ENOMEM;
> +
> + haptics->reset_gpio = devm_gpiod_get(haptics->dev, "reset", GPIOD_OUT_HIGH);
> + if (IS_ERR(haptics->reset_gpio))
> + return dev_err_probe(haptics->dev, PTR_ERR(haptics->reset_gpio),
> + "Failed to get reset gpio\n");
> +
> + /* Hardware reset */
> + aw86927_hw_reset(haptics);
> +
> + /* Software reset */
> + err = regmap_write(haptics->regmap, AW86927_RSTCFG, AW86927_RSTCFG_SOFTRST);
> + if (err)
> + return dev_err_probe(haptics->dev, PTR_ERR(haptics->regmap),
> + "Failed Software reset\n");
> +
> + /* Wait ~3s until I2C is accessible */
> + usleep_range(3000, 3500);
3 ms or 3 seconds?
[..]
Best regards,
Alexey
Powered by blists - more mailing lists