Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp5668407rwe; Tue, 18 Apr 2023 09:45:10 -0700 (PDT) X-Google-Smtp-Source: AKy350YBGqYUGrUOTLFSSGaZAiFR4CONqpDf5M25h728LNxNu5IPNUV56GhG6Xwkxwk1UPMn6F5y X-Received: by 2002:a17:90b:1bc2:b0:246:af1f:62ef with SMTP id oa2-20020a17090b1bc200b00246af1f62efmr375319pjb.5.1681836309866; Tue, 18 Apr 2023 09:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681836309; cv=none; d=google.com; s=arc-20160816; b=WPAn+OH7itBZ8446IoaqVuUMsQmKnuW1nya8dlfTFK2zFBRqCULdp2SSzdTl7/nRKu gDyJ71BoknUAYXB8zjLyQkjlB351mH6syAFnt7QhqJ5Al4M/aKeNK6LWZtEuv+gj7Fal DUo4vNcYn4z6W+1bB7ht9OqlKHvdmfBcZ1onPNawPlW7LlvvHidqTPXqFGM+eVZNQBS9 gAlg9PcN9R2vIhq3f/oWPFjWQRm6PBJ+ltaNFwJmzJuTfSIZi9mRAE6uAmyN3/CFE8df XBHH0bM74ztyK4Y0oUlW9rkWTQZ0LEIDOJ2CGqFxc1mFkXAowfKAYkjPEznjmMfH3Mep nWLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=O7pWoWfzEWW5yapiELdQQ3I3yWXNFvvynjND/ZJjvrw=; b=Kak2SJKh7i+AOsFIs4jcpe5VwPR2GpDO9s9fUoFJDJxrzKcfpwR6vs7D/vudpl1Yq/ mfByvhEuLSifPWxnFkDtDdD9b7VOkvuvVO8O0aBJ1y6ftL8hlW/rN7G0t8XPNJK0w/Cg EhGTLKD9YfF3msbKnLRyqHdvCNlLJ2IOCsuDkmxk7E5e3JvKj6nNvNQl6Lc49j1VAhMw 3fCEgfqFImWocF9bv7MpxTfHC7xiJWHUWREvvWJKVkBr/2a8eBHPnNo58Jqk7quipnPC bCLUJwmnRXrS6GteWqHtXTzynaUnTq12QibtCoc/YHAKyzuAMGrKWa7SOSoRUZ2Ls7rr L84w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=x7CkWvNL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo4-20020a17090b1c8400b00247601c2101si9046392pjb.71.2023.04.18.09.44.56; Tue, 18 Apr 2023 09:45:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=z3ntu header.b=x7CkWvNL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232660AbjDRQoZ (ORCPT + 99 others); Tue, 18 Apr 2023 12:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbjDRQoR (ORCPT ); Tue, 18 Apr 2023 12:44:17 -0400 Received: from mail.z3ntu.xyz (mail.z3ntu.xyz [128.199.32.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 885FB46B9; Tue, 18 Apr 2023 09:44:15 -0700 (PDT) Received: from [192.168.178.23] (unknown [62.108.10.64]) by mail.z3ntu.xyz (Postfix) with ESMTPSA id C2B92CA700; Tue, 18 Apr 2023 16:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=z3ntu; t=1681836224; bh=EZNvsJaGqI15hVmiKHgA/+7Bi1oXLhHkx00K1B0Jbu0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=x7CkWvNLVXqQP/qw7aGXRR6b5DyDgEIMGnw3chQf9kh2PBNObaGg6WwPfdTbuNNDQ DqwfyjR3JawYPHmu2WfV3qxRKF+QzvA8IHWzA6Xa11vNCkJdJA3uyKxJ4gYlJOvZRC 8vVXMBgKmOCU6hBrdkDFEU61Jk9VSiICDJzZ+a7o= From: Luca Weiss Date: Tue, 18 Apr 2023 18:43:20 +0200 Subject: [PATCH v2 4/8] leds: qcom-lpg: Add support for PMI632 LPG MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230414-pmi632-v2-4-98bafa909c36@z3ntu.xyz> References: <20230414-pmi632-v2-0-98bafa909c36@z3ntu.xyz> In-Reply-To: <20230414-pmi632-v2-0-98bafa909c36@z3ntu.xyz> To: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Rob Herring , Krzysztof Kozlowski , Pavel Machek , Lee Jones , Jonathan Cameron , Lars-Peter Clausen , Stephen Boyd , Jonathan Corbet Cc: linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1865; i=luca@z3ntu.xyz; h=from:subject:message-id; bh=EZNvsJaGqI15hVmiKHgA/+7Bi1oXLhHkx00K1B0Jbu0=; b=owEBbQKS/ZANAwAIAXLYQ7idTddWAcsmYgBkPsi5PovavgvOe36uGVHJ9jKT8cH/ZKTKo1/kQ pVLfgx/5H2JAjMEAAEIAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCZD7IuQAKCRBy2EO4nU3X Vvn4EADV1UQr1t6ADhJU+xkF790x06twg+ISisFYA5kPrZRT+cArRKWl80LMlxLpYJurJ6ZqmN0 bZ82Ej7RgNGhdQPCxzHrnQkMo1GCAnUuxfjPJOnf+AkHeQyRR/yThzvOLkW2btT3KEGPkihhvVA yvl6VmSGpkNiwLKAnws5Niqnq1I1wL7jGo+QRuOhSk7FlCgUAckdP4aeFqX3u3qx3zNj7BAkqp/ DcjgJx0cu/m3emNy+JKrZbZNuVwOZ5EIsYpy0niCtcjho5kyoiYIqCQfWR11K1Wm+urPbGSm9G2 tq/TrNJSgUUK3fawqte11AQWUqBpKWocITGCofrOS15kxwVnniMWYPZ45cNTd5M8o1SBaR+KqV/ wJ7WdfgABIRpqco6zTMr5yLzQW4Ka7S/ywNKoOjIv962gZv6YZC4JohqO0b06LjyEuCeHkYiLWd s0fMmvXY7CyafClWWmKltPnrJlpbBwMLd/HBpmgdag2+OYN8iDtu3cOjQ27ubMeeHCIUgbqr4ia HqdVbb6ANHlIysbGik39Qr2kP0aVUlYbEcG9/ChLV4SHe2bbq5l/RMQnjZnTKHS7+nYVXesqDQc L1r7pVT0CdmgVL7YEheQdm9L9c8AecXHL+YMvkjFCGfWe2+hvmfShf3ZiYdqQVPWb+FqXbUTHX7 ZaFEBx5Wg/UIetg== X-Developer-Key: i=luca@z3ntu.xyz; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PMI632 PMIC contains 5 PWM channels, 3 of which can be used for LEDs. For the LED pattern it doesn't have LUT like other PMICs but uses SDAM instead. This is not currently implemented in the driver but since LPG works fine without it, add support for the PMIC now. Acked-by: Pavel Machek Reviewed-by: Konrad Dybcio Signed-off-by: Luca Weiss --- drivers/leds/rgb/leds-qcom-lpg.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index 67f48f222109..51763ecb8c1e 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -1353,6 +1353,20 @@ static const struct lpg_data pm8994_lpg_data = { }, }; +/* PMI632 uses SDAM instead of LUT for pattern */ +static const struct lpg_data pmi632_lpg_data = { + .triled_base = 0xd000, + + .num_channels = 5, + .channels = (const struct lpg_channel_data[]) { + { .base = 0xb300, .triled_mask = BIT(7) }, + { .base = 0xb400, .triled_mask = BIT(6) }, + { .base = 0xb500, .triled_mask = BIT(5) }, + { .base = 0xb600 }, + { .base = 0xb700 }, + }, +}; + static const struct lpg_data pmi8994_lpg_data = { .lut_base = 0xb000, .lut_size = 24, @@ -1436,6 +1450,7 @@ static const struct of_device_id lpg_of_table[] = { { .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data }, { .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data }, { .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data }, + { .compatible = "qcom,pmi632-lpg", .data = &pmi632_lpg_data }, { .compatible = "qcom,pmi8994-lpg", .data = &pmi8994_lpg_data }, { .compatible = "qcom,pmi8998-lpg", .data = &pmi8998_lpg_data }, { .compatible = "qcom,pmc8180c-lpg", .data = &pm8150l_lpg_data }, -- 2.40.0