From patchwork Thu Jan 26 14:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 48714 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp296800wrn; Thu, 26 Jan 2023 06:24:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXsg4d0A4hdRBtq8UJhCL29r6FbPpJDr2TAbzCTOnbdLpr8jERrvSmjCQ36bwrHyZ42CoX4x X-Received: by 2002:a17:907:1110:b0:872:bb39:a6e1 with SMTP id qu16-20020a170907111000b00872bb39a6e1mr36664105ejb.52.1674743074705; Thu, 26 Jan 2023 06:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674743074; cv=none; d=google.com; s=arc-20160816; b=zsNYngEYSqSENlfq6wcdJ+aOCzhb1Q4dkjnrsKDEXuF7AIZJGy8Mjt6AIYWxaPkNGw A7f6QSqdtxHSqLfGvx+zjyz7/NmhDtq9HFxBxXAo2PsmS8il7PxNt69cfU1y9BMklO2x NKNmmVQDo6syg9S77Fcfdvjw9AsoFv+xLZr8e9+eLK12FEsoxDDoRJnQrOhzewYTis8Q KOKcNMNjF/F5giG7PoHZtUGgC0F/+cEuHFsGc0zMs87alM8wYNUG9QeaNVrKcQ7A6Ovs cLfpYexrAienxX0IS0ijpzCe050rAjYeN33iUker9SCbPk/zE2+qxwPPf3FxjEAvK6T3 8pEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XLkxmDTG6dvT5xcTSlQXIbY0X3Vo9HrvaU3pkclajCk=; b=IZprxskw0ErUahTihtqo4g0f1H5t3kdKiws8QDBDslSLILmkpz6QaEIp1/ZQ+GjaGa Sjona48lX4cGUW+VHE5e+/cPBlE/5BsLJB6Z9Wfc/qbaVks5bGt/vz2LXwNzM4Qb1Wiq a5DlZnZQSXt79+IqYZE0asvRGqMNdGa8R0WE5iHQGWu+l6rqA1qIuLUKgt9i4bXYPzq5 guBeqGsHMHlrzWwqWOZWvrYEtHKqwP4C/73MZM0XsISN5Pal7RDCDIwUcZZAtcVUwJRr Nkh9YBnf2lTK9ycnHUrSbTahIwlIm23UdQ5K+uyL2P+KW7V95IpzMK3YAQ6tSAWzAazm U9/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y2P++exf; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn19-20020a1709070d1300b0087777bb4127si1861762ejc.172.2023.01.26.06.24.10; Thu, 26 Jan 2023 06:24:34 -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=@kernel.org header.s=k20201202 header.b=Y2P++exf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbjAZOXh (ORCPT + 99 others); Thu, 26 Jan 2023 09:23:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbjAZOXD (ORCPT ); Thu, 26 Jan 2023 09:23:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E03DD1D932; Thu, 26 Jan 2023 06:23:00 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7022AB81DF1; Thu, 26 Jan 2023 14:22:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1158CC43335; Thu, 26 Jan 2023 14:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674742978; bh=WgIpMYi4FWB9ExPnYPbTqydDNPPFYwbTWNzEsRMkHfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2P++exfhCPS0wl63NfNlZ9YTF6VV4ZmZvL2VWcAMqTbPOuagVa/Sr1rEJOCUDJB2 8/sV9t+VcsLmLR3hDIuEwQjOC0Qy9SPfnffxUx8E+Iqd3hrRieU2nd1FUbbwgItkOf kltAkxHnKaDgV7ItPF0wptnJPqaJZaxusnLf45/yILWIBMnAoxlfLcCZYPfkDLQ3O5 hnjhKC1jZqiVaaDkuNPHYafSNyXx+PsLJ0V74KfrtE9nRJyhUPuh8+MuRs66y66hiB ANKnLvvbCL6Q+OmLTkwEJBCoWtStshKXpxHtC/yWOlteSPHQeAjLbe42N/5yHbAggq QUU7aF07HNL2A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pL39c-0006ig-Ui; Thu, 26 Jan 2023 15:23:04 +0100 From: Johan Hovold To: Alexandre Belloni , Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , Alessandro Zummo , Rob Herring , Krzysztof Kozlowski , Maximilian Luz , linux-arm-msm@vger.kernel.org, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 11/24] rtc: pm8xxx: clean up comments Date: Thu, 26 Jan 2023 15:20:44 +0100 Message-Id: <20230126142057.25715-12-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230126142057.25715-1-johan+linaro@kernel.org> References: <20230126142057.25715-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756095394022593302?= X-GMAIL-MSGID: =?utf-8?q?1756095394022593302?= Clean up the driver comments somewhat and remove obsolete, incorrect or redundant ones. Signed-off-by: Johan Hovold --- drivers/rtc/rtc-pm8xxx.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index ea867b20573a..8a94a19e0d14 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -23,13 +23,13 @@ /** * struct pm8xxx_rtc_regs - describe RTC registers per PMIC versions - * @ctrl: base address of control register - * @write: base address of write register - * @read: base address of read register - * @alarm_ctrl: base address of alarm control register - * @alarm_ctrl2: base address of alarm control2 register - * @alarm_rw: base address of alarm read-write register - * @alarm_en: alarm enable mask + * @ctrl: address of control register + * @write: base address of write registers + * @read: base address of read registers + * @alarm_ctrl: address of alarm control register + * @alarm_ctrl2: address of alarm control2 register + * @alarm_rw: base address of alarm read-write registers + * @alarm_en: alarm enable mask */ struct pm8xxx_rtc_regs { unsigned int ctrl; @@ -42,12 +42,12 @@ struct pm8xxx_rtc_regs { }; /** - * struct pm8xxx_rtc - rtc driver internal structure - * @rtc: rtc device for this driver. - * @regmap: regmap used to access RTC registers - * @allow_set_time: indicates whether writing to the RTC is allowed + * struct pm8xxx_rtc - RTC driver internal structure + * @rtc: RTC device + * @regmap: regmap used to access registers + * @allow_set_time: whether the time can be set * @alarm_irq: alarm irq number - * @regs: rtc registers description. + * @regs: register description * @dev: device structure */ struct pm8xxx_rtc { @@ -90,7 +90,7 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) if (rc) return rc; - /* Disable RTC H/w before writing on RTC register */ + /* Disable RTC */ rc = regmap_update_bits(rtc_dd->regmap, regs->ctrl, PM8xxx_RTC_ENABLE, 0); if (rc) return rc; @@ -111,7 +111,7 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) if (rc) return rc; - /* Enable RTC H/w after writing on RTC register */ + /* Enable RTC */ rc = regmap_update_bits(rtc_dd->regmap, regs->ctrl, PM8xxx_RTC_ENABLE, PM8xxx_RTC_ENABLE); if (rc) @@ -242,7 +242,7 @@ static int pm8xxx_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) if (rc) return rc; - /* Clear Alarm register */ + /* Clear alarm register */ if (!enable) { rc = regmap_bulk_write(rtc_dd->regmap, regs->alarm_rw, value, sizeof(value)); @@ -269,13 +269,13 @@ static irqreturn_t pm8xxx_alarm_trigger(int irq, void *dev_id) rtc_update_irq(rtc_dd->rtc, 1, RTC_IRQF | RTC_AF); - /* Clear the alarm enable bit */ + /* Disable alarm */ rc = regmap_update_bits(rtc_dd->regmap, regs->alarm_ctrl, regs->alarm_en, 0); if (rc) return IRQ_NONE; - /* Clear RTC alarm register */ + /* Clear alarm status */ rc = regmap_update_bits(rtc_dd->regmap, regs->alarm_ctrl2, PM8xxx_RTC_ALARM_CLEAR, 0); if (rc) @@ -332,9 +332,6 @@ static const struct pm8xxx_rtc_regs pmk8350_regs = { .alarm_en = BIT(7), }; -/* - * Hardcoded RTC bases until IORESOURCE_REG mapping is figured out - */ static const struct of_device_id pm8xxx_id_table[] = { { .compatible = "qcom,pm8921-rtc", .data = &pm8921_regs }, { .compatible = "qcom,pm8058-rtc", .data = &pm8058_regs }, @@ -382,7 +379,6 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); - /* Register the RTC device */ rtc_dd->rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc_dd->rtc)) return PTR_ERR(rtc_dd->rtc); @@ -390,7 +386,6 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) rtc_dd->rtc->ops = &pm8xxx_rtc_ops; rtc_dd->rtc->range_max = U32_MAX; - /* Request the alarm IRQ */ rc = devm_request_any_context_irq(&pdev->dev, rtc_dd->alarm_irq, pm8xxx_alarm_trigger, IRQF_TRIGGER_RISING,