Re: [PATCH v3 2/3] iio: proximity: add driver for Sharp GP2AP070S proximity sensor

"Kaustabh Chakraborty" <[email protected]> Mon, 03 Aug 2026 22:58:24 +0530
Newsgroups org.kernel.vger.linux-samsung-soc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 2026-08-01 11:41 -05:00, David Lechner wrote:
> On 7/30/26 3:07 PM, Kaustabh Chakraborty wrote:
>> The GP2AP070S is a proximity sensor designed and manufactured by Sharp
>> Corporation. This sensor is used in mobile devices, including, but not
>> limited to - the Samsung Galaxy J6.
>>=20
>> The driver has been adopted from Samsung's downstream kernel
>> implementation [1]. Due to the lack of public documentation about the
>> schematics of this device. The downstream driver acts as the secondary
>> source of information. Driver clarity has also been improved with the
>> help of the GP2AP* drivers in iio/light.
>>=20
>> Link: https://github.com/Exynos7870/android_kernel_samsung_universal7870=
/blob/lineage-16.0/drivers/sensors/gp2ap070s.c [1]
>> Signed-off-by: Kaustabh Chakraborty <[email protected]>
>> ---

[...]

>> +static void gp2ap070s_reset_action(void *private)
>> +{
>> +	struct gp2ap070s_drvdata *drvdata =3D private;
>
> Usually, we don't bother with a cast/local variable in these.
> The void* can be passed directly as an arg.

Yeah, but CFI will not be happy about that.