Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7aef828d authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Linus Walleij
Browse files

ARM: ep93xx: Add lm70 HWMON sensor to TS-72xx boards



Register the TI TMP122 (lm70) temperature sensor driver for the TS-72xx
boards.

Originaly from Florian Fainelli. Updated to the new spi-ep93xx chip select
method.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAlexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 97c3bca9
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -18,7 +18,10 @@
#include <linux/io.h>
#include <linux/mtd/rawnand.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
#include <linux/platform_data/spi-ep93xx.h>

#include <mach/gpio-ep93xx.h>
#include <mach/hardware.h>

#include <asm/mach-types.h>
@@ -230,6 +233,27 @@ static struct platform_device ts73xx_fpga_device = {

#endif

/*************************************************************************
 * SPI Bus
 *************************************************************************/
static struct spi_board_info ts72xx_spi_devices[] __initdata = {
	{
		.modalias		= "tmp122",
		.max_speed_hz		= 2 * 1000 * 1000,
		.bus_num		= 0,
		.chip_select		= 0,
	},
};

static int ts72xx_spi_chipselects[] __initdata = {
	EP93XX_GPIO_LINE_F(2),		/* DIO_17 */
};

static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
	.chipselect	= ts72xx_spi_chipselects,
	.num_chipselect	= ARRAY_SIZE(ts72xx_spi_chipselects),
};

static void __init ts72xx_init_machine(void)
{
	ep93xx_init_devices();
@@ -242,6 +266,8 @@ static void __init ts72xx_init_machine(void)
	if (board_is_ts7300())
		platform_device_register(&ts73xx_fpga_device);
#endif
	ep93xx_register_spi(&ts72xx_spi_info, ts72xx_spi_devices,
			    ARRAY_SIZE(ts72xx_spi_devices));
}

MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")