mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Mirabile <cmirabil@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Charles Mirabile <cmirabil@redhat.com>,
	Serge Schneider <serge@raspberrypi.org>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	Nicolas Saenz Julienne <nsaenzju@redhat.com>,
	Mattias Brugger <mbrugger@suse.com>,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	fedora-rpi@googlegroups.com, Mwesigwa Guma <mguma@redhat.com>,
	Joel Savitz <jsavitz@redhat.com>
Subject: [PATCH V5 0/6] Raspberry Pi Sense HAT driver
Date: Fri, 10 Dec 2021 17:10:27 -0500	[thread overview]
Message-ID: <20211210221033.912430-1-cmirabil@redhat.com> (raw)

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


             reply	other threads:[~2021-12-10 22:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 22:10 Charles Mirabile [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211210221033.912430-1-cmirabil@redhat.com \
    --to=cmirabil@redhat.com \
    --cc=fedora-rpi@googlegroups.com \
    --cc=jsavitz@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=mbrugger@suse.com \
    --cc=mguma@redhat.com \
    --cc=nsaenzju@redhat.com \
    --cc=serge@raspberrypi.org \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®