2017-12-14 14:28:27 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
|
2014-02-14 14:56:17 +08:00
|
|
|
/*
|
2010-01-18 16:45:52 +08:00
|
|
|
* Copyright (C) 2009 Samsung Electronics Ltd.
|
|
|
|
* Jaswinder Singh <jassi.brar@samsung.com>
|
|
|
|
*/
|
|
|
|
|
2014-02-14 14:56:17 +08:00
|
|
|
#ifndef __SPI_S3C64XX_H
|
|
|
|
#define __SPI_S3C64XX_H
|
2010-01-18 16:45:52 +08:00
|
|
|
|
2013-04-12 04:42:03 +08:00
|
|
|
#include <linux/dmaengine.h>
|
|
|
|
|
2011-12-29 17:01:08 +08:00
|
|
|
struct platform_device;
|
|
|
|
|
2010-01-18 16:45:52 +08:00
|
|
|
/**
|
|
|
|
* struct s3c64xx_spi_csinfo - ChipSelect description
|
|
|
|
* @fb_delay: Slave specific feedback delay.
|
|
|
|
* Refer to FB_CLK_SEL register definition in SPI chapter.
|
|
|
|
* @line: Custom 'identity' of the CS line.
|
|
|
|
*
|
|
|
|
* This is per SPI-Slave Chipselect information.
|
|
|
|
* Allocate and initialize one in machine init code and make the
|
|
|
|
* spi_board_info.controller_data point to it.
|
|
|
|
*/
|
|
|
|
struct s3c64xx_spi_csinfo {
|
|
|
|
u8 fb_delay;
|
|
|
|
unsigned line;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct s3c64xx_spi_info - SPI Controller defining structure
|
|
|
|
* @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
|
|
|
|
* @num_cs: Number of CS this controller emulates.
|
|
|
|
* @cfg_gpio: Configure pins for this SPI controller.
|
|
|
|
*/
|
|
|
|
struct s3c64xx_spi_info {
|
|
|
|
int src_clk_nr;
|
|
|
|
int num_cs;
|
2016-06-28 10:41:12 +08:00
|
|
|
bool no_cs;
|
2012-07-13 06:15:14 +08:00
|
|
|
int (*cfg_gpio)(void);
|
2010-01-18 16:45:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2011-12-23 09:14:31 +08:00
|
|
|
* s3c64xx_spi_set_platdata - SPI Controller configure callback by the board
|
2010-01-18 16:45:52 +08:00
|
|
|
* initialization code.
|
2012-07-13 06:15:14 +08:00
|
|
|
* @cfg_gpio: Pointer to gpio setup function.
|
2010-01-18 16:45:52 +08:00
|
|
|
* @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
|
|
|
|
* @num_cs: Number of elements in the 'cs' array.
|
|
|
|
*
|
|
|
|
* Call this from machine init code for each SPI Controller that
|
|
|
|
* has some chips attached to it.
|
|
|
|
*/
|
2012-07-13 06:15:14 +08:00
|
|
|
extern void s3c64xx_spi0_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
|
|
|
|
int num_cs);
|
|
|
|
extern void s3c64xx_spi1_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
|
|
|
|
int num_cs);
|
|
|
|
extern void s3c64xx_spi2_set_platdata(int (*cfg_gpio)(void), int src_clk_nr,
|
|
|
|
int num_cs);
|
2011-12-23 09:14:36 +08:00
|
|
|
|
|
|
|
/* defined by architecture to configure gpio */
|
2012-07-13 06:15:14 +08:00
|
|
|
extern int s3c64xx_spi0_cfg_gpio(void);
|
|
|
|
extern int s3c64xx_spi1_cfg_gpio(void);
|
|
|
|
extern int s3c64xx_spi2_cfg_gpio(void);
|
2011-12-23 09:14:36 +08:00
|
|
|
|
|
|
|
extern struct s3c64xx_spi_info s3c64xx_spi0_pdata;
|
|
|
|
extern struct s3c64xx_spi_info s3c64xx_spi1_pdata;
|
2011-12-23 09:14:45 +08:00
|
|
|
extern struct s3c64xx_spi_info s3c64xx_spi2_pdata;
|
2014-02-14 14:56:17 +08:00
|
|
|
#endif /*__SPI_S3C64XX_H */
|