From patchwork Thu Dec 12 03:39:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11286921 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 698BB138D for ; Thu, 12 Dec 2019 03:43:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42D3D214D8 for ; Thu, 12 Dec 2019 03:43:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QfJWq5LO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 42D3D214D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jd40eqW++XxW+2AKvab0d9tdF21Ls38M+qB/FhF9tgQ=; b=QfJWq5LOMxx2+r kXJHhcFhEbYU1whzAGF/jT+Cazj74ewK5kPbzhG4HIuFYSjo1sqNChEGd/DgsfoYSxStwz9lIIpc5 5S8C7qPN02hegqJA/DGQGrDugp3niUGBku4w7z5q6HoDtabwmK1lqFf3OGEyKHTcFylzyj1GJlkPj LDaVXH5tVYKbODYcXoS1eMOJdViDVxfe29AZ+K2Aqwfj7oObj02Msh8zMHohgSc/5lEaZdMvgEuIs PM7Rt1091AbZBSZy0JdLLvMy3pWPwr0tNVIQOA+6USXiE28Rf6hb3OOKnqMDLyHzKX/9eICJTPPEY gEj3wS5RSCw6gMykx3gg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFNi-0004Xl-6m; Thu, 12 Dec 2019 03:43:14 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ifFKe-0000SE-By; Thu, 12 Dec 2019 03:40:11 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 60525AD6F; Thu, 12 Dec 2019 03:40:02 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org, linux-leds@vger.kernel.org Subject: [RFC 12/25] leds: tm1628: Add Fuda Hisi Microelectronics FD628 Date: Thu, 12 Dec 2019 04:39:39 +0100 Message-Id: <20191212033952.5967-13-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20191212033952.5967-1-afaerber@suse.de> References: <20191212033952.5967-1-afaerber@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191211_194004_625110_F2CA7EC0 X-CRM114-Status: GOOD ( 10.28 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sales@fdhisi.com, linux-kernel@vger.kernel.org, Jacek Anaszewski , Pavel Machek , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org, Dan Murphy Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add definition for FD628 chipset. Cc: sales@fdhisi.com Signed-off-by: Andreas Färber --- drivers/leds/Kconfig | 4 ++-- drivers/leds/leds-tm1628.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index f3afb419a9a1..a7695d961d9c 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -842,8 +842,8 @@ config LEDS_TM1628 depends on SPI depends on OF || COMPILE_TEST help - Say Y to enable support for Titan Micro Electronics TM1628 - LED controllers. + Say Y to enable support for Titan Micro Electronics TM1628 and + Fuda Hisi Microelectronics FD628 LED controllers. They are 3-wire SPI devices controlling a two-dimensional grid of LEDs. Dimming is applied to all outputs through an internal PWM. diff --git a/drivers/leds/leds-tm1628.c b/drivers/leds/leds-tm1628.c index 319bf34ce835..ef85712a84f2 100644 --- a/drivers/leds/leds-tm1628.c +++ b/drivers/leds/leds-tm1628.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Titan Micro Electronics TM1628 LED controller + * Also compatible: + * Fuda Hisi Microelectronics FD628 * * Copyright (c) 2019 Andreas Färber */ @@ -400,8 +402,18 @@ static const struct tm1628_info tm1628_info = { .default_pwm = 0, }; +static const struct tm1628_info fd628_info = { + .grid_mask = GENMASK(7, 1), + .seg_mask = GENMASK(14, 12) | GENMASK(10, 1), + .modes = tm1628_modes, + .default_mode = 3, + .pwm_map = tm1628_pwm_map, + .default_pwm = 0, +}; + static const struct of_device_id tm1628_spi_of_matches[] = { { .compatible = "titanmec,tm1628", .data = &tm1628_info }, + { .compatible = "fdhisi,fd628", .data = &fd628_info }, {} }; MODULE_DEVICE_TABLE(of, tm1628_spi_of_matches);