From patchwork Fri Dec 20 11:05:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 13916576 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B221BE77188 for ; Fri, 20 Dec 2024 11:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wmu/4zOWbBuCpkHWFD0uAd+81GA427MEC797EzlJ7GI=; b=3c/spDnmrMHVD9 p6sK8bR0FfZu/zP1cwmGOvdUfEcLq0AYp+vrIivORyS/QNoU20PKqDJAlU4zoJW5xb17scd55CRIO hOUdP7rQCMGBt6tWFXUSExEy43x4e9kTn5B69Uks6d0xQEkfuG9uxU7M+rEgkNTubJKc+Ivw0zrCJ q3tTWWXkTJUelIBlhKqxKGtIul2sdVA7Z1UvMy/w2jB+D+FMkRBV3lYLo36Rw389tN+yBYdHP6gkR Uco9RJZk5tRuLDySNZC6uorBM7fPDoL8nKhhWTIVM/QDl0Xb8nu5Nd7Mt1H3mD2wYyNL5Zk1nHQZc nttCaXO1wFhYawkUhBGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tOay1-00000004j4P-1RzZ; Fri, 20 Dec 2024 11:14:49 +0000 Received: from mail-m19731105.qiye.163.com ([220.197.31.105]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tOape-00000004fCF-19sH for linux-rockchip@lists.infradead.org; Fri, 20 Dec 2024 11:06:11 +0000 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 657291d6; Fri, 20 Dec 2024 19:06:07 +0800 (GMT+08:00) From: Kever Yang To: heiko@sntech.de Cc: linux-rockchip@lists.infradead.org, Simon Xue , Kever Yang Subject: [PATCH 11/38] iio: adc: rockchip_saradc: add rk3562 Date: Fri, 20 Dec 2024 19:05:31 +0800 Message-Id: <20241220110558.3511994-2-kever.yang@rock-chips.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241220110558.3511994-1-kever.yang@rock-chips.com> References: <20241220103825.3509421-1-kever.yang@rock-chips.com> <20241220110558.3511994-1-kever.yang@rock-chips.com> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZQkkeSlYaS0waTR9MGEJOHkNWFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSUhCSE NVSktLVUpCS0tZBg++ X-HM-Tid: 0a93e3bf06f903afkunm657291d6 X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6PzI6TAw4SzIRPghJGFEcSBwe KSEwCTxVSlVKTEhPTUJJTE1DSk1LVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFJS0NLNwY+ DKIM-Signature: a=rsa-sha256; b=Rh6ZUIPvFdrPFyZhUh2nLJBZgJu/Y7mPUHKjLxd4JgmSorkF04xdd9X4QJ7fOfpvO7ZCV2PoRkIjuYWfhEMITX9qQfZQkWscpWhVg/siOpvxrOYEroXpfxex6Hd/9KWWtCfleQ5brGYg3ITHqNtWbtoQabiVJKBI0NGjAs9yZZM=; s=default; c=relaxed/relaxed; d=rock-chips.com; v=1; bh=PWTpV5unBG06xQWRz5c8PNc7qqWDa9gYmL9khDtzsDU=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241220_030610_493430_95610704 X-CRM114-Status: UNSURE ( 7.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Simon Xue rk3562 is using v2 saradc with 8 channels. Signed-off-by: Simon Xue Signed-off-by: Kever Yang --- drivers/iio/adc/rockchip_saradc.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index 240cfa391674..7c8a9d37d245 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Rockchip Successive Approximation Register (SAR) A/D Converter - * Copyright (C) 2014 ROCKCHIP, Inc. + * Copyright (C) 2014 Rockchip Electronics Co., Ltd. */ #include @@ -275,6 +275,25 @@ static const struct rockchip_saradc_data rk3399_saradc_data = { .power_down = rockchip_saradc_power_down_v1, }; +static const struct iio_chan_spec rockchip_rk3562_saradc_iio_channels[] = { + SARADC_CHANNEL(0, "adc0", 10), + SARADC_CHANNEL(1, "adc1", 10), + SARADC_CHANNEL(2, "adc2", 10), + SARADC_CHANNEL(3, "adc3", 10), + SARADC_CHANNEL(4, "adc4", 10), + SARADC_CHANNEL(5, "adc5", 10), + SARADC_CHANNEL(6, "adc6", 10), + SARADC_CHANNEL(7, "adc7", 10), +}; + +static const struct rockchip_saradc_data rk3562_saradc_data = { + .channels = rockchip_rk3562_saradc_iio_channels, + .num_channels = ARRAY_SIZE(rockchip_rk3562_saradc_iio_channels), + .clk_rate = 1000000, + .start = rockchip_saradc_start_v2, + .read = rockchip_saradc_read_v2, +}; + static const struct iio_chan_spec rockchip_rk3568_saradc_iio_channels[] = { SARADC_CHANNEL(0, "adc0", 10), SARADC_CHANNEL(1, "adc1", 10), @@ -324,6 +343,9 @@ static const struct of_device_id rockchip_saradc_match[] = { }, { .compatible = "rockchip,rk3399-saradc", .data = &rk3399_saradc_data, + }, { + .compatible = "rockchip,rk3562-saradc", + .data = &rk3562_saradc_data, }, { .compatible = "rockchip,rk3568-saradc", .data = &rk3568_saradc_data,