Message ID | 20240212170423.2860895-1-andriy.shevchenko@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp80635dyb; Mon, 12 Feb 2024 10:05:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOTEakUtMXNqWm6TeyxMrumcW3lBNdFrZjY03sQqh+zAgTYyiaxDMnwQdjdbWbOmkOpTILeJIguxWKc8YV/Lv7F4OOhg== X-Google-Smtp-Source: AGHT+IHQiXnR6JsolOVAdk5BGEJbNCCxqOtNvy5H//zHNC3zaDIU5eZI0Xlu639q98+DZZirV3xD X-Received: by 2002:a05:6a21:1707:b0:19e:a217:fd20 with SMTP id nv7-20020a056a21170700b0019ea217fd20mr5215238pzb.45.1707761115598; Mon, 12 Feb 2024 10:05:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707761115; cv=pass; d=google.com; s=arc-20160816; b=Z+p4QnjqnJ2o0xDJaXf5VebnuG1hT9Gnj8gbIV2HaPaFZhwgvT1QW4IBWqZO+NJDDA lomyPMe0i2/sR7+uYJTVMJnqtcYdGCMWmruRQTrWJg/8y6g+Hw2vyOFcuCurytlwlcDt SWJcWV7K9cKfVUE+Hp658bB78Pt07EphuSoHjFjb7T5PCuppsTB2Ai+ZbmfHcoWym0/R BgA/SBp2DVoQd88HjGay1kq8ENCxDOVL/KzNBKVgN62KEWJgAV5ElocPCOxbMVrKtB6T toMM2ENfSnJ70FiYg4AA54puaaX/P7J1gKz2aifgntNGPZfxS9w+Tx4ZTV6h80HcWMVY VBoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=z0llAScewnWidFWFMuVld8MZ54vbvpfBWdll+OYwjpk=; fh=AvqfH53XSIFKqGuEYHw8D36TKYrgyDdPha3jVqbDZ6k=; b=r8EnETSxoaReKiaCCyky2QzWrVUkgQ6W2MeWZyXrt07v16Z+gTGowzfKVxX2m+XZIJ 1tqXsjFS3PoF/J4+QNy3M+/e315CeEnh/wSOKrVvPk6BBSW+tjpfl+5zm5UZPPA/Zsv5 4QUFaVr3ZvciC0u821HExfWJd15g/XXgLw1xAnsNiXLOZf376Zo3DqTJJwpg9rY5gWhV YsRyq77vQ9sLof1zUXeJcVBmbx4tjCrC8gHrNNGixe8rQ9Iy7obkrdhjTCjjFtseHjAT 4JTAkFbUyXMXCKoriWqfVlNDhCh2SFl4kX9olfWmz0pbQpvEIMxCOFyntCfGWw8d09U0 YMVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqoQBjpx; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCXnX3pOUSoXpJ10/tK+Lb4xG+2HtNVHKe3WIDXwddL/WODTCw8+A0avyhletxJwZWIhbMFFsMO6CXymcvUo6CaPtVuypw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d63-20020a633642000000b005cdfb96ea62si560744pga.243.2024.02.12.10.05.15 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 10:05:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BqoQBjpx; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62040-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CAFAC282DD0 for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 17:06:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D3C740BF0; Mon, 12 Feb 2024 17:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BqoQBjpx" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C42CC3F9EC; Mon, 12 Feb 2024 17:04:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707757488; cv=none; b=MBHxyHedKBWlphXPNxljicW1RVev+wLoWZQJ6ukjOc93MKqhLlMb8Kq0cbV6kpn2Cxf7lMz9z2e3c9tmmRQxpzQjLHDSfRw+nIxNdh5Wpwt7sPeycNXR3K74qIxng2ZIAXj1DlJoi8I7OGJk2dGU7Qm/ufSzKl0lBSG2bRNj3lo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707757488; c=relaxed/simple; bh=sx3KCnAxxS/1z9NLbOZFyEHW1jrQXTW0YVfX+eUGbSA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZzWDkNKoDo33HrfRt+4pp5bfcwWAGBIPA32BHtz9qTBJNp42g8B61UIdXhM+amBVjDfrJePaIRKTxCVnzF4o4PJi00MvKyczst9DQClmRAFZVw4ItEUV4OoXZ4aspWME3y3vAQb6BQ0xZ8op581o292fy3JDxV62riRuTYZMv+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BqoQBjpx; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707757487; x=1739293487; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sx3KCnAxxS/1z9NLbOZFyEHW1jrQXTW0YVfX+eUGbSA=; b=BqoQBjpx50bNBwcZbmwkK0yoltTQes4QLFepALrRIXPhYWNZIFNT3rz/ 7gGMxAZwKhOpX3h/Dq4NJdICY6T0Vt2HwlTHhzHx899UBe+4skgLcP86C pCffbxtRZPL4kmkXaVmWxGJ6Tm0aV1uXL/A4NuygqycIAUB3u7ztbNrLv qiuWopepqEKPLoRyyR+28xek1uU2cqLz9iTR0vg9AjEtDnqmt0X/Hgpa2 ESyHcu48NYGGg2MuCUbcaN4W9rsaFuRN3qP+VXqVD7MxkA3naVeL8KiFm eayBmXeHGQ6qeKu2Zj0M7Nc20eDDB1gQtzyFK4gD9gKYJSFB0qSGsM0fq w==; X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="19153165" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="19153165" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 09:04:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10982"; a="935116807" X-IronPort-AV: E=Sophos;i="6.06,264,1705392000"; d="scan'208";a="935116807" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 12 Feb 2024 09:04:43 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7B37DF7; Mon, 12 Feb 2024 19:04:42 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko <andy@kernel.org>, Geert Uytterhoeven <geert@linux-m68k.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Robin van der Gracht <robin@protonic.nl>, Paul Burton <paulburton@kernel.org> Subject: [PATCH v2 00/15] auxdisplay: linedisp: Clean up and add new driver Date: Mon, 12 Feb 2024 19:01:33 +0200 Message-ID: <20240212170423.2860895-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790717319132101137 X-GMAIL-MSGID: 1790717319132101137 |
Series |
auxdisplay: linedisp: Clean up and add new driver
|
|
Message
Andy Shevchenko
Feb. 12, 2024, 5:01 p.m. UTC
Add a new initial driver for Maxim MAX6958/6959 chips. While developing that driver I realised that there is a lot of duplication between ht16k33 and a new one. Hence set of cleanups and refactorings. Note, the new driver has minimum support of the hardware and I have plans to cover more features in the future. In v2: - updated DT bindings to follow specifications and requirements (Krzysztof) - unified return code variable (err everywhere) - left patches 10 and 13 untouched, we may amend later on (Robin) Andy Shevchenko (15): auxdisplay: img-ascii-lcd: Make container_of() no-op for struct linedisp auxdisplay: linedisp: Free allocated resources in ->release() auxdisplay: linedisp: Use unique number for id auxdisplay: linedisp: Unshadow error codes in ->store() auxdisplay: linedisp: Add missing header(s) auxdisplay: linedisp: Move exported symbols to a namespace auxdisplay: linedisp: Group line display drivers together auxdisplay: linedisp: Provide struct linedisp_ops for future extension auxdisplay: linedisp: Add support for overriding character mapping auxdisplay: linedisp: Provide a small buffer in the struct linedisp auxdisplay: ht16k33: Move ht16k33_linedisp_ops down auxdisplay: ht16k33: Switch to use line display character mapping auxdisplay: ht16k33: Use buffer from struct linedisp dt-bindings: auxdisplay: Add Maxim MAX6958/6959 auxdisplay: Add driver for MAX695x 7-segment LED controllers .../bindings/auxdisplay/maxim,max6959.yaml | 35 +++ drivers/auxdisplay/Kconfig | 40 ++-- drivers/auxdisplay/Makefile | 13 +- drivers/auxdisplay/ht16k33.c | 145 +++++-------- drivers/auxdisplay/img-ascii-lcd.c | 24 ++- drivers/auxdisplay/line-display.c | 162 ++++++++++++-- drivers/auxdisplay/line-display.h | 57 ++++- drivers/auxdisplay/max6959.c | 200 ++++++++++++++++++ 8 files changed, 530 insertions(+), 146 deletions(-) create mode 100644 Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml create mode 100644 drivers/auxdisplay/max6959.c
Comments
On Mon, Feb 12, 2024 at 07:01:47PM +0200, Andy Shevchenko wrote:
> Add initial device tree documentation for Maxim MAX6958/6959.
Oh, this is an old version :-(
On Mon, Feb 12, 2024 at 07:14:53PM +0200, Andy Shevchenko wrote: > On Mon, Feb 12, 2024 at 07:01:47PM +0200, Andy Shevchenko wrote: > > Add initial device tree documentation for Maxim MAX6958/6959. > > Oh, this is an old version :-( Here is a new one: From d8c826e06cf9237cd5fc6b2bb0b1cac5aff4fd8a Mon Sep 17 00:00:00 2001 From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Date: Thu, 8 Feb 2024 17:23:38 +0200 Subject: [PATCH 1/1] dt-bindings: auxdisplay: Add Maxim MAX6958/6959 Add initial device tree documentation for Maxim MAX6958/6959. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- .../bindings/auxdisplay/maxim,max6959.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml diff --git a/Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml b/Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml new file mode 100644 index 000000000000..e7d602d02df1 --- /dev/null +++ b/Documentation/devicetree/bindings/auxdisplay/maxim,max6959.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/auxdisplay/maxim,max6959.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MAX6958/6959 7-segment LED display controller with keyscan + +maintainers: + - Andy Shevchenko <andriy.shevchenko@linux.intel.com> + +description: + The Maxim MAX6958/6959 7-segment LED display controller provides + an I2C interface to up to four 7-segment LED digits. The MAX6959 + in comparison to MAX6958 has the debounce and interrupt support. + Type of the chip can be autodetected via specific register read, + and hence the features may be enabled in the driver at run-time. + Given hardware is simple and does not provide any additional pins, + such as reset or enable. + +properties: + compatible: + const: maxim,max6959 + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + display-controller@38 { + compatible = "maxim,max6959"; + reg = <0x38>; + }; + };
On Mon, Feb 12, 2024 at 07:01:33PM +0200, Andy Shevchenko wrote: > Add a new initial driver for Maxim MAX6958/6959 chips. > While developing that driver I realised that there is a lot > of duplication between ht16k33 and a new one. Hence set of > cleanups and refactorings. > > Note, the new driver has minimum support of the hardware and > I have plans to cover more features in the future. > > In v2: > - updated DT bindings to follow specifications and requirements (Krzysztof) > - unified return code variable (err everywhere) > - left patches 10 and 13 untouched, we may amend later on (Robin) Geert, I would like to apply at least the first 13 patches. Do you have any comments or even possibility to perform a regression test?
Hi Andy, On Wed, Feb 14, 2024 at 6:57 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > On Mon, Feb 12, 2024 at 07:01:33PM +0200, Andy Shevchenko wrote: > > Add a new initial driver for Maxim MAX6958/6959 chips. > > While developing that driver I realised that there is a lot > > of duplication between ht16k33 and a new one. Hence set of > > cleanups and refactorings. > > > > Note, the new driver has minimum support of the hardware and > > I have plans to cover more features in the future. > > > > In v2: > > - updated DT bindings to follow specifications and requirements (Krzysztof) > > - unified return code variable (err everywhere) > > - left patches 10 and 13 untouched, we may amend later on (Robin) > > Geert, I would like to apply at least the first 13 patches. > Do you have any comments or even possibility to perform a regression test? I'll try to give it a try on my Adafruit Quad 14-segment display tomorrow... Gr{oetje,eeting}s, Geert
On Wed, Feb 14, 2024 at 07:45:01PM +0100, Geert Uytterhoeven wrote: > On Wed, Feb 14, 2024 at 6:57 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > On Mon, Feb 12, 2024 at 07:01:33PM +0200, Andy Shevchenko wrote: .. > > Geert, I would like to apply at least the first 13 patches. > > Do you have any comments or even possibility to perform a regression test? > > I'll try to give it a try on my Adafruit Quad 14-segment display tomorrow... Thank you!
Hi Andy, On Wed, Feb 14, 2024 at 7:45 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > On Wed, Feb 14, 2024 at 6:57 PM Andy Shevchenko > <andriy.shevchenko@linux.intel.com> wrote: > > On Mon, Feb 12, 2024 at 07:01:33PM +0200, Andy Shevchenko wrote: > > > Add a new initial driver for Maxim MAX6958/6959 chips. > > > While developing that driver I realised that there is a lot > > > of duplication between ht16k33 and a new one. Hence set of > > > cleanups and refactorings. > > > > > > Note, the new driver has minimum support of the hardware and > > > I have plans to cover more features in the future. > > > > > > In v2: > > > - updated DT bindings to follow specifications and requirements (Krzysztof) > > > - unified return code variable (err everywhere) > > > - left patches 10 and 13 untouched, we may amend later on (Robin) > > > > Geert, I would like to apply at least the first 13 patches. > > Do you have any comments or even possibility to perform a regression test? > > I'll try to give it a try on my Adafruit Quad 14-segment display tomorrow.. With the missing return-statement added, the ht16k33 driver builds and works fine: the kernel version is happily scrolling by. I didn't test userspace line display control, as there is an issue with the uSD interface on my OrangeCrab, preventing it from booting into userspace. Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Gr{oetje,eeting}s, Geert
On Thu, Feb 15, 2024 at 12:05:37PM +0100, Geert Uytterhoeven wrote: > On Wed, Feb 14, 2024 at 7:45 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > On Wed, Feb 14, 2024 at 6:57 PM Andy Shevchenko > > <andriy.shevchenko@linux.intel.com> wrote: > > > On Mon, Feb 12, 2024 at 07:01:33PM +0200, Andy Shevchenko wrote: > > > > Add a new initial driver for Maxim MAX6958/6959 chips. > > > > While developing that driver I realised that there is a lot > > > > of duplication between ht16k33 and a new one. Hence set of > > > > cleanups and refactorings. > > > > > > > > Note, the new driver has minimum support of the hardware and > > > > I have plans to cover more features in the future. > > > > > > > > In v2: > > > > - updated DT bindings to follow specifications and requirements (Krzysztof) > > > > - unified return code variable (err everywhere) > > > > - left patches 10 and 13 untouched, we may amend later on (Robin) > > > > > > Geert, I would like to apply at least the first 13 patches. > > > Do you have any comments or even possibility to perform a regression test? > > > > I'll try to give it a try on my Adafruit Quad 14-segment display tomorrow... > > With the missing return-statement added, the ht16k33 driver builds > and works fine: the kernel version is happily scrolling by. > I didn't test userspace line display control, as there is an issue > with the uSD interface on my OrangeCrab, preventing it from booting > into userspace. > > Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Thank you! So far I have applied patches 1-6,8-9 with the respective suggestions implemented.