Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1561767imu; Wed, 16 Jan 2019 22:53:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN7SHygpErv75T42bsg6tycsLbVt+CbdhG260si8YcNp528E2hRs60SN5ymB8lXJUXEhDYKV X-Received: by 2002:a17:902:2468:: with SMTP id m37mr13793663plg.314.1547708013934; Wed, 16 Jan 2019 22:53:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547708013; cv=none; d=google.com; s=arc-20160816; b=KQc9kJuJv66bXmM3fEohoKgNWCRmNJR0Lo06BCNOqbtXjI++N0xngI5l2rDWMAeUzc m8ezsVz340TTo/mDyjzjznOLUpE+RD0oLsOLLgp3qfl0sil9HfVPVBDb6Fj8i96JDsrB Z2Sj/SQOOtV9S79y01IBbiHdGfFe3qt2B1+g2L17UBB496GJOLcGWsT38K8g7Ekty+0d 8+VNf6fFpWbvD35PgAMHQGXfJbpWx74B/vJatzQ/gLeuGnk953M0j/SwBOOhSysWFG4q 5bSafC555IM19EiBSI6JsSkS1x37tK+ivofdSsrhadLR4SNH4SNJ80PBvD7XPwjSwKKy kHLw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=toOmwhWVZpe0i6wDawBUNEFo1uFo9HhmMddGKJfcCqY=; b=DEt8FGQPQJEJVeVfH4j3b9y5l5Vl/8nFdzWxozQ8JwRWordHl3pK+yOEAOE/9jB6vF RHDUatpQsUPSmkTSbH6PH0dCHgaIXZVqisLVy94l2nMoqnF0inIFIH/ElJKkpzadNLZB GffVeb/Vo96KOEZ74sfNLTzBRYIwEJ4mtfUSCvw1asshFOTPdH6twNyuq7Jw0bDzv54l pE4YgS41bue7O0rJZdeyV3HCq8Bjweb8NjeXVM7Q5bFiRY0GEZPN5dW23qmCvJ0hrPpT OxYTk28BvVwUywot72MxxwbxCY9vED7Jvt0HK16pBzH8050YonC4IUXIM9mth8Lc74TY I55w== ARC-Authentication-Results: i=1; mx.google.com; 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 q15si813754pgm.420.2019.01.16.22.53.17; Wed, 16 Jan 2019 22:53:33 -0800 (PST) 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; 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 S1729812AbfAPS4d (ORCPT + 99 others); Wed, 16 Jan 2019 13:56:33 -0500 Received: from smtp1-g21.free.fr ([212.27.42.1]:60512 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729085AbfAPS4c (ORCPT ); Wed, 16 Jan 2019 13:56:32 -0500 Received: from localhost.localdomain (unknown [IPv6:2a02:8108:4840:8f74:a08c:f56:b2dd:7ae0]) (Authenticated sender: albeu) by smtp1-g21.free.fr (Postfix) with ESMTPA id 8BBFBB00583; Wed, 16 Jan 2019 19:56:13 +0100 (CET) From: Alban Bedel To: linux-kernel@vger.kernel.org Cc: Alban Bedel , Ralf Baechle , Paul Burton , James Hogan , Mark Brown , linux-mips@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 3/6] spi: ath79: Enable support for compile test Date: Wed, 16 Jan 2019 19:55:46 +0100 Message-Id: <20190116185549.23295-3-albeu@free.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190116185549.23295-1-albeu@free.fr> References: <20190116185549.23295-1-albeu@free.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To allow building this driver in compile test we need to remove all dependency on headers from arch/mips/include. To allow this we explicitly define all the registers locally instead of using ar71xx_regs.h and we move the platform data struct definition to include/linux/platform_data/spi-ath79.h. Signed-off-by: Alban Bedel --- arch/mips/ath79/dev-spi.h | 2 +- drivers/spi/Kconfig | 2 +- drivers/spi/spi-ath79.c | 15 ++++++++++++--- .../linux/platform_data/spi-ath79.h | 0 4 files changed, 14 insertions(+), 5 deletions(-) rename arch/mips/include/asm/mach-ath79/ath79_spi_platform.h => include/linux/platform_data/spi-ath79.h (100%) diff --git a/arch/mips/ath79/dev-spi.h b/arch/mips/ath79/dev-spi.h index d732565ca736..6e15bc8651be 100644 --- a/arch/mips/ath79/dev-spi.h +++ b/arch/mips/ath79/dev-spi.h @@ -13,7 +13,7 @@ #define _ATH79_DEV_SPI_H #include -#include +#include void ath79_register_spi(struct ath79_spi_platform_data *pdata, struct spi_board_info const *info, diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 128892c7e21e..71d3d2d5e5d1 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -63,7 +63,7 @@ config SPI_ALTERA config SPI_ATH79 tristate "Atheros AR71XX/AR724X/AR913X SPI controller driver" - depends on ATH79 + depends on ATH79 || COMPILE_TEST select SPI_BITBANG help This enables support for the SPI controller present on the diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index edf695a359f4..09c4fb7fcf7a 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c @@ -23,15 +23,24 @@ #include #include #include - -#include -#include +#include #define DRV_NAME "ath79-spi" #define ATH79_SPI_RRW_DELAY_FACTOR 12000 #define MHZ (1000 * 1000) +#define AR71XX_SPI_REG_FS 0x00 /* Function Select */ +#define AR71XX_SPI_REG_CTRL 0x04 /* SPI Control */ +#define AR71XX_SPI_REG_IOC 0x08 /* SPI I/O Control */ +#define AR71XX_SPI_REG_RDS 0x0c /* Read Data Shift */ + +#define AR71XX_SPI_FS_GPIO BIT(0) /* Enable GPIO mode */ + +#define AR71XX_SPI_IOC_DO BIT(0) /* Data Out pin */ +#define AR71XX_SPI_IOC_CLK BIT(8) /* CLK pin */ +#define AR71XX_SPI_IOC_CS(n) BIT(16 + (n)) + struct ath79_spi { struct spi_bitbang bitbang; u32 ioc_base; diff --git a/arch/mips/include/asm/mach-ath79/ath79_spi_platform.h b/include/linux/platform_data/spi-ath79.h similarity index 100% rename from arch/mips/include/asm/mach-ath79/ath79_spi_platform.h rename to include/linux/platform_data/spi-ath79.h -- 2.19.1