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: 181396 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp371658ile; Wed, 11 Dec 2019 19:40:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwEuUyvGJ4qfh31s9RfiLFx24xo0HzYEGosj4/Ts1oZnIJTAjgHnDXGmSsxnEuZg4ajMqfB X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr6030550otc.0.1576122035558; Wed, 11 Dec 2019 19:40:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576122035; cv=none; d=google.com; s=arc-20160816; b=TK/Xod/aP25dGvwAoac7/LW1e8PL+K0RMDir1oDpcJ8xxcpO2gJzIZfpWarXCjpuTJ hcJMnXu5qHyknEFmg6Fpdq1r2HuM+Pq+zubwufNN+J0xcgo2NO/qpf2ftVLWca3Pq6D3 lelpQKm93JsEijrRjrL3xO7nJDs00jmIfV48Nv8TirDR12BaSA0fOZTWSbmymubTYU2W b2Cnju11WFlcZGSdK9nVv2mrDLacASVNdaWAMZ8oqyEvAPbxwKMGc9m0PMlaB3Ddll9C R2yA6tPrN3/t/7QAK4GXkr1iJsCIIDnYeTJgGvF/I9KP4bmqGK2JxJM8Ud4TBxdni+CZ L9Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kSBo4rCMB5pyRR1RTyOQ2brIaksCdCCe6RXgRPU0J+k=; b=c6m5yzioCBWvvjnndYVTJDEpXSMZOwu2/2KtAcrrfOHO5EeZtOZQBF20+Mydpv9cOu X8S83FePZElam17CAiVzx5IhAp5k0WSiWkSNstoUBTQwC55w8TP1oifwVrh5N6coE93J SrPcwOAgnlcQy/VRlX15ZSBDlowsUcEyGlpMn+ekwbeVxw1h7WkojbsIWhLeb/Q0/rLw bditEYSTTIT5HRoLtBBaW3UNcBpMviab59ogL8Ys5tvNFYuHBb11yuEvGMrelx4woanI HttKGEd2OV1b+YK1BBy21FhLVhzaMVa6/DHbfbsCLET6sfH5TiL1wpPESSsw0kepzxcl xN3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si2823909otf.76.2019.12.11.19.40.35; Wed, 11 Dec 2019 19:40:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbfLLDkO (ORCPT + 27 others); Wed, 11 Dec 2019 22:40:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:58596 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727658AbfLLDkE (ORCPT ); Wed, 11 Dec 2019 22:40:04 -0500 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 Cc: Jacek Anaszewski , Pavel Machek , Dan Murphy , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andreas_F=C3=A4rber?= , sales@fdhisi.com 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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(-) -- 2.16.4 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);