linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V5 0/6] Raspberry Pi Sense HAT driver
@ 2021-12-10 22:10 Charles Mirabile
  2021-12-10 22:10 ` [PATCH V5 1/6] drivers/mfd: sensehat: Raspberry Pi Sense HAT core driver Charles Mirabile
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Charles Mirabile @ 2021-12-10 22:10 UTC (permalink / raw)
  To: linux-kernel
  Cc: Charles Mirabile, Serge Schneider, Stefan Wahren,
	Nicolas Saenz Julienne, Mattias Brugger, linux-rpi-kernel,
	linux-arm-kernel, fedora-rpi, Mwesigwa Guma, Joel Savitz

This patch series adds a set of drivers for operating the Sense HAT
peripheral device. This board is an add on for the Raspberry Pi that is
designed to connect using the GPIO connector via I2C.

It features:
	- a joystick
	- an 8x8 RGB LED matrix display
	- a whole bunch of environmental sensors with their own drivers
	  (those are already in upstream Linux)

This is a refactor of the work of Serge Schneider, the author of a
version of this driver that is currently in the Raspberry Pi downstream
kernel. We modified his code to make it suitable for upstream Linux.

A couple of tests are available for the driver in this repo:
https://github.com/underground-software/sensehat/tree/master/tests
	- color_test displays various solid colors on the LED panel
	- framebuffer_test displays a single lit cell that is
	  controllable via the arrow keys or the joystick

For more information about the Sense HAT, visit:
https://www.raspberrypi.org/products/sense-hat/

Issues fixed since v4:
	- Removed the regmap readable/writeable register functions
	  because they necessitated putting lots of internal details
	  in the header. Moved those details back into .c files
	  (Thanks to Matthias Brugger for the suggestion).
	- Added ifdef blocks to only attempt to register the children
	  devices the user wants according to kconfig (Thanks to
	  Thomas Weißschuh for the suggestion).
	- Corrected kconfig dependencies for joystick and display
	  so that they now also depend on i2c being enabled
	  (Thanks to Randy Dunlap for the suggestion).
	- Simplified the control flow in display ioctl (Thanks to
	  Matthias Brugger for the suggestion).
	- Signed off on the patch sets correctly with co-developed-by
	  (Thanks to Miguel Ojeda for the correction).

Improvements since v4:
	- Removed fallback compatible string from downstream overlay
	  and having dropped support for it, wrote a new overlay and
	  binding that uses the interrupt and interrupt-parent
	  properties as opposed to a downstream hack, thus simplifying
	  the registration logic for joystick (Thanks to Rob Herring
	  for the suggestion).

Suggestions from v4 not addressed yet:
	- Use mfd_cells for the joystick and display platform devices
	  (as suggested by Matthias Brugger) or remove sensehat-core.c
	  entirely and use simple-mfd-i2c instead (as suggested by
	  Nicolás Sáenz Julienne).
	  	- while these suggestions might make great improvements
	  	  for a version two of the driver they would require a
	  	  large rewrite to move all of the complexity in core
	  	  elsewhere. While certainly possible and something
	  	  we want to iterate on and achieve eventually, we
	  	  think saving it for down the road makes sense at this
	  	  time.
	- Modify the userspace interface of the display driver so it
	  matches the internal representation used by the uC on the
	  other end of the wire to try and eliminate the overhead of
	  reformatting it.
	  	- The format is still compatible with the downstream
	  	  version of this driver meaning that porting existing
	  	  applications for the sensehat to work with this driver
	  	  is currently trivial. Changing this interface would make
	  	  it less so. Although certainly not impossible, it is a
	  	  downside to be considered.
	  	- The "complexity" of unpacking the bit packed the data
	  	  is a current cost, but it has the added benefit of
	  	  automatically restricting the values to 0-31. New
	  	  logic would need to be added to clamp or wrap out of
	  	  bounds values that might be just as expensive.

Signed-off-by: Charles Mirabile <cmirabil@redhat.com>
Co-developed-by: Mwesigwa Guma <mguma@redhat.com>
Signed-off-by: Mwesigwa Guma <mguma@redhat.com>
Co-developed-by: Joel Savitz <jsavitz@redhat.com>
Signed-off-by: Joel Savitz <jsavitz@redhat.com>

Charles Mirabile (6):
  drivers/mfd: sensehat: Raspberry Pi Sense HAT core driver
  drivers/input/joystick: sensehat: Raspberry Pi Sense HAT joystick
    driver
  drivers/auxdisplay: sensehat: Raspberry Pi Sense HAT display driver
  dt-bindings: mfd: sensehat: Raspberry Pi Sense HAT schema
  MAINTAINERS: Add sensehat driver authors to MAINTAINERS
  DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4

 .../bindings/mfd/raspberrypi,sensehat.yaml    |  54 ++++
 MAINTAINERS                                   |  11 +
 drivers/auxdisplay/Kconfig                    |   8 +
 drivers/auxdisplay/Makefile                   |   1 +
 drivers/auxdisplay/sensehat-display.c         | 268 ++++++++++++++++++
 drivers/input/joystick/Kconfig                |   8 +
 drivers/input/joystick/Makefile               |   1 +
 drivers/input/joystick/sensehat-joystick.c    | 119 ++++++++
 drivers/mfd/Kconfig                           |   8 +
 drivers/mfd/Makefile                          |   1 +
 drivers/mfd/sensehat-core.c                   | 157 ++++++++++
 include/linux/mfd/sensehat.h                  |  51 ++++
 sensehat.dtbs                                 |  44 +++
 13 files changed, 731 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/raspberrypi,sensehat.yaml
 create mode 100644 drivers/auxdisplay/sensehat-display.c
 create mode 100644 drivers/input/joystick/sensehat-joystick.c
 create mode 100644 drivers/mfd/sensehat-core.c
 create mode 100644 include/linux/mfd/sensehat.h
 create mode 100644 sensehat.dtbs

-- 
2.31.1


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

end of thread, other threads:[~2021-12-13 17:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 22:10 [PATCH V5 0/6] Raspberry Pi Sense HAT driver Charles Mirabile
2021-12-10 22:10 ` [PATCH V5 1/6] drivers/mfd: sensehat: Raspberry Pi Sense HAT core driver Charles Mirabile
2021-12-11 20:53   ` Thomas Weißschuh
2021-12-12 11:43   ` Stefan Wahren
2021-12-13 11:49   ` Nicolas Saenz Julienne
2021-12-10 22:10 ` [PATCH V5 2/6] drivers/input/joystick: sensehat: Raspberry Pi Sense HAT joystick driver Charles Mirabile
2021-12-10 23:17   ` Dmitry Torokhov
2021-12-10 22:10 ` [PATCH V5 3/6] drivers/auxdisplay: sensehat: Raspberry Pi Sense HAT display driver Charles Mirabile
2021-12-11 18:38   ` Miguel Ojeda
2021-12-10 22:10 ` [PATCH V5 4/6] dt-bindings: mfd: sensehat: Add Raspberry Pi Sense HAT schema Charles Mirabile
2021-12-11 19:59   ` Rob Herring
2021-12-13 17:09     ` Rob Herring
2021-12-10 22:10 ` [PATCH V5 5/6] MAINTAINERS: Add sensehat driver authors to MAINTAINERS Charles Mirabile
2021-12-10 22:10 ` [PATCH V5 6/6] DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4 Charles Mirabile
2021-12-13 11:29 ` [PATCH V5 0/6] Raspberry Pi Sense HAT driver Nicolas Saenz Julienne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).