public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv4 0/4] Wiegand bus driver and GPIO bitbanged Wiegand
@ 2023-05-10 16:22 Martin Zaťovič
  2023-05-10 16:22 ` [PATCHv4 1/4] dt-bindings: wiegand: add Wiegand controller common properties Martin Zaťovič
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Martin Zaťovič @ 2023-05-10 16:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, gregkh, beanhuo,
	nipun.gupta, linus.walleij, mwen, bvanassche, arnd, ogabbay,
	linux, jacek.lawrynowicz, geert+renesas, benjamin.tissoires,
	masahiroy, yangyicong, devicetree, Martin Zaťovič

Hello,

thank you for the feedback regarding the previous version of this patch series.
I have tried to follow all of the advice I got and fix all the pointed issues.
One of the main issues was the usage of of API for device registration. This
has now been fixed to use fwnode API, however I was not yet able to get rid of
the of_device include, since it is required for of_driver_match_device. Please
let me know if this is correct.

CHANGELOG:

wiegand.c:
- changed ID allocation API from IDR to IDA, since the references associated to
the IDs are not needed
- removed the board_lock mutex, because it was only guarding the allocacion
and freeing of IDs, which is already supported by IDA API
- restructured the file, so that most functions are close to their caller, or
defined them at the top for better code readability
- in the function devm_wiegand_register_controller, the devres management of
the pointer to wiegand_controller structure has been replaced with
devm_add_action_or_reset function. It was intended to do the same with
devm_wiegand_alloc_controller, however, the kernel kept panicing, despite the
call order of the unregister and release functions being proper(same as with
devres managed pointer). Please let me know if this is an absolute must, if so
I will look into it further.
- moved the miscdevice from wiegand-gpio driver to be a part of the bus
driver. Now every controller is associated a /dev file. The file operation
functions were simply moved and renamed and the miscdevice structure was moved
to be a part of wiegand_controller structure
- since now every controller has a miscdevice assosciated, the data_buffer was
also moved to be a part of the controller structure, and it was made a bitmap
- used fwnode API for device registration instead of of API
- removed warnings when driver fails to get wiegand properties, instead
implemented mechanism for setting a default value similar I2C
- removed the driver matching code in register driver, as
of_driver_match_device does that already
- made wiegand_device and opaque pointer
- changed the terminology to primary and secondary

wiegand.h
- reordered the wiegand_driver structure so that miscdevice is first

wiegand-gpio.c
- removed of.h include
- changed udelay to usleep_range for longer wait times in wiegand_gpio_send_bit
- moved wiegand_gpio_groups to dev groups of the struct driver
- style changes(no commas for terminator entries, removed redundant blank
lines etc.)
- changed the names of gpio_descs from gpio_data_hi and gpio_data_lo to
data1_gpio and data0_gpio

Martin Zaťovič (4):
  dt-bindings: wiegand: add Wiegand controller common properties
  wiegand: add Wiegand bus driver
  dt-bindings: wiegand: add GPIO bitbanged Wiegand controller
  wiegand: add Wiegand GPIO bitbanged controller driver

 .../ABI/testing/sysfs-driver-wiegand-gpio     |   9 +
 .../bindings/wiegand/wiegand-controller.yaml  |  39 ++
 .../bindings/wiegand/wiegand-gpio.yaml        |  51 ++
 MAINTAINERS                                   |  14 +
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/wiegand/Kconfig                       |  28 +
 drivers/wiegand/Makefile                      |   2 +
 drivers/wiegand/wiegand-gpio.c                | 189 ++++++
 drivers/wiegand/wiegand.c                     | 609 ++++++++++++++++++
 include/linux/wiegand.h                       | 144 +++++
 11 files changed, 1088 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-driver-wiegand-gpio
 create mode 100644 Documentation/devicetree/bindings/wiegand/wiegand-controller.yaml
 create mode 100644 Documentation/devicetree/bindings/wiegand/wiegand-gpio.yaml
 create mode 100644 drivers/wiegand/Kconfig
 create mode 100644 drivers/wiegand/Makefile
 create mode 100644 drivers/wiegand/wiegand-gpio.c
 create mode 100644 drivers/wiegand/wiegand.c
 create mode 100644 include/linux/wiegand.h

-- 
2.40.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-06-22 14:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10 16:22 [PATCHv4 0/4] Wiegand bus driver and GPIO bitbanged Wiegand Martin Zaťovič
2023-05-10 16:22 ` [PATCHv4 1/4] dt-bindings: wiegand: add Wiegand controller common properties Martin Zaťovič
2023-05-10 16:22 ` [PATCHv4 2/4] wiegand: add Wiegand bus driver Martin Zaťovič
2023-06-22 13:20   ` Andy Shevchenko
2023-05-10 16:22 ` [PATCHv4 3/4] dt-bindings: wiegand: add GPIO bitbanged Wiegand controller Martin Zaťovič
2023-05-10 16:33   ` Conor Dooley
2023-05-11  5:30   ` Krzysztof Kozlowski
2023-05-10 16:22 ` [PATCHv4 4/4] wiegand: add Wiegand GPIO bitbanged controller driver Martin Zaťovič
2023-05-10 20:16   ` kernel test robot
2023-06-22 13:39   ` Andy Shevchenko
2023-06-22 12:36 ` [PATCHv4 0/4] Wiegand bus driver and GPIO bitbanged Wiegand Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox