blob: 3b2b958be34b22de489e38727b60801a9cdb6ca9 [file] [log] [blame]
/*
* From the header:
*
* This outlines the configuration (namely pins for SPI drivers)
* of the GFMN100 "WindCharger" board.
*
* GFMN100 Contains:
*
* -- One mx25l25655e nonvolatile storage device
* -- One lm95071 temperature sensor
*/
#include <linux/init.h>
#include <linux/spi/spi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include "common.h"
#include "dev-spi.h"
#include "dev-gfmn100.h"
#define GFMN100_LM95071_CS 14 /* GPIO pin for temp sensor */
#define GFMN100_LM95071_HZ 5000000 /* max SPI clk speed */
#define GFMN100_LM95071_MA "lm95071" /* Modalias */
#define GFMN100_BUS 0
static struct ath79_spi_controller_data ath79_spi0_cdata = {
.cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
.cs_line = 0,
.is_flash = true,
};
static struct ath79_spi_controller_data ath79_spi1_cdata = {
.cs_type = ATH79_SPI_CS_TYPE_GPIO,
.cs_line = GFMN100_LM95071_CS,
.is_flash = false,
};
static struct spi_board_info ath79_spi_info[] = {
{
.bus_num = GFMN100_BUS,
.chip_select = 0,
.max_speed_hz = 25000000,
.modalias = "mx25l25655e",
.controller_data = &ath79_spi0_cdata,
},
{
.bus_num = GFMN100_BUS,
.chip_select = 1,
.max_speed_hz = GFMN100_LM95071_HZ,
.modalias = GFMN100_LM95071_MA,
.controller_data = &ath79_spi1_cdata,
},
};
struct ath79_spi_platform_data ath79_spi_data;
void __init ath79_register_gfmn100(void)
{
ssize_t cs_count = ARRAY_SIZE(ath79_spi_info);
ath79_spi_data.bus_num = GFMN100_BUS;
ath79_spi_data.num_chipselect = cs_count;
ath79_gpio_direction_select(GFMN100_LM95071_CS, true);
ath79_register_spi(&ath79_spi_data, ath79_spi_info, cs_count);
}