Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp588452rwb; Tue, 29 Nov 2022 02:45:49 -0800 (PST) X-Google-Smtp-Source: AA0mqf7PqwTp8yDtnOdYsygXbdcAx8I/qrqySrki/jL8tjH6i5aOywIURoclO2kYop9fS20rJ9Mq X-Received: by 2002:a05:6402:548a:b0:468:e8e2:31c9 with SMTP id fg10-20020a056402548a00b00468e8e231c9mr25378553edb.310.1669718749415; Tue, 29 Nov 2022 02:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669718749; cv=none; d=google.com; s=arc-20160816; b=EFo3h/feazNhesxgLaxY/KxV6v+ndk9Zd+nU2duitsbHxabV9sWA5dWtOtLx8+xPeX syl0YhI6M0jqAwtfzj2XmR2jxGCqSlMbvAnt6EQxqXF9JbiWj9BhAS8pPisIwhtRpCct xXyfjHj0Ax0k6JhEH+gVsT8+wyOiUL9gNylB8bv+me0MP8lKz+7bM09v/gl3JyXflra9 9WUSB/DVYp7qFkzDHxq5T+Kxsd/hiPsqOoLg/dq8nTOjs5eBRqiZtpv4dg2LaLaOe4L9 7ejiMIEnJ9rkBEEhbbOGFzAecgGciK73z9+6OxhlAfHD4TBr3nydc1It6oxsm9yQRtDY LT/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=49Ttj4zeLRKtXUQ2iiLm1EzCQ/EuPogtM4kufqhs5Uc=; b=U96SSDNpZR0nD008tPj+EgM1KQ3AecwOAYvi1+BDh94YQ78TKxsjZEIZntzLTCoK/d 6njL7AUbl366dK61Asbj8mkkkyHSLJOsXhEA8yhGnNrh6OSeX/nFNOtvCu09L9Vl/c5d 5iE1WRVX3ULVgOiF0KRforPyTKs9RFm2IVQOwXCQFfIqhAfI2Ii2MRSkF1PufU3zXsIH l6UyUAA0EKbOIsVdLOwpmDSp3+nmPLEYcPqP7tXEwOdA0pZ8VZkLRXc1J653YQysWMsL 9u+pKqV8rsO/QBgja7+0dnx1WMeZDrmZVdy0LhorpoyR3emAeW/ro+/yahlLy4X/qMPZ arNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=UBXDWgGo; 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=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js6-20020a17090797c600b0078d20d71475si13330129ejc.413.2022.11.29.02.45.26; Tue, 29 Nov 2022 02:45:49 -0800 (PST) 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=@quicinc.com header.s=qcppdkim1 header.b=UBXDWgGo; 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=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbiK2Kh5 (ORCPT + 84 others); Tue, 29 Nov 2022 05:37:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbiK2Khl (ORCPT ); Tue, 29 Nov 2022 05:37:41 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BB96BC8; Tue, 29 Nov 2022 02:37:38 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AT9pNxj007856; Tue, 29 Nov 2022 10:36:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=49Ttj4zeLRKtXUQ2iiLm1EzCQ/EuPogtM4kufqhs5Uc=; b=UBXDWgGoUszM01aQDbG1N66lp30hi4FdoDDlTawTwaAKq6yOZP1QzzSap5pUBRCncdUR Nlp7uHJPvPbSaWEvVNtJzHkIO7mP6Qks5s2l4/AP/I6K5W44tr4IY6MxvIMWZ4+vtoWx YkHVYE1XuK7X04H6k06cCPRix6JX+kTlCm8C0ZlkRM/xIsxhK9hZsB3iLBlbTAA+C8gH KVvv92hrKAAjoC9dwvslCLel29Wh+BauNdGCmUzjbNlhHq3IcueYzC/ZTZmb5akMzPPR xSKw+Hy8Q4vKbKeamnF9EX7orNjDaYsCpouEt1vJFHZ9DJQhRs9MKhjwY719UdDHTw30 Fw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3m56c69h3v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 10:36:44 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2ATAahE9020469 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 10:36:43 GMT Received: from [10.216.62.111] (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.36; Tue, 29 Nov 2022 02:36:38 -0800 Message-ID: <3b00c04c-cb6d-9e9a-ba0c-0ce093b4a3fb@quicinc.com> Date: Tue, 29 Nov 2022 16:05:41 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] ASoC: qcom: lpass-sc7180: Add system suspend/resume PM ops Content-Language: en-US To: Geert Uytterhoeven CC: , , , , , , , , , , , , , , , , References: <1669621742-28524-1-git-send-email-quic_srivasam@quicinc.com> From: Srinivasa Rao Mandadapu Organization: Qualcomm In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: y7qbBzVgVThROMFrnCjQzpa-c2HaquO_ X-Proofpoint-GUID: y7qbBzVgVThROMFrnCjQzpa-c2HaquO_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-29_07,2022-11-29_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211290065 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 Hi Geert, Thanks for your time!!! On 11/29/2022 1:23 PM, Geert Uytterhoeven wrote: > Hi Srinivasa, > > On Mon, Nov 28, 2022 at 8:50 AM Srinivasa Rao Mandadapu > wrote: >> Update lpass sc7180 platform driver with PM ops, such as >> system supend and resume callbacks. >> This update is required to disable clocks during supend and >> avoid XO shutdown issue. >> >> Signed-off-by: Srinivasa Rao Mandadapu >> Tested-by: Rahul Ajmeriya > Thanks for your patch, which is now commit 2d68148f8f85ca5a ("ASoC: > qcom: lpass-sc7180: Add system suspend/resume PM ops") in next-20221129. > >> --- a/sound/soc/qcom/lpass-sc7180.c >> +++ b/sound/soc/qcom/lpass-sc7180.c >> @@ -12,6 +12,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -156,10 +157,34 @@ static int sc7180_lpass_exit(struct platform_device *pdev) >> struct lpass_data *drvdata = platform_get_drvdata(pdev); >> >> clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); >> + return 0; >> +} >> + >> +static int sc7180_lpass_dev_resume(struct device *dev) >> +{ >> + int ret = 0; >> + struct lpass_data *drvdata = dev_get_drvdata(dev); >> >> + ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks); >> + if (ret) { >> + dev_err(dev, "sc7180 clk prepare and enable failed\n"); >> + return ret; >> + } >> + return ret; >> +} >> + >> +static int sc7180_lpass_dev_suspend(struct device *dev) >> +{ >> + struct lpass_data *drvdata = dev_get_drvdata(dev); >> + >> + clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks); >> return 0; >> } > noreply@ellerman.id.au reports for e.g. m68k-allmodconfig: > > sound/soc/qcom/lpass-sc7180.c:179:12: error: > 'sc7180_lpass_dev_suspend' defined but not used > [-Werror=unused-function] > sound/soc/qcom/lpass-sc7180.c:166:12: error: > 'sc7180_lpass_dev_resume' defined but not used > [-Werror=unused-function] > >> +static const struct dev_pm_ops sc7180_lpass_pm_ops = { >> + SET_SYSTEM_SLEEP_PM_OPS(sc7180_lpass_dev_suspend, sc7180_lpass_dev_resume) >> +}; > Please use DEFINE_SIMPLE_DEV_PM_OPS()... Actually, we need to use this patch in in previous kernels 5.4 and 5.15. I think these changes won't apply on previous kernel. Hence ignoring for now and will take care next time. > >> + >> static struct lpass_variant sc7180_data = { >> .i2sctrl_reg_base = 0x1000, >> .i2sctrl_reg_stride = 0x1000, >> @@ -293,6 +318,7 @@ static struct platform_driver sc7180_lpass_cpu_platform_driver = { >> .driver = { >> .name = "sc7180-lpass-cpu", >> .of_match_table = of_match_ptr(sc7180_lpass_cpu_device_id), >> + .pm = &sc7180_lpass_pm_ops, > ... and pm_sleep_ptr(). > >> }, >> .probe = asoc_qcom_lpass_cpu_platform_probe, >> .remove = asoc_qcom_lpass_cpu_platform_remove, > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds