2017-12-26 03:54:35 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
2011-02-14 15:22:36 +08:00
|
|
|
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
|
|
|
* http://www.samsung.com
|
2008-11-01 00:14:38 +08:00
|
|
|
*
|
|
|
|
* Copyright 2008 Openmoko, Inc.
|
|
|
|
* Copyright 2008 Simtec Electronics
|
|
|
|
* http://armlinux.simtec.co.uk/
|
|
|
|
* Ben Dooks <ben@simtec.co.uk>
|
|
|
|
*
|
|
|
|
* S3C Platform - SDHCI (HSMMC) platform data definitions
|
2017-12-26 03:54:35 +08:00
|
|
|
*/
|
2008-11-01 00:14:38 +08:00
|
|
|
|
|
|
|
#ifndef __PLAT_S3C_SDHCI_H
|
|
|
|
#define __PLAT_S3C_SDHCI_H __FILE__
|
|
|
|
|
2013-03-05 01:28:21 +08:00
|
|
|
#include <linux/platform_data/mmc-sdhci-s3c.h>
|
2019-09-03 00:37:30 +08:00
|
|
|
#include "devs.h"
|
2012-04-14 23:04:46 +08:00
|
|
|
|
2011-08-18 19:32:01 +08:00
|
|
|
/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
|
|
|
|
* @pd: The default platform data for this device.
|
|
|
|
* @set: Pointer to the platform data to fill in.
|
|
|
|
*/
|
|
|
|
extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
|
|
|
|
struct s3c_sdhci_platdata *set);
|
|
|
|
|
2008-11-01 00:14:38 +08:00
|
|
|
/**
|
|
|
|
* s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
|
|
|
|
* @pd: Platform data to register to device.
|
|
|
|
*
|
|
|
|
* Register the given platform data for use withe S3C SDHCI device.
|
|
|
|
* The call will copy the platform data, so the board definitions can
|
|
|
|
* make the structure itself __initdata.
|
|
|
|
*/
|
|
|
|
extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
|
2008-11-01 00:14:39 +08:00
|
|
|
extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
|
2009-11-17 15:41:23 +08:00
|
|
|
extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
|
2010-06-10 14:22:16 +08:00
|
|
|
extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd);
|
2008-11-01 00:14:38 +08:00
|
|
|
|
|
|
|
/* Default platform data, exported so that per-cpu initialisation can
|
|
|
|
* set the correct one when there are more than one cpu type selected.
|
|
|
|
*/
|
|
|
|
|
2008-11-01 00:14:39 +08:00
|
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
|
|
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
|
2009-11-17 15:41:23 +08:00
|
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
|
2010-06-10 14:22:16 +08:00
|
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
|
2008-11-01 00:14:38 +08:00
|
|
|
|
2011-03-31 09:57:33 +08:00
|
|
|
/* Helper function availability */
|
2008-11-01 00:14:38 +08:00
|
|
|
|
2009-03-25 19:01:24 +08:00
|
|
|
extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|
|
|
extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
2009-11-23 20:34:46 +08:00
|
|
|
extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
2009-03-25 19:01:24 +08:00
|
|
|
|
2010-07-29 21:18:45 +08:00
|
|
|
/* S3C64XX SDHCI setup */
|
2009-03-25 19:01:24 +08:00
|
|
|
|
2010-01-26 09:38:52 +08:00
|
|
|
#ifdef CONFIG_S3C64XX_SETUP_SDHCI
|
2009-03-25 19:01:24 +08:00
|
|
|
static inline void s3c6400_default_sdhci0(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
2009-03-25 19:01:24 +08:00
|
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2009-03-25 19:01:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline void s3c6400_default_sdhci1(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
2009-03-25 19:01:24 +08:00
|
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2009-03-25 19:01:24 +08:00
|
|
|
}
|
|
|
|
|
2009-11-23 20:34:46 +08:00
|
|
|
static inline void s3c6400_default_sdhci2(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
2009-11-23 20:34:46 +08:00
|
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2009-11-23 20:34:46 +08:00
|
|
|
}
|
2009-03-25 19:01:24 +08:00
|
|
|
|
2008-11-01 00:14:38 +08:00
|
|
|
static inline void s3c6410_default_sdhci0(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
2009-03-25 19:01:24 +08:00
|
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2008-11-01 00:14:38 +08:00
|
|
|
}
|
2008-11-01 00:14:39 +08:00
|
|
|
|
|
|
|
static inline void s3c6410_default_sdhci1(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
2009-03-25 19:01:24 +08:00
|
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2008-11-01 00:14:39 +08:00
|
|
|
}
|
2008-11-01 00:29:19 +08:00
|
|
|
|
2009-11-23 20:34:46 +08:00
|
|
|
static inline void s3c6410_default_sdhci2(void)
|
|
|
|
{
|
2010-07-29 21:18:45 +08:00
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
2009-11-23 20:34:46 +08:00
|
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
|
2010-07-29 21:18:45 +08:00
|
|
|
#endif
|
2009-11-23 20:34:46 +08:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:14:38 +08:00
|
|
|
#else
|
|
|
|
static inline void s3c6410_default_sdhci0(void) { }
|
2008-11-01 00:14:39 +08:00
|
|
|
static inline void s3c6410_default_sdhci1(void) { }
|
2010-06-22 14:45:26 +08:00
|
|
|
static inline void s3c6410_default_sdhci2(void) { }
|
2010-01-26 09:38:52 +08:00
|
|
|
static inline void s3c6400_default_sdhci0(void) { }
|
|
|
|
static inline void s3c6400_default_sdhci1(void) { }
|
2010-06-22 14:45:26 +08:00
|
|
|
static inline void s3c6400_default_sdhci2(void) { }
|
2010-01-26 09:38:52 +08:00
|
|
|
|
|
|
|
#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
|
2008-11-01 00:14:38 +08:00
|
|
|
|
2012-04-14 23:04:46 +08:00
|
|
|
static inline void s3c_sdhci_setname(int id, char *name)
|
|
|
|
{
|
|
|
|
switch (id) {
|
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
|
|
case 0:
|
|
|
|
s3c_device_hsmmc0.name = name;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
|
|
case 1:
|
|
|
|
s3c_device_hsmmc1.name = name;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
|
|
case 2:
|
|
|
|
s3c_device_hsmmc2.name = name;
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_S3C_DEV_HSMMC3
|
|
|
|
case 3:
|
|
|
|
s3c_device_hsmmc3.name = name;
|
|
|
|
break;
|
|
|
|
#endif
|
2013-02-13 02:27:52 +08:00
|
|
|
default:
|
|
|
|
break;
|
2012-04-14 23:04:46 +08:00
|
|
|
}
|
|
|
|
}
|
2008-11-01 00:14:38 +08:00
|
|
|
#endif /* __PLAT_S3C_SDHCI_H */
|