spi: Remove unused parameters from spi_flash_probe and setup_spi_slave.
The spi_flash_probe and and spi_setup_slave functions each took a max_hz parameter and a spi_mode parameter which were never used. BUG=None TEST=Built for link, falco, rambi, nyan. BRANCH=None Change-Id: I3a2e0a9ab530bcc0f722f81f00e8c7bd1f6d2a22 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/192046 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org>
This commit is contained in:
parent
5c909de8a0
commit
42bf907986
16 changed files with 19 additions and 36 deletions
|
|
@ -157,7 +157,7 @@ void OemAgesaSaveMtrr(void)
|
|||
|
||||
spi_init();
|
||||
|
||||
flash = spi_flash_probe(0, 0, 0, 0);
|
||||
flash = spi_flash_probe(0, 0);
|
||||
if (!flash) {
|
||||
printk(BIOS_DEBUG, "Could not find SPI device\n");
|
||||
return;
|
||||
|
|
@ -272,7 +272,7 @@ u32 OemAgesaSaveS3Info(S3_DATA_TYPE S3DataType, u32 DataSize, void *Data)
|
|||
}
|
||||
|
||||
spi_init();
|
||||
flash = spi_flash_probe(0, 0, 0, 0);
|
||||
flash = spi_flash_probe(0, 0);
|
||||
if (!flash) {
|
||||
printk(BIOS_DEBUG, "Could not find SPI device\n");
|
||||
/* Dont make flow stop. */
|
||||
|
|
|
|||
|
|
@ -547,7 +547,7 @@ int elog_init(void)
|
|||
|
||||
/* Prepare SPI */
|
||||
spi_init();
|
||||
elog_spi = spi_flash_probe(0, 0, 0, 0);
|
||||
elog_spi = spi_flash_probe(0, 0);
|
||||
if (!elog_spi) {
|
||||
printk(BIOS_ERR, "ELOG: Unable to find SPI flash\n");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -246,15 +246,14 @@ static struct {
|
|||
};
|
||||
#define IDCODE_LEN (IDCODE_CONT_LEN + IDCODE_PART_LEN)
|
||||
|
||||
struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int spi_mode)
|
||||
struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
struct spi_slave *spi;
|
||||
struct spi_flash *flash = NULL;
|
||||
int ret, i, shift;
|
||||
u8 idcode[IDCODE_LEN], *idp;
|
||||
|
||||
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
|
||||
spi = spi_setup_slave(bus, cs);
|
||||
if (!spi) {
|
||||
printk(BIOS_WARNING, "SF: Failed to set up slave\n");
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@
|
|||
#include <spi-generic.h>
|
||||
#include <timer.h>
|
||||
|
||||
#define CROSEC_SPI_SPEED (500000)
|
||||
|
||||
static const uint8_t EcFramingByte = 0xec;
|
||||
|
||||
static int crosec_spi_io(uint8_t *write_bytes, size_t write_size,
|
||||
|
|
@ -80,12 +78,9 @@ static int crosec_spi_io(uint8_t *write_bytes, size_t write_size,
|
|||
int google_chromeec_command(struct chromeec_command *cec_command)
|
||||
{
|
||||
static struct spi_slave *slave = NULL;
|
||||
if (!slave) {
|
||||
if (!slave)
|
||||
slave = spi_setup_slave(CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS,
|
||||
CONFIG_EC_GOOGLE_CHROMEEC_SPI_CHIP,
|
||||
CROSEC_SPI_SPEED,
|
||||
SPI_READ_FLAG | SPI_WRITE_FLAG);
|
||||
}
|
||||
CONFIG_EC_GOOGLE_CHROMEEC_SPI_CHIP);
|
||||
return crosec_command_proto(cec_command, crosec_spi_io, slave);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,14 +82,11 @@ void spi_init(void);
|
|||
*
|
||||
* bus: Bus ID of the slave chip.
|
||||
* cs: Chip select ID of the slave chip on the specified bus.
|
||||
* max_hz: Maximum SCK rate in Hz.
|
||||
* mode: Clock polarity, clock phase and other parameters.
|
||||
*
|
||||
* Returns: A spi_slave reference that can be used in subsequent SPI
|
||||
* calls, or NULL if one or more of the parameters are not supported.
|
||||
*/
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode);
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs);
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
* Claim the bus and prepare it for communication with a given slave.
|
||||
|
|
|
|||
|
|
@ -66,8 +66,7 @@ struct spi_flash {
|
|||
size_t len);
|
||||
};
|
||||
|
||||
struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int spi_mode);
|
||||
struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs);
|
||||
|
||||
static inline int spi_flash_read(struct spi_flash *flash, u32 offset,
|
||||
size_t len, void *buf)
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static void update_mrc_cache(void *unused)
|
|||
|
||||
// 1. use spi_flash_probe() to find the flash, then
|
||||
spi_init();
|
||||
struct spi_flash *flash = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
|
||||
struct spi_flash *flash = spi_flash_probe(0, 0);
|
||||
if (!flash) {
|
||||
printk(BIOS_DEBUG, "Could not find SPI device\n");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ static void update_mrc_cache(void *unused)
|
|||
|
||||
// 1. use spi_flash_probe() to find the flash, then
|
||||
spi_init();
|
||||
struct spi_flash *flash = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
|
||||
struct spi_flash *flash = spi_flash_probe(0, 0);
|
||||
if (!flash) {
|
||||
printk(BIOS_DEBUG, "Could not find SPI device\n");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ static int nvm_init(void)
|
|||
return 0;
|
||||
|
||||
spi_init();
|
||||
flash = spi_flash_probe(0, 0, 1000000, SPI_MODE_3);
|
||||
flash = spi_flash_probe(0, 0);
|
||||
if (!flash) {
|
||||
printk(BIOS_DEBUG, "Could not find SPI device\n");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -266,8 +266,7 @@ static void ich_set_bbar(uint32_t minaddr)
|
|||
writel_(ichspi_bbar, cntlr.bbar);
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
ich_spi_slave *slave = malloc(sizeof(*slave));
|
||||
|
||||
|
|
|
|||
|
|
@ -923,8 +923,7 @@ int initialize_tegra_spi_cbfs_media(struct cbfs_media *media,
|
|||
return 0;
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
struct tegra_spi_channel *channel = to_tegra_spi(bus);
|
||||
if (!channel)
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ static void exynos_spi_init(struct exynos_spi *regs)
|
|||
spi_sw_reset(regs, 1);
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
ASSERT(bus >= 0 && bus < 3);
|
||||
struct exynos_spi_slave *eslave = &exynos_spi_slaves[bus];
|
||||
|
|
|
|||
|
|
@ -132,8 +132,7 @@ void spi_cs_deactivate(struct spi_slave *slave)
|
|||
{
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
struct spi_slave *slave = malloc(sizeof(*slave));
|
||||
|
||||
|
|
|
|||
|
|
@ -164,8 +164,7 @@ void spi_cs_deactivate(struct spi_slave *slave)
|
|||
{
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
struct spi_slave *slave = malloc(sizeof(*slave));
|
||||
|
||||
|
|
|
|||
|
|
@ -279,8 +279,7 @@ static void ich_set_bbar(uint32_t minaddr)
|
|||
writel_(ichspi_bbar, cntlr.bbar);
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
ich_spi_slave *slave = malloc(sizeof(*slave));
|
||||
|
||||
|
|
|
|||
|
|
@ -266,8 +266,7 @@ static void ich_set_bbar(uint32_t minaddr)
|
|||
writel_(ichspi_bbar, cntlr.bbar);
|
||||
}
|
||||
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
|
||||
unsigned int max_hz, unsigned int mode)
|
||||
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
|
||||
{
|
||||
ich_spi_slave *slave = malloc(sizeof(*slave));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue