From patchwork Mon Aug 1 14:37:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 12933817 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 DB90FC19F2B for ; Mon, 1 Aug 2022 14:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232626AbiHAOiZ (ORCPT ); Mon, 1 Aug 2022 10:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232580AbiHAOiY (ORCPT ); Mon, 1 Aug 2022 10:38:24 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1B9433435; Mon, 1 Aug 2022 07:38:19 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id E1BC15FD15; Mon, 1 Aug 2022 17:38:16 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1659364696; bh=o7OLgDbo1xqFLNJ+G6hOVPrGDC+uPcvGgiUc/M2WLx8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=NVw/bqmCbnvrKQnptbzoNJOPXxc6YZ5d1oKKCq9CUY9NL2HzrrXMnUtmWqJbDWdkm 5qMRk1tVqfH4jZiIlJgRVkq5bjOefzXV+MsgeUfPd9BMG2IpQFqzvuyun8+zGjU6Jy 8GTg4LVgjsnTtZOmQOFDRNwHlX/mrqFD3rxJOanT/TKjM1J37c2gdRO1/Dx+Hc6re9 ZstnPdU/jB1c2gWzPGhdxNEQ0pYLd4BXGCNOLzJCUusXV00+Jxl1XPdyGqVZedmkGL YgodkFEPclrgGwgqqVWmSkMgbCdzIeN/leS3RQuWGeNfGHHczLWgV7ZqNyhUNe3ttE jxZaTWEAqssig== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mail.sberdevices.ru (Postfix) with ESMTP; Mon, 1 Aug 2022 17:38:14 +0300 (MSK) From: Dmitry Rokosov To: "akpm@linux-foundation.org" , "andriy.shevchenko@linux.intel.com" , "daniel.lezcano@linaro.org" , "jic23@kernel.org" , "wsa@kernel.org" , "andy.shevchenko@gmail.com" , "lars@metafoo.de" , "Michael.Hennerich@analog.com" , "jbhayana@google.com" CC: "linux-iio@vger.kernel.org" , kernel , "linux-kernel@vger.kernel.org" , Dmitry Rokosov Subject: [PATCH v3 0/3] units: complement the set of Hz units Thread-Topic: [PATCH v3 0/3] units: complement the set of Hz units Thread-Index: AQHYpbQ2WkEHos67cUaK7wL1TIYVMw== Date: Mon, 1 Aug 2022 14:37:23 +0000 Message-ID: <20220801143811.14817-1-ddrokosov@sberdevices.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/01 10:27:00 #20025860 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org During msa311 accel IIO driver development https://lore.kernel.org/linux-iio/20220616104211.9257-1-ddrokosov@sberdevices.ru/ Andy requested to use proper units in the hz->ms calculation. Current units.h header doesn't have milli, micro and nano HZ coefficients, so some drivers (in the IIO subsystem) implement their own copies for that. The current patchset resolves such a problem and intoduces general MILLIHZ_PER_HZ, MICROHZ_PER_HZ and NANOHZ_PER_HZ definitions in the units.h, and fixes all drivers which duplicate these units. Changes: * v2->v3: - changed UHZ_PER_HZ to MICROHZ_PER_HZ and NHZ_PER_HZ to NANOHZ_PER_HZ to save name consistency for all new HZ units * v1->v2: - changed MHZ_PER_HZ to a different name as Andy suggested (suppose MILLIHZ_PER_HZ is good enough) Dmitry Rokosov (3): units: complement the set of Hz units iio: accel: adxl345: use HZ macro from units.h iio: common: scmi_sensors: use HZ macro from units.h drivers/iio/accel/adxl345_core.c | 7 ++++--- drivers/iio/common/scmi_sensors/scmi_iio.c | 8 ++++---- include/linux/units.h | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-)