From patchwork Tue Jun 19 16:23:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 931743 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 419D903y0hz9s3R for ; Wed, 20 Jun 2018 02:35:32 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infinera.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 419D902csrzF0tm for ; Wed, 20 Jun 2018 02:35:32 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infinera.com X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=infinera.com (client-ip=31.15.61.139; helo=smtp.transmode.se; envelope-from=joakim.tjernlund@infinera.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infinera.com Received: from smtp.transmode.se (smtp.transmode.se [31.15.61.139]) by lists.ozlabs.org (Postfix) with ESMTP id 419D3P2MxHzF0wf for ; Wed, 20 Jun 2018 02:30:41 +1000 (AEST) Received: from gentoo-jocke.infinera.com (gentoo-jocke.infinera.com [10.210.72.209]) by smtp.transmode.se (Postfix) with ESMTP id 8849B118AC15; Tue, 19 Jun 2018 18:23:06 +0200 (CEST) Received: from gentoo-jocke.infinera.com (gentoo-jocke.infinera.com [127.0.0.1]) by gentoo-jocke.infinera.com (8.14.9/8.14.9) with ESMTP id w5JGN6ZC020219; Tue, 19 Jun 2018 18:23:06 +0200 Received: (from jocke@localhost) by gentoo-jocke.infinera.com (8.14.9/8.14.9/Submit) id w5JGN6Ib020218; Tue, 19 Jun 2018 18:23:06 +0200 From: Joakim Tjernlund To: York Sun , linuxppc-dev Subject: [PATCH] spi/fsl-espi: Add missing cell-index OF property Date: Tue, 19 Jun 2018 18:23:04 +0200 Message-Id: <20180619162304.20125-1-joakim.tjernlund@infinera.com> X-Mailer: git-send-email 2.13.6 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" espi does not look for a OF cell-index property which makes the bus numbering dynamic only. This add an optional cell-index. Signed-off-by: Joakim Tjernlund --- drivers/spi/spi-fsl-espi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 1d332e23f6ed..56b71c5e2f10 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -672,6 +672,14 @@ static int fsl_espi_probe(struct device *dev, struct resource *mem, dev_set_drvdata(dev, master); + if (dev->of_node) { + u32 cell_index; + + if (!of_property_read_u32(dev->of_node, "cell-index", + &cell_index)) + master->bus_num = cell_index; + } + master->mode_bits = SPI_RX_DUAL | SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST | SPI_LOOP; master->dev.of_node = dev->of_node;