mbox series

[V9,0/2] Add support for aw96103/aw96105 proximity sensor

Message ID 20240827080229.1431784-1-wangshuaijie@awinic.com (mailing list archive)
Headers show
Series Add support for aw96103/aw96105 proximity sensor | expand

Message

wangshuaijie@awinic.com Aug. 27, 2024, 8:02 a.m. UTC
From: shuaijie wang <wangshuaijie@awinic.com>

Add drivers that support Awinic aw96103/aw96105 proximity sensors.

The aw9610x series are high-sensitivity capacitive proximity detection
sensors. This device detects human proximity and assists electronic devices
in reducing specific absorption rate (SAR) to pass SAR related certifications.
The device reduces RF power and reduces harm when detecting human proximity. 
Increase power and improve signal quality when the human body is far away.

The specific absorption rate (SAR) is a metric that measures the degree of
absorption of electromagnetic radiation emitted by wireless devices,
such as mobile phones and tablets, by human tissue.

This patch implements device initialization, registration,
I/O operation handling and interrupt handling, and passed basic testing.

v1->v2:
-------
 - Remove unnecessary log printing.
 - Optimize comment style.
 - Issues with modifying the device tree.
 - Optimize code style.

v2->v3:
-------
 - Add a description about the hardware device.
 - Remove inappropriate configuration items.
 - Modify the formatting issues.
 - Modify the structure of the driver.
 - Change the style of the driver's comments.
 - Remove unnecessary log printing.
 - Modify the function used for memory allocation.
 - Modify the driver registration process.
 - Remove the functionality related to updating firmware.
 - Change the input subsystem in the driver to the iio subsystem.
 - Modify the usage of the interrupt pin.
 
v3->v4:
-------
The changes in this patch version are quite significant, and I concur
with Krzysztof's viewpoint that this driver is indeed overly complex for
the proximity sensor. Therefore, I have removed the compatibility for the
aw963xx series, and the driver will now exclusively support the aw9610x series.

 - Modify the software architecture to remove compatibility for
   the aw963xx series.
 - Optimize the parsing of register configuration files (.bin).
 - Remove unnecessary log printing.
 - Delete redefinition of true and false.
 - Remove unnecessary interfaces.
 - Optimize regulator usage.
 - Convert the I2C communication interface to regmap.

v4->v5:
-------
 - Solve errors that occur when executing the make dt_binding_check DT_SCHEMA_FILES.

v5->v6:
-------
 - Rename AW9610X to aw96103.
 - Remove the encapsulation of the i2c communication interface.
 - Delete the update node.
 - Modify the usage of regulator.
 - Delete the remove and shutdown interfaces.
 - Add iio's event-related interfaces.
 - Modify the initialization process of iio.
 - Delete power_supply-related operations.
 - Modify the register names.

v6->v7:
-------
 - Use __free(kfree) when allocating memory.
 - Modify the way to request the register configuration file,
   using request_firmware_nowait to request the configuration file.

v7->v8:
-------
 - Delete aw96103.h.
 - Remove the function of dynamically allocating IIO-related resources.
 - Remove non-essential members from the aw96103 structure.
 - Add some comments.
 - Delete the aw96103_interrupt_clear function.
 - Delete the aw96103_version_init function.
 - Optimize code logic.
 - Modify attribute descriptions in the YAML file.

v8->v9:
-------
 - Remove unnecessary function encapsulation. 
 - Use get_unaligned_le16 and get_unaligned_le32 to obtain data. 
 - Use fsleep for delay. 
 - Optimize other issues.

shuaijie wang (2):
  dt-bindings: iio: aw96103: Add bindings for aw96103/aw96105 sensor
  iio: proximity: aw96103: Add support for aw96103/aw96105 proximity
    sensor

 .../iio/proximity/awinic,aw96103.yaml         |  61 ++
 drivers/iio/proximity/Kconfig                 |  11 +
 drivers/iio/proximity/Makefile                |   1 +
 drivers/iio/proximity/aw96103.c               | 844 ++++++++++++++++++
 4 files changed, 917 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/proximity/awinic,aw96103.yaml
 create mode 100644 drivers/iio/proximity/aw96103.c


base-commit: 3e9bff3bbe1355805de919f688bef4baefbfd436

Comments

Jonathan Cameron Aug. 31, 2024, 2:07 p.m. UTC | #1
On Tue, 27 Aug 2024 08:02:27 +0000
wangshuaijie@awinic.com wrote:

> From: shuaijie wang <wangshuaijie@awinic.com>
> 
> Add drivers that support Awinic aw96103/aw96105 proximity sensors.
> 
> The aw9610x series are high-sensitivity capacitive proximity detection
> sensors. This device detects human proximity and assists electronic devices
> in reducing specific absorption rate (SAR) to pass SAR related certifications.
> The device reduces RF power and reduces harm when detecting human proximity. 
> Increase power and improve signal quality when the human body is far away.
> 
> The specific absorption rate (SAR) is a metric that measures the degree of
> absorption of electromagnetic radiation emitted by wireless devices,
> such as mobile phones and tablets, by human tissue.
> 
> This patch implements device initialization, registration,
> I/O operation handling and interrupt handling, and passed basic testing.
I made one trivial tweak to add static to the iio_info declaration and
applied to the togreg branch of iio.git, initially pushed out as testing
for 0-day to see if it can find any issues we missed.

Thanks,

Jonathan
wangshuaijie@awinic.com Sept. 3, 2024, 6:03 a.m. UTC | #2
On Sat, 31 Aug 2024 15:07:24 +0100, jic23@kernel.org wrote:
>On Tue, 27 Aug 2024 08:02:27 +0000
>wangshuaijie@awinic.com wrote:
>
>> From: shuaijie wang <wangshuaijie@awinic.com>
>> 
>> Add drivers that support Awinic aw96103/aw96105 proximity sensors.
>> 
>> The aw9610x series are high-sensitivity capacitive proximity detection
>> sensors. This device detects human proximity and assists electronic devices
>> in reducing specific absorption rate (SAR) to pass SAR related certifications.
>> The device reduces RF power and reduces harm when detecting human proximity. 
>> Increase power and improve signal quality when the human body is far away.
>> 
>> The specific absorption rate (SAR) is a metric that measures the degree of
>> absorption of electromagnetic radiation emitted by wireless devices,
>> such as mobile phones and tablets, by human tissue.
>> 
>> This patch implements device initialization, registration,
>> I/O operation handling and interrupt handling, and passed basic testing.
>I made one trivial tweak to add static to the iio_info declaration and
>applied to the togreg branch of iio.git, initially pushed out as testing
>for 0-day to see if it can find any issues we missed.
>
>Thanks,
>
>Jonathan

Hi Jonathan,

Thank you very much for your help and suggestions, which have been very
beneficial to me. May I ask if I need to continue modifying my patch?
If not, please inform me of the approximate time for review and merging.

I look forward to your reply so that I can better plan my subsequent work.

Kind regards,
Wang Shuaijie
Jonathan Cameron Sept. 3, 2024, 8:36 a.m. UTC | #3
On Tue, 3 Sep 2024 06:03:04 +0000
<wangshuaijie@awinic.com> wrote:

> On Sat, 31 Aug 2024 15:07:24 +0100, jic23@kernel.org wrote:
> >On Tue, 27 Aug 2024 08:02:27 +0000
> >wangshuaijie@awinic.com wrote:
> >
  
> >> From: shuaijie wang <wangshuaijie@awinic.com>
> >> 
> >> Add drivers that support Awinic aw96103/aw96105 proximity sensors.
> >> 
> >> The aw9610x series are high-sensitivity capacitive proximity detection
> >> sensors. This device detects human proximity and assists electronic devices
> >> in reducing specific absorption rate (SAR) to pass SAR related certifications.
> >> The device reduces RF power and reduces harm when detecting human proximity. 
> >> Increase power and improve signal quality when the human body is far away.
> >> 
> >> The specific absorption rate (SAR) is a metric that measures the degree of
> >> absorption of electromagnetic radiation emitted by wireless devices,
> >> such as mobile phones and tablets, by human tissue.
> >> 
> >> This patch implements device initialization, registration,
> >> I/O operation handling and interrupt handling, and passed basic testing.
  
> >I made one trivial tweak to add static to the iio_info declaration and
> >applied to the togreg branch of iio.git, initially pushed out as testing
> >for 0-day to see if it can find any issues we missed.
> >
> >Thanks,
> >
> >Jonathan
  
> 
> Hi Jonathan,
> 
> Thank you very much for your help and suggestions, which have been very
> beneficial to me. May I ask if I need to continue modifying my patch?
> If not, please inform me of the approximate time for review and merging.

It's already merged.
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=testing&id=a369e1d1a10790f63b4b858dc74b53730146754f

That will be tested by the autobuilders + I need to rebase the whole
tree on char-misc once Greg (hopefully) takes a pull request that is outstanding.

That isn't relevant for your patch, but there is some other work queued
up that has dependencies on fixes that went upstream quicker.

This 'should' make the coming merge window so should be in v6.12 in
about 3 months time.  You can develop additional features on top of it
now but they are unlikely to make the 6.12 cycle as there is only about
a week left.

Jonathan

> 
> I look forward to your reply so that I can better plan my subsequent work.
> 
> Kind regards,
> Wang Shuaijie