1 From 977f8a30103b9c4992cab8f49357fe0d4274004f Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
3 Date: Thu, 3 May 2012 14:55:26 +0200
4 Subject: [PATCH 69/80] MIPS: BCM63XX: pass caldata info to flash
7 arch/mips/bcm63xx/boards/board_bcm963xx.c | 2 +-
8 arch/mips/bcm63xx/dev-flash.c | 9 ++++++++-
9 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h | 4 +++-
10 3 files changed, 12 insertions(+), 3 deletions(-)
12 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
13 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
14 @@ -1027,7 +1027,7 @@ int __init board_register_devices(void)
16 spi_register_board_info(board.spis, board.num_spis);
18 - bcm63xx_flash_register();
19 + bcm63xx_flash_register(board.has_caldata, board.caldata);
21 /* count number of LEDs defined by this device */
22 while (led_count < ARRAY_SIZE(board.leds) && board.leds[led_count].name)
23 --- a/arch/mips/bcm63xx/dev-flash.c
24 +++ b/arch/mips/bcm63xx/dev-flash.c
25 @@ -35,12 +35,15 @@ static struct mtd_partition mtd_partitio
29 +static struct mtd_part_parser_data bcm63xx_parser_data;
31 static const char *bcm63xx_part_types[] = { "bcm63xxpart", "RedBoot", NULL };
33 static struct physmap_flash_data flash_data = {
35 .parts = mtd_partitions,
36 .part_probe_types = bcm63xx_part_types,
37 + .pp_data = &bcm63xx_parser_data,
40 static struct resource mtd_resources[] = {
41 @@ -62,6 +65,7 @@ static struct platform_device mtd_dev =
43 static struct flash_platform_data bcm63xx_flash_data = {
44 .part_probe_types = bcm63xx_part_types,
45 + .pp_data = &bcm63xx_parser_data,
48 static struct spi_board_info bcm63xx_spi_flash_info[] = {
49 @@ -189,9 +193,13 @@ void __init bcm63xx_flash_detect(void)
53 -int __init bcm63xx_flash_register(void)
54 +int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata)
59 + for (i = 0; i < num_caldata; i++)
60 + bcm63xx_parser_data.caldata[i] = caldata[i].caldata_offset;
63 case BCM63XX_FLASH_TYPE_PARALLEL:
64 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
65 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_flash.h
67 #ifndef __BCM63XX_FLASH_H
68 #define __BCM63XX_FLASH_H
70 +#include <board_bcm963xx.h>
73 BCM63XX_FLASH_TYPE_PARALLEL,
74 BCM63XX_FLASH_TYPE_SERIAL,
75 @@ -9,7 +11,7 @@ enum {
77 void bcm63xx_flash_detect(void);
79 -int __init bcm63xx_flash_register(void);
80 +int __init bcm63xx_flash_register(int num_caldata, struct ath9k_caldata *caldata);
82 int bcm63xx_flash_get_type(void);