From patchwork Sun Feb 4 17:24:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marijn Suijten X-Patchwork-Id: 196551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp456339dyb; Sun, 4 Feb 2024 09:33:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdmr8Rq9CSI9nMCrejlD0Lb2kXFgmvUXxstq/VT8K3mMj24oxU0F+d3v8h8liaE8U7C0Oh X-Received: by 2002:a05:6512:689:b0:511:4feb:ec63 with SMTP id t9-20020a056512068900b005114febec63mr326454lfe.60.1707067997606; Sun, 04 Feb 2024 09:33:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707067997; cv=pass; d=google.com; s=arc-20160816; b=MugdToTvy4+YCjaYWlQZ4xzOD4CkmAlSE53vK/1yiVFKseE23ymS5Rcb5BiT2uNVUI GSwwvm39ZXnso5jS8/19yxyNMQHsjHZp79d4V+6e/A0O4XHKprbrnIFX1nCaGPr5vV8B P4Ujs13YFCsAHmRRggUtiMYXu2gUDnNyDYO3iRSHSdVaOpAqdJiaqgzVBO+AWoP/bxyz 98SUAXy2/LHkpermzl89n0J2oeO56mY7SNxiZ0FefBcNOtFkwWZB8PzrwhAQUkROjezs a9jwnEW6m7hH7cI+waonrXKFhcpM/JyrRtmrGypkQHYNK8fl80K4daLBKbNV25uj2CRr 61Iw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from; bh=CvutcejpRsgLSAc/OvP7QFiPqx4jPW11kcCHN3EmIbI=; fh=qetAM4iV91AAZtPqoTSZXG0n4tMUEDBSbEqrFjU4Vhk=; b=O0T7CADITSVWZGGGg2AvP+LiVa4Q5mP9M9nwpYZvbd+9wMIgJAF8JchR+MB/ujgfxA qhpKdCkq865Zuxi/VL6NtjFmfgkLXZoSuCJ+zGlngFytRcsHQw1TI//KdjodRxoeVmBk y5+qLSRZn40JvkFOadgId9pAgR7mQpMtC19QripCRPy6qrzExTmazFAJ5FtKsCm07CE1 Q10iI/0Ial0oHqQJeI7jue7/SWgQc3DyrX85V+HexrH40lEwJ5EbO/YlpZ/F+6aafeeM Rf0QFcw1oheVbWO1EKSETJUnrx+twotg0mJTPx0GHhMAblimVOJEazbHQh41Sd3cfckg eH5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-51830-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51830-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCV08vr/lxjjo8wWQJ5AfiZPcYxU7xAl9ykvJWo1X3axTPNvU9Ai0+n2/hvDgNpL4Wrbnj7NKfEMiZuTPi22XY6Cl6Dq5g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y25-20020a170906071900b00a37a44ac22esi500784ejb.500.2024.02.04.09.33.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 09:33:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51830-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=somainline.org); spf=pass (google.com: domain of linux-kernel+bounces-51830-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51830-ouuuleilei=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 153821F22F7A for ; Sun, 4 Feb 2024 17:33:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A863A249FC; Sun, 4 Feb 2024 17:32:09 +0000 (UTC) Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [5.144.164.171]) (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 2D4CB2C691 for ; Sun, 4 Feb 2024 17:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=5.144.164.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707067928; cv=none; b=OyZmiFCvLdSHaGiAn55pxgJ9e7KAJkOO9SEjj3/YFwNCikdhuuVIl84uYugikVm1eWFX31nGl5M3WOvFc4aZjRdUInp+Wf3oDOrwFy7ffXUZfseBM3sTODEaxiq5vdPcXwnDNhhnxf65tmInCDDVfRrAUPYyldW54bkkC1/STJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707067928; c=relaxed/simple; bh=bcNFXOXgVZBEkNCwZd1X9XvtwNPnxgf0ip+0KH9NcyE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=ARC+aa8hwNZb+Uw5SDNCLkBB3TKMoSMu81kTwvBtunIMrNLql8XVe5y2/XmeYTrO7oiogMJsSrmlOGExShDyMGlEFZUBjojBvggMxE8NpE6e/DLS+jfgAPoj+B12nENl0X7CKQpuHsBlGuy0cccV6a4UGG7mztgNPWolMCNzUQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org; spf=pass smtp.mailfrom=somainline.org; arc=none smtp.client-ip=5.144.164.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=somainline.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=somainline.org Received: from Marijn-Arch-Book.localdomain (2a02-a420-67-c93f-164f-8aff-fee4-5930.mobile6.kpn.net [IPv6:2a02:a420:67:c93f:164f:8aff:fee4:5930]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id D639D3E74E; Sun, 4 Feb 2024 18:24:31 +0100 (CET) From: Marijn Suijten Date: Sun, 04 Feb 2024 18:24:20 +0100 Subject: [PATCH v5] leds: qcom-lpg: Add PM660L configuration and compatible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240204-pm660l-lpg-v5-1-2f54d1a0894b@somainline.org> X-B4-Tracking: v=1; b=H4sIAEPIv2UC/zXMTQ6CMBBA4auQWVsy/QELK+9hXFQdYAhtSYvGh HB3GxOX3+K9HTIlpgx9tUOiN2eOoaA5VfCYXBhJ8LMYFCqDCo1YfdviIpZ1FINu7tZpp61BKMG aaODPb3a9FQ8perFNidx/ofAsOyWlNbaWbaM7hUIK7xLPoc4vnjcKlxy947BwoDqmEY7jC0BOA K6lAAAA To: Pavel Machek , Lee Jones Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, phone-devel@vger.kernel.org, Bjorn Andersson , Johan Hovold , Konrad Dybcio , Martin Botka , Jami Kettunen , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Marijn Suijten , Bjorn Andersson X-Mailer: b4 0.12.4 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785697856559697298 X-GMAIL-MSGID: 1789990532565533348 Inherit PM660L PMIC LPG/triled block configuration from downstream drivers and DT sources, consisting of a triled block with automatic trickle charge control and source selection, three colored led channels belonging to the synchronized triled block and one loose PWM channel. Signed-off-by: Marijn Suijten Reviewed-by: Bjorn Andersson --- Changes since v4: - Rebased on -next and resolve conflict with removed lpg_remove(); - v4: https://lore.kernel.org/linux-leds/20220719211848.1653920-2-marijn.suijten@somainline.org/ --- drivers/leds/rgb/leds-qcom-lpg.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) --- base-commit: 01af33cc9894b4489fb68fa35c40e9fe85df63dc change-id: 20240204-pm660l-lpg-f35b8a3a3840 Best regards, diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 156b73d1f4a2..ab298391f9e0 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -1360,6 +1360,23 @@ static int lpg_probe(struct platform_device *pdev) return lpg_add_pwm(lpg); } +static const struct lpg_data pm660l_lpg_data = { + .lut_base = 0xb000, + .lut_size = 49, + + .triled_base = 0xd000, + .triled_has_atc_ctl = true, + .triled_has_src_sel = true, + + .num_channels = 4, + .channels = (const struct lpg_channel_data[]) { + { .base = 0xb100, .triled_mask = BIT(5) }, + { .base = 0xb200, .triled_mask = BIT(6) }, + { .base = 0xb300, .triled_mask = BIT(7) }, + { .base = 0xb400 }, + }, +}; + static const struct lpg_data pm8916_pwm_data = { .num_channels = 1, .channels = (const struct lpg_channel_data[]) { @@ -1502,6 +1519,7 @@ static const struct lpg_data pmk8550_pwm_data = { }; static const struct of_device_id lpg_of_table[] = { + { .compatible = "qcom,pm660l-lpg", .data = &pm660l_lpg_data }, { .compatible = "qcom,pm8150b-lpg", .data = &pm8150b_lpg_data }, { .compatible = "qcom,pm8150l-lpg", .data = &pm8150l_lpg_data }, { .compatible = "qcom,pm8350c-pwm", .data = &pm8350c_pwm_data },