From patchwork Mon Oct 17 09:16:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 13008398 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 A8836C4332F for ; Mon, 17 Oct 2022 09:17:47 +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=N2BvoEa2sWVWVba9o4rz4/0evAx85wzyAvEALSsJ2ko=; b=O/CVzXV4FOSZbN F9bhPIeHedND3qLJUmIiGzxTEM+2L9Qb8UhWfRWvZmwVKcY9RimvgzY3V842WgDKoZZYfPDMjQXei 70A+GvuLgIuE+AYeF2XydXGY2hqxEgrd1hxwdBX6Qoltu/2e/H7N1fY9zj19x2OL/Yq9mitRl6Lyx dN3crDSXkk+GXH3f5GGQepRX1vANVwckBLsUzzwp5Y/cbQuIgh29CCyhLn8eRqv9Oa+HDa/J8voDe juD2wsX+mu7+HFXS1pN1tCQD3n5MpI/489CpCXqYol6onCncOWraEMIT9F9zUasJ2V2d4+4HkebV0 t8v1smJU+dxGN1zMFtHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMEr-009dEn-0k; Mon, 17 Oct 2022 09:16:49 +0000 Received: from gandalf.ozlabs.org ([150.107.74.76]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMEo-009dCu-1X for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 09:16:47 +0000 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4MrWZw6JtGz4xFy; Mon, 17 Oct 2022 20:16:40 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4MrWZr4gbFz4xG9; Mon, 17 Oct 2022 20:16:36 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: linux-spi@vger.kernel.org Cc: Mark Brown , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Joel Stanley , Andrew Jeffery , Chin-Ting Kuo , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , Naresh Solanki Subject: [PATCH linux v2 1/3] spi: dt-bindings: aspeed: Add a ranges property Date: Mon, 17 Oct 2022 11:16:22 +0200 Message-Id: <20221017091624.130227-2-clg@kaod.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017091624.130227-1-clg@kaod.org> References: <20221017091624.130227-1-clg@kaod.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_021646_284591_8C17165F X-CRM114-Status: GOOD ( 10.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org "ranges" predefines settings for the decoding ranges of each CS. Cc: Naresh Solanki Cc: Chin-Ting Kuo Signed-off-by: Cédric Le Goater --- .../devicetree/bindings/spi/aspeed,ast2600-fmc.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml index fa8f4ac20985..a11cbc4c4c5c 100644 --- a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml +++ b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml @@ -38,6 +38,14 @@ properties: interrupts: maxItems: 1 + ranges: + minItems: 1 + maxItems: 5 + description: | + Defines the address mapping for child devices with four integer + values for each chip-select line in use: + 0 + required: - compatible - reg @@ -58,6 +66,7 @@ examples: compatible = "aspeed,ast2600-fmc"; clocks = <&syscon ASPEED_CLK_AHB>; interrupts = ; + ranges = <0 0 0x20000000 0x2000000>, <1 0 0x22000000 0x2000000>; flash@0 { reg = < 0 >; From patchwork Mon Oct 17 09:16:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 13008400 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 EA4CDC43217 for ; Mon, 17 Oct 2022 09:18:13 +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=fuh7jyvtzhgpAkrpTsr5vi7oZuTBjTGWmtdQP7erRow=; b=ur2niGSf1KXKGX jr4A5wqsaoU1SqeE2UInOqspubbFQc4KV0oq8+4HZrrrClGnL4cYZ5K0wjmRg+1KI/iMZxC1sv+K+ oXOX8G75ARnmNombNquO09JwBHt95bR/vCGoIxkJ1p2KGzONn4CL37RUjatgGBWUGogi5cXYw+R+d pP8iud0KGD3C27floe5xDj4bw0+z29cdQEHEVrtRN/L3DGVnbOL1oAqe0MCnu0nmdljIfskDy+X1j JJMdyjzy1qo8eTINK/e+f+mrLypqHNvhlZ9Y+W7q/SS3904PlM735yMRQlqUqF2grbLFtetBKxq8f gmNx55/Mha6dkUZCfYMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMFD-009dK6-Di; Mon, 17 Oct 2022 09:17:11 +0000 Received: from mail.ozlabs.org ([2404:9400:2221:ea00::3] helo=gandalf.ozlabs.org) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMEs-009dDh-5b for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 09:16:52 +0000 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4MrWb13WWgz4xGm; Mon, 17 Oct 2022 20:16:45 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4MrWZx343vz4wgv; Mon, 17 Oct 2022 20:16:41 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: linux-spi@vger.kernel.org Cc: Mark Brown , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Joel Stanley , Andrew Jeffery , Chin-Ting Kuo , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , Naresh Solanki Subject: [PATCH linux v2 2/3] spi: aspeed: Handle custom decoding ranges Date: Mon, 17 Oct 2022 11:16:23 +0200 Message-Id: <20221017091624.130227-3-clg@kaod.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017091624.130227-1-clg@kaod.org> References: <20221017091624.130227-1-clg@kaod.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_021650_675646_02F896EB X-CRM114-Status: GOOD ( 22.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The "ranges" property predefines settings for the decoding ranges of each CS. If found in the DT, the driver applies the settings at probe time. The default behavior is to set the decoding range of each CS using the flash device size when the spi slave is setup. Cc: Naresh Solanki Cc: Chin-Ting Kuo Signed-off-by: Cédric Le Goater --- drivers/spi/spi-aspeed-smc.c | 65 +++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index b90571396a60..75e1d08bbd00 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -96,6 +96,7 @@ struct aspeed_spi { u32 ahb_base_phy; u32 ahb_window_size; struct device *dev; + bool fixed_windows; struct clk *clk; u32 clk_freq; @@ -382,6 +383,7 @@ static const char *aspeed_spi_get_name(struct spi_mem *mem) struct aspeed_spi_window { u32 cs; + u32 reg; u32 offset; u32 size; }; @@ -396,6 +398,7 @@ static void aspeed_spi_get_windows(struct aspeed_spi *aspi, for (cs = 0; cs < aspi->data->max_cs; cs++) { reg_val = readl(aspi->regs + CE0_SEGMENT_ADDR_REG + cs * 4); windows[cs].cs = cs; + windows[cs].reg = reg_val; windows[cs].size = data->segment_end(aspi, reg_val) - data->segment_start(aspi, reg_val); windows[cs].offset = data->segment_start(aspi, reg_val) - aspi->ahb_base_phy; @@ -572,7 +575,8 @@ static int aspeed_spi_dirmap_create(struct spi_mem_dirmap_desc *desc) if (op->data.dir != SPI_MEM_DATA_IN) return -EOPNOTSUPP; - aspeed_spi_chip_adjust_window(chip, desc->info.offset, desc->info.length); + if (!aspi->fixed_windows) + aspeed_spi_chip_adjust_window(chip, desc->info.offset, desc->info.length); if (desc->info.length > chip->ahb_window_size) dev_warn(aspi->dev, "CE%d window (%dMB) too small for mapping", @@ -712,6 +716,61 @@ static void aspeed_spi_enable(struct aspeed_spi *aspi, bool enable) aspeed_spi_chip_enable(aspi, cs, enable); } +static int aspeed_spi_chip_read_ranges(struct device_node *node, struct aspeed_spi *aspi) +{ + const char *range_prop = "ranges"; + struct property *prop; + struct aspeed_spi_window ranges[ASPEED_SPI_MAX_NUM_CS]; + int prop_size; + int count; + int ret; + int i; + + prop = of_find_property(node, range_prop, &prop_size); + if (!prop) + return 0; + + count = prop_size / sizeof(*ranges); + if (count > aspi->data->max_cs) { + dev_err(aspi->dev, "invalid '%s' property %d\n", range_prop, count); + return -EINVAL; + } + + if (count < aspi->data->max_cs) + dev_dbg(aspi->dev, "'%s' property does not cover all CE\n", + range_prop); + + ret = of_property_read_u32_array(node, range_prop, (u32 *)ranges, count * 4); + if (ret) + return ret; + + dev_info(aspi->dev, "Using preset decoding ranges\n"); + for (i = 0; i < count; i++) { + struct aspeed_spi_window *win = &ranges[i]; + + if (win->cs > aspi->data->max_cs) { + dev_err(aspi->dev, "CE%d range is invalid", win->cs); + return -EINVAL; + } + + /* Trim top bit of the address to keep offset */ + win->offset &= aspi->ahb_window_size - 1; + + /* Minimal check */ + if (win->offset + win->size > aspi->ahb_window_size) { + dev_warn(aspi->dev, "CE%d range is too large", win->cs); + return -EINVAL; + } + + ret = aspeed_spi_set_window(aspi, win); + if (ret) + return ret; + } + + aspi->fixed_windows = true; + return 0; +} + static int aspeed_spi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -767,6 +826,10 @@ static int aspeed_spi_probe(struct platform_device *pdev) return ret; } + ret = aspeed_spi_chip_read_ranges(dev->of_node, aspi); + if (ret) + return ret; + /* IRQ is for DMA, which the driver doesn't support yet */ ctlr->mode_bits = SPI_RX_DUAL | SPI_TX_DUAL | data->mode_bits; From patchwork Mon Oct 17 09:16:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 13008401 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 A8CF4C433FE for ; Mon, 17 Oct 2022 09:18:17 +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=x9XaJkQnsow5kMRtWm8mmwb5qJc4GjPxh9ikTQKDXJk=; b=p8D4MQuEStU331 7f+uwdLZqQnX6V9u35Vt0Qz3z3mJy/FA4R9w0DxbpTti+maZDzIyM9Mf2MeAraRIj4omCGRrQhhT9 6x8v1NKTtQXr8xg9yzQkLXAZTDLToiCUyc1ZwPrpD4eb9zOHTqYaxwsgBdXBRNYnjgVTmahO6d4n9 w+5+K2xL7gkJ1195ivfDAP1M2W8GCVdstWjxaFqSKrRgiB5AkcVcrwz3Ypkq3znlaC2vhyX0TUf0l OTDm4wu3JXOgcP6d/BqnH9Fjecgbym7ry0d/c7k4eqEzcXQPJAe5/nukoiVfwd8LtODh/g8/ub5hn ++k6CFU6gI1h5158mwpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMFM-009dMS-3d; Mon, 17 Oct 2022 09:17:20 +0000 Received: from gandalf.ozlabs.org ([150.107.74.76]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okMEt-009dF9-61 for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2022 09:16:52 +0000 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4MrWb55sqhz4xG9; Mon, 17 Oct 2022 20:16:49 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4MrWb20658z4xGG; Mon, 17 Oct 2022 20:16:45 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: linux-spi@vger.kernel.org Cc: Mark Brown , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, Joel Stanley , Andrew Jeffery , Chin-Ting Kuo , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PATCH linux v2 3/3] spi: aspeed: Introduce a "ranges" debugfs file Date: Mon, 17 Oct 2022 11:16:24 +0200 Message-Id: <20221017091624.130227-4-clg@kaod.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221017091624.130227-1-clg@kaod.org> References: <20221017091624.130227-1-clg@kaod.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_021651_562540_1B13EFF9 X-CRM114-Status: GOOD ( 16.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This dumps the mapping windows, or decoding ranges, of all devices possibly attached of the controller. To be noted that a top level "spi" debugfs directory is created to hold the intermediate directory of the driver instance. Cc: Chin-Ting Kuo Signed-off-by: Cédric Le Goater --- drivers/spi/spi-aspeed-smc.c | 66 +++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 75e1d08bbd00..a79e5cc8ac5b 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -102,6 +103,9 @@ struct aspeed_spi { u32 clk_freq; struct aspeed_spi_chip chips[ASPEED_SPI_MAX_NUM_CS]; +#if IS_ENABLED(CONFIG_DEBUG_FS) + struct dentry *debugfs; +#endif }; static u32 aspeed_spi_get_io_mode(const struct spi_mem_op *op) @@ -716,6 +720,65 @@ static void aspeed_spi_enable(struct aspeed_spi *aspi, bool enable) aspeed_spi_chip_enable(aspi, cs, enable); } +#if IS_ENABLED(CONFIG_DEBUG_FS) +static int aspeed_spi_ranges_debug_show(struct seq_file *m, void *private) +{ + struct aspeed_spi *aspi = m->private; + struct aspeed_spi_window windows[ASPEED_SPI_MAX_NUM_CS] = { 0 }; + u32 cs; + + if (aspi->data == &ast2400_spi_data) + return 0; + + aspeed_spi_get_windows(aspi, windows); + + seq_puts(m, " offset size register\n"); + for (cs = 0; cs < aspi->data->max_cs; cs++) { + if (!windows[cs].reg) + seq_printf(m, "CE%d: disabled\n", cs); + else + seq_printf(m, "CE%d: 0x%.8x 0x%.8x 0x%x\n", cs, + windows[cs].offset, windows[cs].size, + windows[cs].reg); + } + return 0; +} +DEFINE_SHOW_ATTRIBUTE(aspeed_spi_ranges_debug); + +static int aspeed_spi_debugfs_init(struct spi_controller *ctlr) +{ + struct aspeed_spi *aspi = spi_controller_get_devdata(ctlr); + struct dentry *rootdir = NULL; + + rootdir = debugfs_lookup("spi", NULL); + if (!rootdir) + rootdir = debugfs_create_dir("spi", NULL); + + aspi->debugfs = debugfs_create_dir(dev_name(&ctlr->dev), rootdir); + if (!aspi->debugfs) + return -ENOMEM; + + debugfs_create_file("ranges", 0444, aspi->debugfs, (void *)aspi, + &aspeed_spi_ranges_debug_fops); + return 0; +} + +static void aspeed_spi_debugfs_remove(struct aspeed_spi *aspi) +{ + debugfs_remove_recursive(aspi->debugfs); +} + +#else +static inline int aspeed_spi_debugfs_init(struct spi_controller *ctlr) +{ + return 0; +} + +static inline void aspeed_spi_debugfs_remove(struct aspeed_spi *aspi) +{ +} +#endif /* IS_ENABLED(CONFIG_DEBUG_FS) */ + static int aspeed_spi_chip_read_ranges(struct device_node *node, struct aspeed_spi *aspi) { const char *range_prop = "ranges"; @@ -845,7 +908,7 @@ static int aspeed_spi_probe(struct platform_device *pdev) dev_err(&pdev->dev, "spi_register_controller failed\n"); goto disable_clk; } - return 0; + return aspeed_spi_debugfs_init(ctlr); disable_clk: clk_disable_unprepare(aspi->clk); @@ -856,6 +919,7 @@ static int aspeed_spi_remove(struct platform_device *pdev) { struct aspeed_spi *aspi = platform_get_drvdata(pdev); + aspeed_spi_debugfs_remove(aspi); aspeed_spi_enable(aspi, false); clk_disable_unprepare(aspi->clk); return 0;