Skip to content

Commit

Permalink
ARM: kirkwood: Add HP T5325 thin client
Browse files Browse the repository at this point in the history
Convert the kirkwood t5325-setup.c to mostly device tree for
mach-mvebu. Part of the audio setup needs to remain in C for the
moment until suitable bindings are designed and implemented. So add
board code, triggered by the compatibility string.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
lunn authored and Jason Cooper committed Feb 25, 2014
1 parent 1b82af4 commit b02b643
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
7 changes: 7 additions & 0 deletions arch/arm/mach-mvebu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ config MACH_KIRKWOOD
Say 'Y' here if you want your kernel to support boards based
on the Marvell Kirkwood device tree.

config MACH_T5325
bool "HP T5325 thin client"
depends on MACH_KIRKWOOD
help
Say 'Y' here if you want your kernel to support the
HP T5325 Thin client

endmenu

endif
1 change: 1 addition & 0 deletions arch/arm/mach-mvebu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o
obj-$(CONFIG_MACH_T5325) += board-t5325.o
41 changes: 41 additions & 0 deletions arch/arm/mach-mvebu/board-t5325.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* HP T5325 Board Setup
*
* Copyright (C) 2014
*
* Andrew Lunn <andrew@lunn.ch>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/

#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <sound/alc5623.h>
#include "board.h"

static struct platform_device hp_t5325_audio_device = {
.name = "t5325-audio",
.id = -1,
};

static struct alc5623_platform_data alc5621_data = {
.add_ctrl = 0x3700,
.jack_det_ctrl = 0x4810,
};

static struct i2c_board_info i2c_board_info[] __initdata = {
{
I2C_BOARD_INFO("alc5621", 0x1a),
.platform_data = &alc5621_data,
},
};

void __init t5325_init(void)
{
i2c_register_board_info(0, i2c_board_info, ARRAY_SIZE(i2c_board_info));
platform_device_register(&hp_t5325_audio_device);
}
22 changes: 22 additions & 0 deletions arch/arm/mach-mvebu/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Board functions for Marvell System On Chip
*
* Copyright (C) 2014
*
* Andrew Lunn <andrew@lunn.ch>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/

#ifndef __ARCH_MVEBU_BOARD_H
#define __ARCH_MVEBU_BOARD_H

#ifdef CONFIG_MACH_T5325
void t5325_init(void);
#else
static inline void t5325_init(void) {};
#endif

#endif
11 changes: 10 additions & 1 deletion arch/arm/mach-mvebu/kirkwood.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "kirkwood.h"
#include "kirkwood-pm.h"
#include "common.h"
#include "board.h"

static struct resource kirkwood_cpufreq_resources[] = {
[0] = {
Expand Down Expand Up @@ -158,6 +159,11 @@ void kirkwood_disable_mbus_error_propagation(void)
writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config);
}

static struct of_dev_auxdata auxdata[] __initdata = {
OF_DEV_AUXDATA("marvell,kirkwood-audio", 0xf10a0000,
"mvebu-audio", NULL),
{ /* sentinel */ }
};

static void __init kirkwood_dt_init(void)
{
Expand All @@ -174,7 +180,10 @@ static void __init kirkwood_dt_init(void)
kirkwood_pm_init();
kirkwood_dt_eth_fixup();

of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
if (of_machine_is_compatible("hp,t5325"))
t5325_init();

of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
}

static const char * const kirkwood_dt_board_compat[] = {
Expand Down

0 comments on commit b02b643

Please sign in to comment.