Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp48900lfv; Tue, 12 Apr 2022 16:48:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpWW6zeaWOpspra6YFF+rqSXeD2Mqs6p9krQaL1gEEs7Nv67e/30duXBa6Gj47VhKi2sr0 X-Received: by 2002:a17:907:6294:b0:6e1:ea4:74a3 with SMTP id nd20-20020a170907629400b006e10ea474a3mr36152219ejc.168.1649807328336; Tue, 12 Apr 2022 16:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649807328; cv=none; d=google.com; s=arc-20160816; b=tt8s5wjOifTNWDtU31NpruvdfsSo3KwqRWgeIZm57pqYOPj8y0+ePg7fwG7IPXvWzG VpYb59vLM1PFXOz8F18ZYd2PCiqQLdjQMtRKpyE566XzeH7zqYIIp7+fAOtWpVVmxriw sZOwlsq0Sm43mGdoBSez+UaqTgD5FTrgbl8Mig7/I2d1GydfLskRhzlupDP+ej1ihTkv j9pyeVusl5wWOUG8dOb3klJ2jChTSS8DKie3a8RibQ1t1AM1ZrnsoQFzWukTZ+Ol+rhw SXUFPdpRpShutmaG2xygMulMojXljoVJ3+QNCxsmCG/Q8QyLtz+tKxEueSp37GENlEAN MZRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fVvyj7UT2RLX5Fjubi2oetumHl0CrI2Ol/3tyXbUefQ=; b=0lHyhvBL/gZiwoBfkvTkIcKMXQOH9vrGYJ5mk2ja7nY48TsvUrjBzcj0t9JAeBVvdh dwetTvRiSLV6GkzeTgsk7sCdvg6aDwtsiNxC+5/pb7H71vKv90xgGf72rCtsCAMKXwD3 aVKVaBol5p8dkqWBxh2Us8ki1Qf3UBITPS7k2Xqv5PBUmR9fj+Svezmscw6BrOdqp9xO jeN6FQxTskn14DOsfnxxK/jaCyFQLQHBVVbbAfIs2qLF6xxnHOs5iiRTbVUwicvNsjus Eyg+JxLTEdMFX0HslMfkiA0FcHvs+JT/QFuvgV5h1VUQB1p6QRVzF6eg1z9e1Fc0nkgF YT7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XZGZOq2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz13-20020a0564021d4d00b0041d8b89a631si538894edb.359.2022.04.12.16.48.20; Tue, 12 Apr 2022 16:48:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XZGZOq2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbiDLX3g (ORCPT + 99 others); Tue, 12 Apr 2022 19:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbiDLX2K (ORCPT ); Tue, 12 Apr 2022 19:28:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7927DFFA7 for ; Tue, 12 Apr 2022 15:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649802813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=fVvyj7UT2RLX5Fjubi2oetumHl0CrI2Ol/3tyXbUefQ=; b=XZGZOq2mA5t8Xp6D+4WeGIaAmR/cO9WTqakx8i8OkP1wNF6OKn3bepxSIYIQInTCrLOZb2 ZvK6L3/ht4MthzfG0mkRjPZ+bS8qBuw/pBY4KPfgjKLaHPwy/9PgOWnuh4QodCaSMYqYnh SJ/T4Y9VfAizhN4uKnuNZzw1HFqZFUk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-FxgtqUHaOa6c2QWSgC6JEA-1; Tue, 12 Apr 2022 16:14:11 -0400 X-MC-Unique: FxgtqUHaOa6c2QWSgC6JEA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1D76833959; Tue, 12 Apr 2022 20:14:10 +0000 (UTC) Received: from cmirabil.remote.csb (unknown [10.22.32.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10CFB401DAC; Tue, 12 Apr 2022 20:14:10 +0000 (UTC) From: Charles Mirabile To: linux-kernel@vger.kernel.org Cc: Charles Mirabile , Serge Schneider , Stefan Wahren , Nicolas Saenz Julienne , Mattias Brugger , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, fedora-rpi@googlegroups.com, Daniel Bauman , Mwesigwa Guma , Joel Savitz Subject: [PATCH v8 0/6] Raspberry Pi Sense HAT driver Date: Tue, 12 Apr 2022 16:13:37 -0400 Message-Id: <20220412201343.8074-1-cmirabil@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 and communicate 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 the test folder in this repo: https://github.com/underground-software/sensehat.git - sensehat_joystick_test logs the input events from the joystick to the console - sensehat_display_test displays various solid colors on the LED panel. - full_sensehat_test displays a single lit cell that can be moved with the joystick. Pressing the joystick ends the program. For more information about the Sense HAT, visit: https://www.raspberrypi.org/products/sense-hat/ Changes since v7: - Added missing error checks to sensehat-display and sensehat-joystick probe functions (allocation failure, and failure to get regmap) - Propogated potential error from regmap write out of the update display function so that an innability to connect with hardware can be detected during probe - Changed the userspace format back to individual bytes one per color channel, three per pixel. They are now arranged as rgb triples instead of the native format for the hardware. - Thanks to Miguel Ojeda for these suggestions. Co-developed-by: Daniel Bauman Signed-off-by: Daniel Bauman Co-developed-by: Mwesigwa Guma Signed-off-by: Mwesigwa Guma Co-developed-by: Joel Savitz Signed-off-by: Joel Savitz Signed-off-by: Charles Mirabile Charles Mirabile (6): drivers/mfd: sensehat: Add Raspberry Pi Sense HAT to simple_mfd_i2c drivers/input/joystick: sensehat: Raspberry Pi Sense HAT joystick driver drivers/auxdisplay: sensehat: Raspberry Pi Sense HAT display driver dt-bindings: mfd: sensehat: Add Raspberry Pi Sense HAT schema MAINTAINERS: Add sensehat driver authors to MAINTAINERS DO NOT MERGE: full sensehat device tree overlay for raspberry pi 4 .../raspberrypi,sensehat-display.yaml | 27 +++ .../input/raspberrypi,sensehat-joystick.yaml | 33 +++ .../bindings/mfd/raspberrypi,sensehat.yaml | 69 ++++++ MAINTAINERS | 11 + drivers/auxdisplay/Kconfig | 8 + drivers/auxdisplay/Makefile | 1 + drivers/auxdisplay/sensehat-display.c | 205 ++++++++++++++++++ drivers/input/joystick/Kconfig | 11 + drivers/input/joystick/Makefile | 1 + drivers/input/joystick/sensehat-joystick.c | 137 ++++++++++++ drivers/mfd/simple-mfd-i2c.c | 1 + sensehat.dtbs | 54 +++++ 12 files changed, 558 insertions(+) create mode 100644 Documentation/devicetree/bindings/auxdisplay/raspberrypi,sensehat-display.yaml create mode 100644 Documentation/devicetree/bindings/input/raspberrypi,sensehat-joystick.yaml 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 sensehat.dtbs -- 2.31.1