Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp340702ybl; Wed, 11 Dec 2019 19:41:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzBlXOfieBXjCDWduZWhLHhI17sm92+bvf9qqApbUFTdOisikfZXVn45TV0aO8kV2wjB3O1 X-Received: by 2002:a05:6830:579:: with SMTP id f25mr5889343otc.248.1576122061110; Wed, 11 Dec 2019 19:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576122061; cv=none; d=google.com; s=arc-20160816; b=cG37HWyDlOlDwRw4nwkCzaGdOIFqruKNPp3U9yNn05Fmap7a/GtMGCw+zqelXzp4JP uhABnAfLd+nlTb3qIU2kfPTaKP2EQd1l3P1d+/7n5/t7sm01cb4n/xQ4jd5jd7nsiiaH Tp/SGbm0cx8zTimgw7eKa4eVDtjm0DQPbzLSGVd+yB+6PGVDM8RyLSkwneTzLmcfc42Z HaC4zUiUWoqOxGUi3EDUiuDQw0lnL6f0eLO/jrXjXVICua/vFGtnzan2kfXUBoJaAnur stDDiAZbWfjQujaZVkzlbuQEpQos2oZ4sEWSoJ/87m7ff+poW5/oD5wfX0jCCAfPp/ba o7RQ== 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 p6si2375120oig.231.2019.12.11.19.40.48; Wed, 11 Dec 2019 19:41:01 -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 S1727856AbfLLDkN (ORCPT + 99 others); Wed, 11 Dec 2019 22:40:13 -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=20F=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=20F=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) 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); -- 2.16.4