aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/arch/mips/ar71xx/dev-m25p80.c
blob: 666b508fc4adba5b1a46f1eb0afbfcbb2eeb24d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 *  Copyright (C) 2009 Gabor Juhos <juhosg@openwrt.org>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#include <linux/init.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>

#include "devices.h"
#include "dev-m25p80.h"

static struct spi_board_info ar71xx_spi_info[] = {
	{
		.bus_num	= 0,
		.chip_select	= 0,
		.max_speed_hz	= 25000000,
		.modalias	= "m25p80",
	}
};

void __init ar71xx_add_device_m25p80(struct flash_platform_data *pdata)
{
	ar71xx_spi_info[0].platform_data = pdata;
	ar71xx_add_device_spi(NULL, ar71xx_spi_info,
			      ARRAY_SIZE(ar71xx_spi_info));
}