Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32100865rwd; Fri, 7 Jul 2023 08:42:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlE+AlrfIkqHfji/So0rNxP0VWdywJ3jVCsmqStTlxPi784V/lmG4TAtp3b2MZ8rpTRO3WGx X-Received: by 2002:aa7:d8d2:0:b0:51d:d1ca:eab9 with SMTP id k18-20020aa7d8d2000000b0051dd1caeab9mr3880915eds.32.1688744520138; Fri, 07 Jul 2023 08:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688744520; cv=none; d=google.com; s=arc-20160816; b=ziF17YN/1Xgn682AzQNsytRC2Ij+olCjlIOWmrxnJFQPCW4fMiTer35CzAPwq0VdYu NGU7fRyLawW0hUGCNAPHhzwlijZ/CeHB7YMVQnwkTa0m1X3GZ1bj9SaVZxbpa4+MXagY O+AQdn1P2Bit4o0buYE/toI4fdUfkvriME8zgKXHG0VaYMrJR3wwoK3w8TCBS4pC72v6 bYDkfAmGhpEjTZLV5yH0VtmPOFoBZk3pNlXoZyNQnDpSo/ArJLx1Ka6hE96Sr2zxTqQi G/37OaOPRGdPQwnFoM3bpfjljDtEJ6mEklHR4nbz+4nZ2cmU0p11kCVBolHEj4XcqFqT 7CRQ== 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:dkim-filter; bh=tCMbygVvzzTlGs7JB7+8QzsC2hT2UeK/Y0nWbTcHLKY=; fh=Nkpk7VjQstRrk/SIKeFB2DsfhHIA7OANQWPD54Aly/o=; b=lQehH5enqnZ3DPzz3ViiJm3RpWwBYMdqDg3n6LuUcOPf+Hqc7kPu1718wZeJAuoS5L 5u4rJdTEpbK0hjgQHTEFgx0AqYepFej10ilJS3uismtqJHI8ur6W8zbX8FW8GtnfBDzQ V7argDTSjZNJ1Y+Edp1zrH1ICgGLAMW3NGYO6z9szNOS2THjhUowvGoEoVdOWis1zBWB gMZDFY22NNfDknuodpIb51JxMovOuus0RqY6UdB7aRoS8ZHH+PMbSozp58pD+7RfEMa9 o5nOQqPEzsAAFNmllsNbS16QmLNiN1P+339ksbZLNe1lsuj0n59zIcSIKlrpoJ+kywNw h1aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=eL5SJO37; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a05640208c500b005162dcfac46si2269316edz.300.2023.07.07.08.41.33; Fri, 07 Jul 2023 08:42:00 -0700 (PDT) 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=@sberdevices.ru header.s=mail header.b=eL5SJO37; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232747AbjGGPdq (ORCPT + 99 others); Fri, 7 Jul 2023 11:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjGGPdj (ORCPT ); Fri, 7 Jul 2023 11:33:39 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A0F212C; Fri, 7 Jul 2023 08:33:35 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 05C63100006; Fri, 7 Jul 2023 18:33:33 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 05C63100006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688744013; bh=tCMbygVvzzTlGs7JB7+8QzsC2hT2UeK/Y0nWbTcHLKY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=eL5SJO37CM3Rp/aK5YMYCsCq+3s7z9keggDmpdPdehRTn4Tq0LE4feTh3X4Z2Mq6x oa3F1s3gOuq5z5C4zLpAy9o3VirKG91zeiRm/mnfi+uK+iDUuotzSTqa4IH+5lm1Rx LlRUEDnExZrzAsHddNGxt6Ilfbpq5tLmdfEy3CI24XlwGLLh9Vvipw5bx2rxNOs3qj A9Hkj88IIFkxhLd4aAbq4GrLgT/UuJQxtHAFvXagc/Uy6FUqfLB4ywUNj5+FU42x/z sm7FdcgP8nts790nmZrqdUDXXgv4VK02t0ZU3obZmxDPNBvq7++H/Aa324nc3cXe1q nu3yRV9x219xg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Fri, 7 Jul 2023 18:33:32 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 7 Jul 2023 18:33:15 +0300 From: George Stark To: , , , , , , , , CC: , , , , , George Stark Subject: [PATCH v4 2/6] iio: adc: meson: move enums declaration before variables declaration Date: Fri, 7 Jul 2023 18:27:39 +0300 Message-ID: <20230707153322.114302-3-gnstark@sberdevices.ru> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230707153322.114302-1-gnstark@sberdevices.ru> References: <20230707153322.114302-1-gnstark@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178491 [Jul 07 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: GNStark@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;100.64.160.123:7.1.2;sberdevices.ru:7.1.1,5.0.1;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/07 03:24:00 #21575635 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Allow to use enum items for variables initialization. Signed-off-by: George Stark --- drivers/iio/adc/meson_saradc.c | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 569ffc178935..98b6697a21f6 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -202,6 +202,28 @@ .datasheet_name = "TEMP_SENSOR", \ } +enum meson_sar_adc_avg_mode { + NO_AVERAGING = 0x0, + MEAN_AVERAGING = 0x1, + MEDIAN_AVERAGING = 0x2, +}; + +enum meson_sar_adc_num_samples { + ONE_SAMPLE = 0x0, + TWO_SAMPLES = 0x1, + FOUR_SAMPLES = 0x2, + EIGHT_SAMPLES = 0x3, +}; + +enum meson_sar_adc_chan7_mux_sel { + CHAN7_MUX_VSS = 0x0, + CHAN7_MUX_VDD_DIV4 = 0x1, + CHAN7_MUX_VDD_DIV2 = 0x2, + CHAN7_MUX_VDD_MUL3_DIV4 = 0x3, + CHAN7_MUX_VDD = 0x4, + CHAN7_MUX_CH7_INPUT = 0x7, +}; + static const struct iio_chan_spec meson_sar_adc_iio_channels[] = { MESON_SAR_ADC_CHAN(0), MESON_SAR_ADC_CHAN(1), @@ -225,28 +247,6 @@ static const struct iio_chan_spec meson_sar_adc_and_temp_iio_channels[] = { MESON_SAR_ADC_TEMP_CHAN(8), }; -enum meson_sar_adc_avg_mode { - NO_AVERAGING = 0x0, - MEAN_AVERAGING = 0x1, - MEDIAN_AVERAGING = 0x2, -}; - -enum meson_sar_adc_num_samples { - ONE_SAMPLE = 0x0, - TWO_SAMPLES = 0x1, - FOUR_SAMPLES = 0x2, - EIGHT_SAMPLES = 0x3, -}; - -enum meson_sar_adc_chan7_mux_sel { - CHAN7_MUX_VSS = 0x0, - CHAN7_MUX_VDD_DIV4 = 0x1, - CHAN7_MUX_VDD_DIV2 = 0x2, - CHAN7_MUX_VDD_MUL3_DIV4 = 0x3, - CHAN7_MUX_VDD = 0x4, - CHAN7_MUX_CH7_INPUT = 0x7, -}; - struct meson_sar_adc_param { bool has_bl30_integration; unsigned long clock_rate; -- 2.38.4