Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1032357rda; Sun, 22 Oct 2023 23:17:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzbpyhTjG8yeC0/eObCWgPzvE4NEQ9xsVh6cuqh+H5r1WWuQUCcN6Q16zIlwREi+EtVn/j X-Received: by 2002:a17:903:27cd:b0:1c9:bca1:d70c with SMTP id km13-20020a17090327cd00b001c9bca1d70cmr5453002plb.30.1698041846242; Sun, 22 Oct 2023 23:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698041846; cv=none; d=google.com; s=arc-20160816; b=b3jfmR59VKfAJEHu/pj4qMIpj5AWwJRJO0cX9r0LEiiVZ/a/R09aiZDBwbObc+p7uN CRZsAeGURIdp7oD/MWnJEdt/nyJweZ6KwII8XCuMMw6Mb7f5GAfLlX4N1GtbxIszpNcf RA7bALqCb1LtdN0gbtpmRMvTOIAGgbCQ8vkuKPIA8jStRSmwvekIs5wbW9YIV4kCvvEW dNt1JFpdX1i3mSDRsDcMiw6b6kC7FAE1FPWfMWGHQL1rgvLuTsrZ3wiBc7L9AuW8VXPU 4kkqL5pKB2KgAQ2Ae44ZaFNsGp2fOfKiHPMTHbH0zgGJJNrmofJZXwRmPFY+scjuSiSe oioQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9tHPUSiSDmzQD1iZQ0eFe1roSph4jo63m+KHHJO3Czs=; fh=Ibd3ypeUrc7N+E+r+u8JCTM8LeHZKyB5uhL1AleVles=; b=sGt0vSeoTHFXUvK1dg8g0mBKs60yJdjhgjKHd89WvXvkGpyomL5Mh5778K16vu4mwv ZrxMY5wSWyJRvnLpiyhvOHzJwenvVe3X64O5n3TaGkas3q0f6FH0KSVjT+VXLvkAps15 NqPQkbTRN/rKzcP9Pm4ZS7lyfuGgxEgieLt32gg2a7OneKbR4pOzKlL24o3+3cykF+N+ PXXn9ghjDRDA1r766QmeRNoxz2rnENL/x/lTaZWBCRimyAWXlAhbCB/jjxODWzOhOx/8 wFa7rgB7u9e7UHTtnd6DsOzx9jFu7rmgImzz85K4m0TOzakzQQVh//IEIq5vFmhXv7kl ehgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eErNBa1h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x6-20020a170902a38600b001c9bf064b1bsi5591472pla.285.2023.10.22.23.17.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 23:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eErNBa1h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 832DB80755CB; Sun, 22 Oct 2023 23:17:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233252AbjJWGQy (ORCPT + 99 others); Mon, 23 Oct 2023 02:16:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbjJWGQw (ORCPT ); Mon, 23 Oct 2023 02:16:52 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D8B4D6B; Sun, 22 Oct 2023 23:16:49 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39N5sNYG014832; Mon, 23 Oct 2023 06:16:12 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=9tHPUSiSDmzQD1iZQ0eFe1roSph4jo63m+KHHJO3Czs=; b=eErNBa1hDtulLdHPfsbWJzIlb3wfvFPl1kcsmOjz+RKgIpMmPheP4JtSLeuKyWxT+mG2 zqQ5QtLBhDb3J+czg9iQK50pRtELNtUZfNo/33Q7PYI7Yt9eT5M03gFBVy5xGfJYxqJD Xw7E+o9oqgRvc0yJjYh5KE1KkyLo3xZbUnmk+9+Mg14EnDJHvP55t3VswozBid/S7cdx CHtP2hI2PIZ0Zau9wD0cqGAWwFKQLv3KhLxyicSE1CULBfq3ap1C4uZVPSd55oJvSp+h EQ0y1W0AhtIpo94gLRJzgIXiBOv8fpffKalnlsobMZs6px2c13do1tEeHEp11RV5YRNT rA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tv7xfujc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Oct 2023 06:16:12 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39N6GB1N013479 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Oct 2023 06:16:11 GMT Received: from [10.216.48.174] (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.1118.39; Sun, 22 Oct 2023 23:15:59 -0700 Message-ID: <0b07febb-5577-cac7-8b45-4d9c9790d4e2@quicinc.com> Date: Mon, 23 Oct 2023 11:45:54 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH 07/11] iio: adc: Add support for QCOM PMIC5 Gen3 ADC Content-Language: en-US To: Krzysztof Kozlowski , , , , , , , , , , , , , , Jonathan Cameron , Lars-Peter Clausen , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Cosmin Tanislav , Mike Looijmans , "Ramona Bolboaca" , ChiYuan Huang , Ibrahim Tilki , William Breathitt Gray , Lee Jones , =?UTF-8?Q?Leonard_G=c3=b6hrs?= , Haibo Chen , , CC: References: <20230708072835.3035398-1-quic_jprakash@quicinc.com> <20230708072835.3035398-8-quic_jprakash@quicinc.com> <0b5771b3-31b1-c17c-2be4-9b71538078bb@linaro.org> From: Jishnu Prakash In-Reply-To: <0b5771b3-31b1-c17c-2be4-9b71538078bb@linaro.org> 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: SydEPT3FAe4bMxqwKrDJK-X_1nMCyftH X-Proofpoint-GUID: SydEPT3FAe4bMxqwKrDJK-X_1nMCyftH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-23_03,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 suspectscore=0 phishscore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=783 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310230054 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 23:17:07 -0700 (PDT) Hi Krzysztof. On 7/9/2023 11:11 PM, Krzysztof Kozlowski wrote: > On 08/07/2023 09:28, Jishnu Prakash wrote: >> The ADC architecture on PMIC5 Gen3 is similar to that on PMIC5 Gen2, >> with all SW communication to ADC going through PMK8550 which >> communicates with other PMICs through PBS. One major difference is >> that the register interface used here is that of an SDAM present on > ... > > >> +static int adc5_gen3_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + struct iio_dev *indio_dev; >> + irq = platform_get_irq(pdev, i); >> + if (irq < 0) { >> + dev_err(adc->dev, "Failed to get SDAM%d irq, ret=%d\n", i, irq); >> + return irq; > return dev_err_probe Will update it in the next patchset > >> + } >> + adc->base[i].irq = irq; >> + >> + scnprintf(buf, sizeof(buf), "adc-sdam%d", i); >> + adc->base[i].irq_name = devm_kstrdup(adc->dev, buf, GFP_KERNEL); >> + if (!adc->base[i].irq_name) >> + return -ENOMEM; >> + } >> + >> + platform_set_drvdata(pdev, adc); >> + >> + init_completion(&adc->complete); >> + mutex_init(&adc->lock); >> + >> + ret = adc5_get_fw_data(adc); >> + if (ret < 0) { >> + dev_err(adc->dev, "adc get dt data failed, ret=%d\n", ret); > return dev_err_probe Will update it in the next patchset > >> + return ret; >> + } >> + >> + for (i = 0; i < adc->num_sdams; i++) { >> + ret = devm_request_irq(dev, adc->base[i].irq, adc5_gen3_isr, >> + 0, adc->base[i].irq_name, adc); >> + if (ret < 0) { >> + dev_err(adc->dev, "Getting IRQ %d failed, ret=%d\n", adc->base[i].irq, ret); > return dev_err_probe Will update it in the next patchset > >> + return ret; >> + } >> + } >> + >> + ret = adc_tm_register_tzd(adc); >> + if (ret < 0) >> + return ret; >> + >> + if (adc->n_tm_channels) >> + INIT_WORK(&adc->tm_handler_work, tm_handler_work); >> + >> + indio_dev->name = pdev->name; >> + indio_dev->modes = INDIO_DIRECT_MODE; >> + indio_dev->info = &adc5_gen3_info; >> + indio_dev->channels = adc->iio_chans; >> + indio_dev->num_channels = adc->nchannels; >> + >> + return devm_iio_device_register(dev, indio_dev); >> +} >> + >> +static int adc5_gen3_exit(struct platform_device *pdev) >> +{ >> + struct adc5_chip *adc = platform_get_drvdata(pdev); >> + u8 data = 0; >> + int i, sdam_index; >> + >> + mutex_lock(&adc->lock); >> + /* Disable all available channels */ >> + for (i = 0; i < adc->num_sdams * 8; i++) { >> + sdam_index = i / 8; >> + data = MEAS_INT_DISABLE; >> + adc5_gen3_write(adc, sdam_index, ADC5_GEN3_TIMER_SEL, &data, 1); >> + >> + /* To indicate there is an actual conversion request */ >> + data = ADC5_GEN3_CHAN_CONV_REQ | (i - (sdam_index * 8)); >> + adc5_gen3_write(adc, sdam_index, ADC5_GEN3_PERPH_CH, &data, 1); >> + >> + data = ADC5_GEN3_CONV_REQ_REQ; >> + adc5_gen3_write(adc, sdam_index, ADC5_GEN3_CONV_REQ, &data, 1); >> + } >> + >> + mutex_unlock(&adc->lock); >> + >> + if (adc->n_tm_channels) >> + cancel_work_sync(&adc->tm_handler_work); >> + >> + return 0; >> +} >> + >> +static struct platform_driver adc5_gen3_driver = { >> + .driver = { >> + .name = "qcom-spmi-adc5-gen3", >> + .of_match_table = adc5_match_table, >> + }, >> + .probe = adc5_gen3_probe, >> + .remove = adc5_gen3_exit, >> +}; >> +module_platform_driver(adc5_gen3_driver); >> + >> +MODULE_ALIAS("platform:qcom-spmi-adc5-gen3"); > Drop alias. If you need it, it means you screwed ID tables or your DTS. > > > Best regards, > Krzysztof OK, I guess it's not needed, will drop it in the next patchset. Thanks, Jishnu >