From patchwork Tue Feb 22 05:55:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Satya Priya Kakitapalli (Temp)" X-Patchwork-Id: 12754560 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 124CEC43219 for ; Tue, 22 Feb 2022 05:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbiBVF4M (ORCPT ); Tue, 22 Feb 2022 00:56:12 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:54298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbiBVF4K (ORCPT ); Tue, 22 Feb 2022 00:56:10 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CBD1201BE; Mon, 21 Feb 2022 21:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1645509346; x=1677045346; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=0ksOiJLGWxcJlzgUf3AhgRE3ydAS4cZ3WITLkLEtnHg=; b=ycfCbne2GpedjJ15wtMd8jwOZVYNovZyQmIFiIXN91ni6/S7zefJIze+ GJceW43HDRnZacpdv9/PN8TgX5tJtjmWT4iBcZmMKUPRK18TwCpcVb8Hc VFkx91z3cs/JHBdv0j/APftiGWTm6dmfoDzLAGKi5iw5lD8lNvMWQZANn Q=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 21 Feb 2022 21:55:46 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 21:55:45 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Mon, 21 Feb 2022 21:55:45 -0800 Received: from c-skakit-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Mon, 21 Feb 2022 21:55:41 -0800 From: Satya Priya To: Bjorn Andersson , Pavel Machek , Rob Herring CC: Stephen Boyd , Matthias Kaehlcke , , , , , "Doug Anderson" , Satya Priya Subject: [PATCH V4 2/4] leds: Add pm8350c support to Qualcomm LPG driver Date: Tue, 22 Feb 2022 11:25:07 +0530 Message-ID: <1645509309-16142-3-git-send-email-quic_c_skakit@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1645509309-16142-1-git-send-email-quic_c_skakit@quicinc.com> References: <1645509309-16142-1-git-send-email-quic_c_skakit@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add pm8350c compatible and lpg_data to the driver. Signed-off-by: Satya Priya Reviewed-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Tested-by: Douglas Anderson --- Changes in V2: - Added const for lpg_channel_data[] struct. Changes in V3: - Correct the num_channels and add respective base addresses. Changes in V4: - Remove .pwm_9bit_mask, add .triled_base and .triled_mask. drivers/leds/rgb/leds-qcom-lpg.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/leds/rgb/leds-qcom-lpg.c b/drivers/leds/rgb/leds-qcom-lpg.c index c1ad678..ab29610 100644 --- a/drivers/leds/rgb/leds-qcom-lpg.c +++ b/drivers/leds/rgb/leds-qcom-lpg.c @@ -1374,9 +1374,22 @@ static const struct lpg_data pm8150l_lpg_data = { }, }; +static const struct lpg_data pm8350c_pwm_data = { + .triled_base = 0xef00, + + .num_channels = 4, + .channels = (const struct lpg_channel_data[]) { + { .base = 0xe800, .triled_mask = BIT(7) }, + { .base = 0xe900, .triled_mask = BIT(6) }, + { .base = 0xea00, .triled_mask = BIT(5) }, + { .base = 0xeb00 }, + }, +}; + static const struct of_device_id lpg_of_table[] = { { .compatible = "qcom,pm8150b-lpg", .data = &pm8150b_lpg_data }, { .compatible = "qcom,pm8150l-lpg", .data = &pm8150l_lpg_data }, + { .compatible = "qcom,pm8350c-pwm", .data = &pm8350c_pwm_data }, { .compatible = "qcom,pm8916-pwm", .data = &pm8916_pwm_data }, { .compatible = "qcom,pm8941-lpg", .data = &pm8941_lpg_data }, { .compatible = "qcom,pm8994-lpg", .data = &pm8994_lpg_data },