Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp897645pxk; Mon, 31 Aug 2020 04:30:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwv8STGjILMCgDvF/B6uzh1L+grCOVwV21WTuRHI5Il4WQXZeQfmawvLcErNCDrm955JxEY X-Received: by 2002:a50:9fe6:: with SMTP id c93mr771893edf.151.1598873445497; Mon, 31 Aug 2020 04:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598873445; cv=none; d=google.com; s=arc-20160816; b=YK1JR1SCQYIRoeyzpFWlTivMs5D36iqN5vVep2E8JJdOOVxpqMIWb9HUA0UHdXf784 0N+rG7QJBoc3xtlS2PYG/DkCe9eZJfN1UaULkU+kXWA9LS4JdPyiE9Fp4e1MiblBbp1T eUuQb1fkQd1dHeY9E7liZNk09OEVwAqcGbaXbGZD4tIiB6VHAptBwWlWQ7/xalqGLoSl yCRJo3p6AArjetYoW7BWHlx5pfv7CE9TvyTHdErrqpWFYW/ga9wlf4eP8CTsJmkv5cHg kbKNr3jpoGuDlnXIKc/C4x1S5ZS45rDiAxIXxi2bIq8h14oLxelZXEcqoKFyXFWAN+f0 UOdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=LhN4MEZnLhxwqtEvbg9M8rI4TEeNm+HHA6gC8mB3z/I=; b=p5GfE8jiokD4M9FOxa9fnPXSjZ5E+IUYXQYL3/8AKuEw1MZE86SKO70HM1WgiTqx4i H/zYZ5tkkVeuO7kn7kHvIfRIQGxvTZ31SFyXVwYjhEU3e5k5cqL6XaBd65q6ADVenber 8I3335X2RSMMivQqOgVMI35UCKnVh7HZjqLVQnM1t+GHyAeHZQejJAx8+2n+fKvwRV/4 /5UxKbi0wPyE6Qv9vLOnsTX0EBzg0uyKe5Z1z0ohvr7eeWUmFDdDJwmxyRGfwo7O1aTQ 48tNKfUhz8/31MADl808u5uTTAmtUC2LY02C5c49QFOV3IChmJVTQm8yGbjdxvyvySVh CMew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si5430268ejd.324.2020.08.31.04.30.22; Mon, 31 Aug 2020 04:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgHaL3p convert rfc822-to-8bit (ORCPT + 99 others); Mon, 31 Aug 2020 07:29:45 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:39917 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727799AbgHaL2x (ORCPT ); Mon, 31 Aug 2020 07:28:53 -0400 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kChzW-0003Do-UZ for linux-kernel@vger.kernel.org; Mon, 31 Aug 2020 11:28:50 +0000 Received: by mail-wr1-f69.google.com with SMTP id l17so3086567wrw.11 for ; Mon, 31 Aug 2020 04:28:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=k+4/Yx6DeQldeglbS376dNJoVgOKnSc5ajKOtdzMws4=; b=e6+GbnZk8ReLcGRsLHHg19i2MK6JZPgu0/N1aB51ipJKIlL7phJWbNjlygze1PHBzU AMBNxPYSUJxnzoQooEzlG7PGne/dV84/+iMv/USOiKNm7XFs92PUrvkl5x2DSi5uIrFM VRB4IKMes+L87wXvYUWydvIteQ4UFOq+nUBFj7DlLTPj3R3qtHD1Wda6pOcUpFVTggfL B8tveY9ehEfWpWXH3sS7/AbToaOPCDwfRMwlt25pyfDDYR4wsppbwA+AnG7fT4Kao8xW Od6/w/84qmmSkaidvpjrEkA+JNndgnbQaoiF4qBQC0uyYUuYYDpKxRhKRJBiGD+caXpo kmZA== X-Gm-Message-State: AOAM530UB5yDVBqdtj4QkPJJ2H2A3HpTODfp+uFCD2Vrl/kqg7C6zeQu 1seUzfvQo+U0MjAyTTZkO4I95WPMapbm0z48emqyIpghtz2P8svPOR6jof1jnmjtdPKJS00K5LL JOD2QKfvnhWG/upjC7VLElbBBZc032YT+odfKJ4geqyswplJ1PG5K9OrI/g== X-Received: by 2002:a5d:6910:: with SMTP id t16mr1345544wru.178.1598873328736; Mon, 31 Aug 2020 04:28:48 -0700 (PDT) X-Received: by 2002:a5d:6910:: with SMTP id t16mr1345532wru.178.1598873328545; Mon, 31 Aug 2020 04:28:48 -0700 (PDT) MIME-Version: 1.0 References: <20200824054347.3805-1-william.sung@advantech.com.tw> In-Reply-To: From: AceLan Kao Date: Mon, 31 Aug 2020 19:28:37 +0800 Message-ID: Subject: Re: [PATCH] iio: dac: ad5593r: Dynamically set AD5593R channel modes To: Andy Shevchenko Cc: William Sung , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , linux-iio , Linux Kernel Mailing List , Campion Kang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jonathan and Andy, This patch is mainly for Advantech's UNO-420[1] which is a x86-based platform. This platform is more like a development platform for customers to customize their products, so, specify the channel modes in ACPI table is not generic enough, that's why William submit this patch. Are there other ways to specify or pass values to the module without using module parameters? It's good if we can leverage sysfs, but I don't know if there is one for this scenario. 1. https://www.advantech.com/products/9a0cc561-8fc2-4e22-969c-9df90a3952b5/uno-420/mod_2d6a546b-39e3-4bc4-bbf4-ac89e6b7667c Andy Shevchenko 於 2020年8月31日 週一 上午1:07寫道: > > On Mon, Aug 24, 2020 at 8:54 AM William Sung > wrote: > > > > To use ad5593r more flexibly, we use the module parameter to setting the > > channel modes dynamically whenever the module probe up. > > > Users can pass > > the channel modes to the module parameter for allocating the > > functionality of channels as desired. > > NAK. We have a sysfs interface. > > > For example: > > * Use in the kernel command line: > > Users can add the module parameter in the kernel command line such as > > > > "ad5593r.ch_mode_cmdline=88001122" > > > > "88001122" means the channel mode setting for each channel. The most > > left side indicates the mode of channel 7, and the most right side > > indicates the mode of channel 0. > > > > * Use when manually probe the module: > > Similar to the kernel command line usage, users can enter > > > > "modprobe ad5593r ch_mode_probe=88001122" > > > > to start the ad5593r module with the desired channel mode setting. > > Again NAK, this basically should come from Device Tree or ACPI. > > -- > With Best Regards, > Andy Shevchenko