From patchwork Mon May 16 09:42:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12850495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BBB32C433F5 for ; Mon, 16 May 2022 09:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ab4KhPtS5K66SxIQ85QcsaYt11ngqvrijyv2mI4u3sE=; b=oKDpCr1nblNdOG G1QjTe/N/pHiBVRwQ+tiyHWuGxgDzrk2i7eAkiV8JCDtTaR/C966pV1mOenaV6W0PE5iDl1hgmrhy vm1nIg4VmzFOfYxAyheuRRLYcVP+AtUkjviH08nFZoL9TIDlY6Ykv0esm6xPfHqANpuiuTOynV+lv aFnqxthbzIuoONHjmZc3edEuUKNLZfhisyaNGJuU/l8rTqrlyCqYQhh6SDkiI/+uujZ7/BrXc+XIi 2xeSF+OfnY6iA5LbLid1DGjRKg+PBZurZtYTsABkFYrbiuTIsdb7BZwNdmT9So89Lqz3HnS+FnOim 68Eoegk82xMMmdrB2mLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqXFT-006vgy-Gx; Mon, 16 May 2022 09:42:43 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqXFH-006vcN-NV; Mon, 16 May 2022 09:42:33 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id A064D1F427AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1652694148; bh=c1ydz49i6C3IsJ96xkSmOp1z24weTIOHYM24+DkxGaU=; h=From:To:Cc:Subject:Date:From; b=THpfRNpOqui6zvR+BYZmkkqsaw+HmfKIjK2d64FkVNdSUzpMVw63wqDSxFaC+OJra klxciMwyLwKGQ4fYzMgWlLs/e/phiHKepxmPw+Elh00bIY1U7h60uFRN5nEaFEKCKy X1FDAuQFO0dpAcvPvPWP8pyeQXh7DVhjKS+l4u1VTp8GVVapxyvaqCqHM5GcUz3hy2 OedzLWz2OHGtO2y8v6DXA4aknaD9TTWVfSQyCfqr2yeAoIFlGOKXmjIw1WnnXaogWL mCiqn5t/s6uWtQJOJRJmwau05eDgz65PUZ5edK+EWtHuam5cIeHsXk0zvEoyEk4ZPC EQ1N10/H/fP4w== From: AngeloGioacchino Del Regno To: sean.wang@mediatek.com Cc: pavel@ucw.cz, matthias.bgg@gmail.com, linux-leds@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH 0/3] leds-mt6323: Make driver flexible and cleanups Date: Mon, 16 May 2022 11:42:19 +0200 Message-Id: <20220516094222.30414-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220516_024232_018981_49058064 X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org MT6323 is not the only PMIC that has a LEDs controller IP and it was found that the others do have a compatible register layout, except for some register offsets. The logic contained in this driver can be totally reused for other PMICs as well, so I can't see any reason to keep this specific to the MT6323 part. This series brings meaningful platform data to this driver, giving it flexibility and making it possible and straightforward to add support for other (older, or newer!) PMICs. AngeloGioacchino Del Regno (3): leds: leds-mt6323: Specify registers and specs in platform data leds: leds-mt6323: Open code and drop MT6323_CAL_HW_DUTY macro leds: leds-mt6323: Drop MT6323_ prefix from macros and defines drivers/leds/leds-mt6323.c | 258 ++++++++++++++++++++++++------------- 1 file changed, 166 insertions(+), 92 deletions(-)