Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp591406pxk; Thu, 3 Sep 2020 07:45:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8yDE/8K+DuKcdjL20gpc1YLVN2DMhp+b2I5sliFA1RcIhRSbOKCe4pSWC9ZfB955D+X8A X-Received: by 2002:a17:906:a1c2:: with SMTP id bx2mr2621891ejb.426.1599144359691; Thu, 03 Sep 2020 07:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599144359; cv=none; d=google.com; s=arc-20160816; b=E88Xgty2KAlLRi0esuCLesh2U+DgUSVZFk+Cs35egl26ZE9yctRg5ldz+LzpVnJuqs Re97Shh/CyigPwMNP9/hie8o5X6WJDAuwrgM6SL+eum9JaBDWbWMo8hgaFJsURCkG9lK 3+qWEU+1OLCr7QbYo3l0lJi1yjw9EpcN9bl8p50rIYaL5hC7osApoADXrgYxZO+63N9g XdWfRMXjxqgKvzmiGLfJ7gXbosfFYYEM1s9S3qZmnn4RIcVnNvvxXi+Gpx2KhyxGtD+V hbeXGMcrJT0Fb2zfwGhzYujS6D6GxNgwYrdEA49XyVWP5bpIz9RpTkJLfHf7Akv7BBrL KNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:dkim-signature:ironport-sdr; bh=/9+i0/1hvMAOUAPGtaXydiEh3h9v4nf8kDUClRfkS3s=; b=WVs4yhmrCBAL+zxX0uvfgg3HGC2qp5ofNR3U7Axk0uqBphy12c06L4bhDzAry1QTZ8 uFUv4KYDd6zeBRhEMXD7M09YrUgCelQyi74pFsrqfPuH3P7hThwodLha00RX+1M6tnnf uiQs5Wsp7jXxi80mNG7sQWhwQMGN2gtcsWtxIGH59dnepY9ePBUoUW8jCp+zhlL5dD+e TAOza0cRYbqJjPm4iKkWUbdeq7TV5hAYYJFMfUqYIkFbWYOlXQCU78mySAA5J/QixMZ1 Jg1itVYzQ579nXGv/XhS1tmJfrxHuTLBCF1bLGsXyKscKQwBaLudgruoaH3++Wj4wZtC JFwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@tq-group.com header.s=key1 header.b=Do2UNsHQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r5si1868623edx.458.2020.09.03.07.45.36; Thu, 03 Sep 2020 07:45:59 -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; dkim=fail header.i=@tq-group.com header.s=key1 header.b=Do2UNsHQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729401AbgICOle (ORCPT + 99 others); Thu, 3 Sep 2020 10:41:34 -0400 Received: from mx1.tq-group.com ([62.157.118.193]:59778 "EHLO mx1.tq-group.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729406AbgICOk6 (ORCPT ); Thu, 3 Sep 2020 10:40:58 -0400 IronPort-SDR: tWkSgVr7tIYKC56ZI0vAC5S6vowOnHNZItcy5v/nmVsG5m55D0RE/PAU/7L4IXCqgFLBzgZusl X0Hoca4espLj6q9/0IahoMH/DceBW+9qBKPkM62H3n6DxSbf+KHphVB9EtVdWNWzETWOILZwdL KaW17BZH1NnfKT9XhyD+edGGCeiwqeWiXfJQ07FlXtJTrSasWFne3zz6z69bhHlrNtIRoHjN9m S1kkgepTqbtfS2O0QmB+YyTB8fPa2LjZ65yQOKPms05CpDbrfLlmbhGZwP73ICRXz6N8BaXJUw N3A= X-IronPort-AV: E=Sophos;i="5.76,387,1592863200"; d="scan'208";a="13722541" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 03 Sep 2020 16:40:55 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Thu, 03 Sep 2020 16:40:56 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Thu, 03 Sep 2020 16:40:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1599144055; x=1630680055; h=from:to:cc:subject:date:message-id; bh=HuVYZMdnTpuIAbGh0AO6RRdKYESqvMwuJdvjWZtOvjo=; b=Do2UNsHQnUT/s8dV31uR/dqFZMJ0xeIqnnjx9XugtpgdbAo4c269TE2J rEX080JtplHQK1JFnlsuWdnOnZkIGrm8I3kmrQb1Ks3dGncJ2RJ+ArM1P ga5xXoBjC4erbzhpy0GJcDLCXJwNpq520V2FZRcDECKWj+ZVQHS9tui/z Tzn9bVVOdxk3LF3nd3FnoDiOtTyBvoogM3/yu2FKs2t5+t5HBXeezk2dB cdQkNbrOD1PUB/RuR9ZdHo24gDzwOD/DMzdUL+m5UIua88Wqr1eB4zX2I HXwlYbvq9VMZsTVjfbnmANg7ov6llvVDjfPjlU97HkebzH2ZIRRuS8SS3 w==; IronPort-SDR: pPiXbxI+FQucBUSsBtjmOTxuJGtkJ19sEQBeNapq3BL3fx7uw5P/ny0rX1JV6Y3DiZHBPbi0Za P35/aGAwImZUVYkaXU9xYpbOyddZIBghPduttFnEYEpgh+jpvzmnmwXIU6XGKXUGxmh8nQbGxS x30kT87vBo33Ddhk8iX/UniQ1R3tCusCs2OCkUk1ipomAT7VxNsb99HkiOuyW2HHiQw7EUh8qx ZcZnI8LVMME2YGdeU/R5R6xCUd7NgTV9swfnfw73/7xSMyxIAhfo+6JJbwwEDYReL+oSKkccvp gYE= X-IronPort-AV: E=Sophos;i="5.76,387,1592863200"; d="scan'208";a="13722540" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 03 Sep 2020 16:40:55 +0200 Received: from schifferm-ubuntu4.tq-net.de (unknown [10.117.49.26]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id BE6D5280065; Thu, 3 Sep 2020 16:40:55 +0200 (CEST) From: Matthias Schiffer To: Mark Brown , Shawn Guo , Sascha Hauer Cc: Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Matthias Schiffer Subject: [PATCH] spi-imx: remove num-cs support, set num_chipselect to 4 Date: Thu, 3 Sep 2020 16:40:28 +0200 Message-Id: <20200903144028.20416-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The num-cs property is not considered useful, and no in-tree Device Trees define it for spi-imx. The default value to be used when no cs-gpios are defined is set to 4 to give access to all native CS pins of modern i.MX SoCs (i.MX6 and newer). In older SoCs, the number of CS pins varies (for example the i.MX27 has 3 CS pins on CSPI1 and CSPI2, and only a single CS on CSPI3). Attempting to use the nonexisting CS pin would be an easy to notice DT misconfiguration; making the driver catch this doesn't seem worthwhile. Signed-off-by: Matthias Schiffer --- drivers/spi/spi-imx.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 197f60632072..aece8482739b 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1581,7 +1581,6 @@ static int spi_imx_probe(struct platform_device *pdev) const struct spi_imx_devtype_data *devtype_data = of_id ? of_id->data : (struct spi_imx_devtype_data *)pdev->id_entry->driver_data; bool slave_mode; - u32 val; slave_mode = devtype_data->has_slavemode && of_property_read_bool(np, "spi-slave"); @@ -1605,6 +1604,7 @@ static int spi_imx_probe(struct platform_device *pdev) master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32); master->bus_num = np ? -1 : pdev->id; master->use_gpio_descriptors = true; + master->num_chipselect = 4; spi_imx = spi_master_get_devdata(master); spi_imx->bitbang.master = master; @@ -1613,17 +1613,6 @@ static int spi_imx_probe(struct platform_device *pdev) spi_imx->devtype_data = devtype_data; - /* - * Get number of chip selects from device properties. This can be - * coming from device tree or boardfiles, if it is not defined, - * a default value of 3 chip selects will be used, as all the legacy - * board files have <= 3 chip selects. - */ - if (!device_property_read_u32(&pdev->dev, "num-cs", &val)) - master->num_chipselect = val; - else - master->num_chipselect = 3; - spi_imx->bitbang.setup_transfer = spi_imx_setupxfer; spi_imx->bitbang.txrx_bufs = spi_imx_transfer; spi_imx->bitbang.master->setup = spi_imx_setup; -- 2.17.1