From patchwork Fri Dec 3 06:29:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 376791 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB36Ti5u025376 for ; Fri, 3 Dec 2010 06:29:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755976Ab0LCG3h (ORCPT ); Fri, 3 Dec 2010 01:29:37 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:62583 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755930Ab0LCG3g (ORCPT ); Fri, 3 Dec 2010 01:29:36 -0500 Received: by fxm20 with SMTP id 20so1901607fxm.19 for ; Thu, 02 Dec 2010 22:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=gwQrsNC4k8FOed6HbDC9Cz97ExxGtjM41hGJPS1vc3Q=; b=mhiOzZjZaJCIxOEYsKk90yQMd2kqAFcOHDa7lmadjEordBd5PmZCnTQNe69diiD4M0 WgPkL+l6YSfLZxY0xXB3xpaFDag1KK11lMqeFQHUc6ePEegJFzx+n32XXsg4j0MJPgQw r9mHGsyP7mJ6LgkO7oXDZzZblxHXnOptc5k70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=LhAruFxg8rggN/VQvhqsZlk6vlJrZ6rP0B5iojhxfA9zKcOHjEwhZOcIbajrQtTTeI bnKf9PfvqlmmzG8GwYk1WnmSeldahvB3yyR60ZSfRH2D91Z7GGpSD7p1owj3dlo5R90u hZ9XKT6BOYF/0JSsCrNIcXSXAN9dk9UD2nzXE= MIME-Version: 1.0 Received: by 10.223.86.16 with SMTP id q16mr1624336fal.58.1291357775527; Thu, 02 Dec 2010 22:29:35 -0800 (PST) Received: by 10.223.86.196 with HTTP; Thu, 2 Dec 2010 22:29:35 -0800 (PST) Date: Fri, 3 Dec 2010 01:29:35 -0500 Message-ID: Subject: [PATCH 1/2] mmc move sdhci_ops and sdhci_priv to header From: zhangfei gao To: linux-mmc@vger.kernel.org Cc: Chris Ball , Eric Miao , Haojian Zhuang , niej0001@gmail.com, Philip Rakity , Mark Brown , xywu@marvell.com, njun@marvell.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 06:29:45 +0000 (UTC) From 9ae40c28754f1034abad9d07c0c86725a0a3f4b8 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Tue, 30 Nov 2010 05:37:27 -0500 Subject: [PATCH 1/2] mmc: move sdhci_ops and sdhci_priv to header Soc specific function under /arch would access private via sdhci_priv. Different controller may have different ops, which transfered from platform. Signed-off-by: Zhangfei Gao --- drivers/mmc/host/sdhci.h | 28 ---------------------------- include/linux/mmc/sdhci.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index e42d7f0..b689cc6 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -200,29 +200,6 @@ #define SDHCI_MAX_DIV_SPEC_200 256 #define SDHCI_MAX_DIV_SPEC_300 2046 -struct sdhci_ops { -#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS - u32 (*read_l)(struct sdhci_host *host, int reg); - u16 (*read_w)(struct sdhci_host *host, int reg); - u8 (*read_b)(struct sdhci_host *host, int reg); - void (*write_l)(struct sdhci_host *host, u32 val, int reg); - void (*write_w)(struct sdhci_host *host, u16 val, int reg); - void (*write_b)(struct sdhci_host *host, u8 val, int reg); -#endif - - void (*set_clock)(struct sdhci_host *host, unsigned int clock); - - int (*enable_dma)(struct sdhci_host *host); - unsigned int (*get_max_clock)(struct sdhci_host *host); - unsigned int (*get_min_clock)(struct sdhci_host *host); - unsigned int (*get_timeout_clock)(struct sdhci_host *host); - int (*platform_8bit_width)(struct sdhci_host *host, - int width); - void (*platform_send_init_74_clocks)(struct sdhci_host *host, - u8 power_mode); - unsigned int (*get_ro)(struct sdhci_host *host); -}; - #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS static inline void sdhci_writel(struct sdhci_host *host, u32 val, int reg) @@ -311,11 +288,6 @@ extern struct sdhci_host *sdhci_alloc_host(struct device *dev, size_t priv_size); extern void sdhci_free_host(struct sdhci_host *host); -static inline void *sdhci_priv(struct sdhci_host *host) -{ - return (void *)host->private; -} - extern void sdhci_card_detect(struct sdhci_host *host); extern int sdhci_add_host(struct sdhci_host *host); extern void sdhci_remove_host(struct sdhci_host *host, int dead); diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1fdc673..86e8380 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -141,4 +141,34 @@ struct sdhci_host { unsigned long private[0] ____cacheline_aligned; }; + +struct sdhci_ops { +#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS + u32 (*read_l)(struct sdhci_host *host, int reg); + u16 (*read_w)(struct sdhci_host *host, int reg); + u8 (*read_b)(struct sdhci_host *host, int reg); + void (*write_l)(struct sdhci_host *host, u32 val, int reg); + void (*write_w)(struct sdhci_host *host, u16 val, int reg); + void (*write_b)(struct sdhci_host *host, u8 val, int reg); +#endif + + void (*set_clock)(struct sdhci_host *host, unsigned int clock); + + int (*enable_dma)(struct sdhci_host *host); + unsigned int (*get_max_clock)(struct sdhci_host *host); + unsigned int (*get_min_clock)(struct sdhci_host *host); + unsigned int (*get_timeout_clock)(struct sdhci_host *host); + int (*platform_8bit_width)(struct sdhci_host *host, + int width); + void (*platform_send_init_74_clocks)(struct sdhci_host *host, + u8 power_mode); + unsigned int (*get_ro)(struct sdhci_host *host); +}; + + +static inline void *sdhci_priv(struct sdhci_host *host) +{ + return (void *)host->private; +} + #endif /* __SDHCI_H */ -- 1.7.0.4