Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp491967imm; Wed, 18 Jul 2018 05:54:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdfIQUK8QEKo6jICCw97H1D5q54vpMxPMAjNv+Mp2LrVvhcDxZ/T6VqBJXHXhBhrCR9KFb2 X-Received: by 2002:a63:161a:: with SMTP id w26-v6mr5823329pgl.257.1531918481050; Wed, 18 Jul 2018 05:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531918481; cv=none; d=google.com; s=arc-20160816; b=EVh+F4UxJEZMyt3vTP13gTOZT+oPszJYgyelaYfV1jWT+gCR5uHOz5Q9RfVsOFVcKp ANZdpCX8+fUzGu2CcwTys5ysAm6ikfEeSFmQYzY7j0KL5JRkZu/nquAeNSOwMH574BqN TradYqRzQKvp9SYVCs8NE3tvj8O82owkkbqSPDmDUM18Qd3moRVRRBblYv+1fAXlcKbH zAa/XAuQs/ylPCn6Gg+Rlkj2J0kNB3qvvgGMzpKPp6zIDgAQ4JvBT8nOokh1ABtV7I2X Mt0aEO6StYVdhBDKDldWnQmV5lUYqKXWQpxMiBEoTtrWoHQFDdiuGnpLLnUEHF6tapLF vXiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=yy9NuEp2a3Lb/eg2t3tQk40c8awhYgEVJX8wBqPeFuc=; b=KRIOeomXsKozEOZTTLyCNDVquUC6Ok4CCgjDBQov1izRSC38PGiDD+EERbEAprxCOJ TgtRq/q2ZeB24nnvNTmffQhCntIojlgZEyae03RorE4EWAqjQ87R85M+FCfsiB8cWJbf DmA12usESGPhj9ws4UrUw8v7g9aOoMLafL886HVRVJjteLDc66TTxyyO/gwin38iQpqD 9rs/47s4dT3CH1rBFLsrSkp5yeepWVTNBYclt3P3UzhvJf489ExIEVxR63RMTduzLNMw nnWrxjaFB1QN02SjVi4mbe6HUS+6tNk28kg7266O5QfX/v9DRnA2ye551gUzctxgieD8 CMvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@axentia.se header.s=selector1 header.b=fNHfprTm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si2980096plr.382.2018.07.18.05.54.26; Wed, 18 Jul 2018 05:54:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@axentia.se header.s=selector1 header.b=fNHfprTm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730888AbeGRNbX (ORCPT + 99 others); Wed, 18 Jul 2018 09:31:23 -0400 Received: from mail-db5eur01on0136.outbound.protection.outlook.com ([104.47.2.136]:42656 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729374AbeGRNbX (ORCPT ); Wed, 18 Jul 2018 09:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yy9NuEp2a3Lb/eg2t3tQk40c8awhYgEVJX8wBqPeFuc=; b=fNHfprTma9tDrZOoqdfwTN85cDdLCU+IJ13tRy6Gcj/fy76ofXTjtQNugYwRGzDYNWickmDnzdlbFObmzbAHsXnGacwuPhVlizgnu2Dc52ZAKA5aA3giq21KXaPpxmxgL69yzx6V1ZzdNUR2GFgsJFrOR+GWG2VM6EuW38KmuVA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from [192.168.13.3] (85.226.244.23) by VI1PR0201MB2461.eurprd02.prod.outlook.com (2603:10a6:800:54::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.19; Wed, 18 Jul 2018 12:49:45 +0000 Subject: =?UTF-8?Q?Re:_[PATCH_V2_1/2]_mux:_adgs1408:_new_driver_for_Analog_D?= =?UTF-8?Q?evices_ADGS1408/1409_mux_=e2=80=a6?= To: Mircea Caprioru Cc: davem@davemloft.net, mchehab+samsung@kernel.org, akpm@linux-foundation.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org References: <20180717134218.5642-1-mircea.caprioru@analog.com> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Wed, 18 Jul 2018 14:49:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180717134218.5642-1-mircea.caprioru@analog.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR05CA0253.eurprd05.prod.outlook.com (2603:10a6:3:fb::29) To VI1PR0201MB2461.eurprd02.prod.outlook.com (2603:10a6:800:54::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd379c97-84ff-4379-77d5-08d5ecacf0ea X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(7021125)(8989117)(5600053)(711020)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);SRVR:VI1PR0201MB2461; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2461;3:0g5fglPakcKPt4xMugtImsmTH75K161KSOZdNiaVJsdva8l3Irrgc/r96gZS7nkjCp0M4rlyaCPhPna6oVCreKmQmSCf58alAPAbB63PFgnpKMWuTACwUXFjufd0XRzblcfoZKtYyiaLgjoJtCZs/nonomvGdH4ZwvwNHXSM0RX76tCFvuTIuYlHoNlztdoBEFHDDkKbzg1NhbqbsYOSQdBk2WSBdXjRcABlIqUR2rerXrT+Gr8n91llPZJccDnl;25:4YWNZbvv61yN8G2tsUZ2pJHyu/0Q8RcA7hu+Fbk4NUq+DVt+EacK5AogiwX2s2esnlPdptVoCsT+xQB46pT80Ocy9pyeinlKxzb6343Blwd+BfvsJLeK2e3NgPcKHTK1aLEdlXxcqOb5uO8dgURUnTRxZoGzHZzvRrEonAKhIiNhMpG5IFFHoEnutb9z2bTjBGiSiebYZf+r8V/k7py8KZJHGUNp9LeFsQlks9/KAeKe54ofspP5S5FvQaQGSfAZ8UyxJszumHJtOgGa67qz4R1sGwN31TbHB26951doY5ZknUMUizyqpXmbk87728TccMlXhB1VUixkymUvHALdow==;31:RaYVRsh4rbU561nFChOaQD7oA9kqVULma7brx15AiAYKSlGYNLlH9w4pZZZuQkvUr2wwbHDmFh/xP4EHkvJW1Tf5XcZHQImv4jyazpkhfv5k5AyMapcmHq1O8FjsBWOtcszJrq+HzJOQFkguBtAQedgNRYdaRQsYo1Pg3BqZz5bHU7VjvaOGROmPVGFMpaf9w/8mraf9WXcXQJ5qXnnM+M9Iq1TJwnngX1sA/VSnwDM= X-MS-TrafficTypeDiagnostic: VI1PR0201MB2461: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(232431446821674); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123558120)(2016111802025)(20161123560045)(20161123562045)(6043046)(6072148)(201708071742011)(7699016);SRVR:VI1PR0201MB2461;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2461; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2461;4:YLCzYaj8Q0S0eaUF1yCqeH0URCTPz5zxHJ1smXWNqKEmJi5ewrdHVqpQFQ27h550Vp0nKfVDVIOl/JR2TdWsvPqSfNJoeZ2g3aJYmICVx04e8F7vq3yWey5Xt0ojfYcAs5WsRpUOjr2bxKRArRZDHwT0PCuAYDnJpXQRp5A4nzpELILHv+XfDd+mClT4YUV2tNW7r+L8Et5NdZZXrd5W/3N9HuiPcFeIeR3VJP+VF6uBgeUO7sohT8wF71slHikm3YyH9YTjSgtAeVeBDQxVpdfsA0MLfOsmh/5l+GaxNFJXCAuLVvPiC6mvOONzj7KdS/onXBWZq3tTODz6OlcF1zlON2aHtoeAaP0iphaLERE= X-Forefront-PRVS: 0737B96801 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(346002)(376002)(366004)(136003)(396003)(39830400003)(189003)(199004)(54534003)(6916009)(305945005)(36916002)(2616005)(956004)(486006)(53936002)(476003)(64126003)(58126008)(52116002)(81156014)(16576012)(52146003)(8936002)(74482002)(7736002)(23676004)(316002)(81166006)(76176011)(65806001)(2906002)(26005)(386003)(3846002)(230700001)(31696002)(6116002)(186003)(3260700006)(16526019)(25786009)(446003)(2486003)(66066001)(77096007)(6666003)(65956001)(478600001)(53546011)(97736004)(86362001)(6246003)(36756003)(68736007)(14444005)(105586002)(50466002)(31686004)(6486002)(47776003)(5660300001)(4326008)(11346002)(229853002)(65826007)(106356001)(117156002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0201MB2461;H:[192.168.13.3];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics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sialFspE2Uxen+UhfjrwcQa1HRo/HK5BBPZvbA6qvdlU5z9bEdtA3a3BLKKoC3Bas4h9XAtNxUassxOnV/KL3ql8KTzg3GjslpbfZ8iGcMIxpLIhOc6K8qJc4826Vuofpd6PPq4d9cAviZvw==;5:VTAyt7m/RjDcqfo16oFUqcZVioxW7vReac68jwZIxMzaXaMXYB2rfbBu1dvVhH7LAbpAwn2JZmZeMcshiNv9QgOPJ2HvvUmZU9/wnkFXZSK5LaHCc9JpPCZeGm4yuz+lx9wxoImCS3mYKV4M1CpblaykTEe8CADgJsyYY27w8js=;24:X+6Zlzkdh/U4oxK0hK4nEOPND1gCMwptvgqlH55k5n2EFoF8A0EHnNZ5mZQpoCslKEcvV/+C/wgR4UlGS+kz3J7yiGCVYhUE2W3amYI/14k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2461;7:MWkl6ZA6hfS9cmoK3DOk8tIxxQiUD8uu4Rn/NZvC5M+0A1QIlfBnduVyJyXiTtuEoqUqgIAx9082QWgjx0ypm2ZUQU5cQeHXfnLPJXdPbov0AhbRGYur1cV50lcC0e9AxFSJnmYIJ+g4OXl4riAfmA9ip7mTpwYlb2QNztlY8h9df4MpZGp9/HbYIJgru0U4J4M9ixJBqIhWDUJnDCDku/HdTHKCuydnQGVsonJtbgHY/AZV8I4gyj8E3/sDeGxV X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2018 12:49:45.7908 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd379c97-84ff-4379-77d5-08d5ecacf0ea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0201MB2461 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-17 15:42, Mircea Caprioru wrote: > This patch adds basic support for Analog Device ADGS1408/09 SPI mux > controller. > > The device is probed and set to a disabled state. It uses the new mux > controller framework. > > Signed-off-by: Mircea Caprioru > --- > Changelog V1 -> V2 > - removed adgs140x wildcard > - removed cells verification since only 0 configuration supported Ahhh, the two muxes in 1409 cannot be operated independently, as this is a "differential" mux. That simplifies things quite a bit, and good thing you caught this early! > - added id enum for ADGS1408 and ADGS1409 > - sorted includes > > MAINTAINERS | 5 ++ > drivers/mux/Kconfig | 12 +++++ > drivers/mux/Makefile | 2 + > drivers/mux/adgs1408.c | 120 +++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 139 insertions(+) > create mode 100644 drivers/mux/adgs1408.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 192d7f73fd01..458d42d6f4f3 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -810,6 +810,11 @@ L: linux-media@vger.kernel.org > S: Maintained > F: drivers/media/i2c/ad9389b* > > +ANALOG DEVICES INC ADGS1408 DRIVER > +M: Mircea Caprioru > +S: Supported > +F: drivers/mux/adgs1408.c > + > ANALOG DEVICES INC ADV7180 DRIVER > M: Lars-Peter Clausen > L: linux-media@vger.kernel.org > diff --git a/drivers/mux/Kconfig b/drivers/mux/Kconfig > index 6241678e99af..cf825e9f47ef 100644 > --- a/drivers/mux/Kconfig > +++ b/drivers/mux/Kconfig > @@ -21,6 +21,18 @@ config MUX_ADG792A > To compile the driver as a module, choose M here: the module will > be called mux-adg792a. > > +config MUX_ADGS1408 > + tristate "Analog Devices ADGS1408/ADGS1409 Multiplexers" > + depends on SPI > + help > + ADGS1408 8:1 multiplexer and ADGS1409 double 4:1 multiplexer > + switches. > + > + The driver supports driving each switch independently. Remove this line. It is confusing since 1408 only have one mux and the two muxes in the dual 1409 cannot be operated independently. > + > + To compile the driver as a module, choose M here: the module will > + be called mux-adgs1408. > + > config MUX_GPIO > tristate "GPIO-controlled Multiplexer" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/mux/Makefile b/drivers/mux/Makefile > index c3d883955fd5..6e9fa47daf56 100644 > --- a/drivers/mux/Makefile > +++ b/drivers/mux/Makefile > @@ -5,10 +5,12 @@ > > mux-core-objs := core.o > mux-adg792a-objs := adg792a.o > +mux-adgs1408-objs := adgs1408.o > mux-gpio-objs := gpio.o > mux-mmio-objs := mmio.o > > obj-$(CONFIG_MULTIPLEXER) += mux-core.o > obj-$(CONFIG_MUX_ADG792A) += mux-adg792a.o > +obj-$(CONFIG_MUX_ADGS1408) += mux-adgs1408.o > obj-$(CONFIG_MUX_GPIO) += mux-gpio.o > obj-$(CONFIG_MUX_MMIO) += mux-mmio.o > diff --git a/drivers/mux/adgs1408.c b/drivers/mux/adgs1408.c > new file mode 100644 > index 000000000000..a5192c5e484b > --- /dev/null > +++ b/drivers/mux/adgs1408.c > @@ -0,0 +1,120 @@ > +// SPDX-License-Identifier: GPL-2.0+ The preferred spelling is GPL-2.0-or-later > +/* > + * ADG1408 SPI MUX driver ADGS1408; you are missing the S. And I think you could/should mention ADGS1409 here. > + * > + * Copyright 2018 Analog Devices Inc. > + */ > + > +#include > +#include This #include sorts after linux/property.h. > +#include > +#include > +#include > +#include > + > +#define ADGS1408_SW_DATA (0x01) > +#define ADGS1408_REG_READ(reg) ((reg) | 0x80) > +#define ADGS1408_DISABLE (0x00) > +#define ADGS1408_MUX(state) (((state) << 1) | 1) > + > +enum { > + ADGS1408, > + ADGS1409 Add a trailing comma here, to make future changes less intrusive. > +}; > + > +static int adgs1408_spi_reg_write(struct spi_device *spi, > + u8 reg_addr, u8 reg_data) > +{ > + u8 tx_buf[2]; > + > + tx_buf[0] = reg_addr; > + tx_buf[1] = reg_data; > + > + return spi_write_then_read(spi, tx_buf, sizeof(tx_buf), NULL, 0); > +} > + > +static int adgs1408_set(struct mux_control *mux, int state) > +{ > + struct spi_device *spi = to_spi_device(mux->chip->dev.parent); > + u8 reg; > + > + if (state == MUX_IDLE_DISCONNECT) > + reg = ADGS1408_DISABLE; > + else > + reg = ADGS1408_MUX(state); > + > + return adgs1408_spi_reg_write(spi, ADGS1408_SW_DATA, reg); > +} > + > +static const struct mux_control_ops adgs1408_ops = { > + .set = adgs1408_set, > +}; > + > +static int adgs1408_probe(struct spi_device *spi) > +{ > + const struct spi_device_id *id = spi_get_device_id(spi); > + struct device *dev = &spi->dev; > + struct mux_chip *mux_chip; > + struct mux_control *mux; > + int ret, idle_state; > + > + mux_chip = devm_mux_chip_alloc(dev, 1, 0); > + if (IS_ERR(mux_chip)) > + return PTR_ERR(mux_chip); > + > + mux_chip->ops = &adgs1408_ops; > + > + ret = adgs1408_spi_reg_write(spi, ADGS1408_SW_DATA, ADGS1408_DISABLE); > + if (ret < 0) > + return ret; > + > + ret = device_property_read_u32_array(dev, "idle-state", > + &idle_state, > + mux_chip->controllers); > + if (ret < 0) { > + idle_state = MUX_IDLE_AS_IS; > + } Drop the {} here. > + > + mux = mux_chip->mux; > + > + if (id->driver_data == ADGS1408) > + mux->states = 8; > + else > + mux->states = 4; > + > + switch (idle_state) { > + case MUX_IDLE_DISCONNECT: > + case MUX_IDLE_AS_IS: > + case 0 ... 7: > + /* adgs1409 supports only 4 states */ > + if (id->driver_data == ADGS1409 && idle_state > 3) > + return -EINVAL; > + mux->idle_state = idle_state; > + break; If you reverse the test above, or if you rewrite it like below, you can fall through and get the error message (w/o duplication), like this (since the MUX_IDLE_... defines are both negative, but you already depend on that): /* adgs1409 supports only 4 states */ if (idle_state < mux->states) { mux->idle_state = idle_state; break; } /* fall through */ > + default: > + dev_err(dev, "invalid idle-state %d\n", idle_state); > + return -EINVAL; > + } > + > + return devm_mux_chip_register(dev, mux_chip); > +} > + > +static const struct spi_device_id adgs1408_id[] = { > + { "adi,adgs1408", ADGS1408 }, > + { "adi,adgs1409", ADGS1409 }, This looks weird. Other spi_device_id lookup-tables do not have dt-style ids like this; they have the equivalent of "adgs1408" and "adgs1409". > + { } > +}; > +MODULE_DEVICE_TABLE(spi, adgs1408_id); > + > +static struct spi_driver adgs1408_driver = { > + .driver = { > + .name = "adgs1408", You have (silently) dropped .of_match_table since v1. Why is it not needed? I felt much more comfortable with what was in v1 for this area of the patch. Cheers, Peter > + }, > + .probe = adgs1408_probe, > + .id_table = adgs1408_id, > +}; > +module_spi_driver(adgs1408_driver); > + > +MODULE_AUTHOR("Mircea Caprioru "); > +MODULE_DESCRIPTION("Analog Devices ADGS1408 MUX driver");> +MODULE_LICENSE("GPL v2"); >