2 * arch/ubicom32/mach-ip7k/board-ip7500wspkr.c
3 * Support for IP7500 Wireless Speaker board.
5 * This file supports the IP7500 Wireless Speaker board:
8 * (C) Copyright 2009, Ubicom, Inc.
10 * This file is part of the Ubicom32 Linux Kernel Port.
12 * The Ubicom32 Linux Kernel Port is free software: you can redistribute
13 * it and/or modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, either version 2 of the
15 * License, or (at your option) any later version.
17 * The Ubicom32 Linux Kernel Port is distributed in the hope that it
18 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
19 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
20 * the GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with the Ubicom32 Linux Kernel Port. If not,
24 * see <http://www.gnu.org/licenses/>.
26 #include <linux/device.h>
27 #include <linux/gpio.h>
28 #include <asm/board.h>
30 #include <linux/platform_device.h>
31 #include <asm/audio.h>
32 #include <linux/i2c.h>
33 #include <linux/i2c-gpio.h>
35 static struct i2c_board_info __initdata ip7500wspkr_i2c_board_info
[] = {
37 * U6, CS4350 DAC, address 0x4B
46 * I2C bus on the board, SDA PE4, SCL PE5
48 static struct i2c_gpio_platform_data ip7500wspkr_i2c_data
= {
51 .sda_is_open_drain
= 0,
52 .scl_is_open_drain
= 0,
56 static struct platform_device ip7500wspkr_i2c_device
= {
60 .platform_data
= &ip7500wspkr_i2c_data
,
64 static struct platform_device
*ip7500wspkr_devices
[] __initdata
= {
65 &ip7500wspkr_i2c_device
,
70 * Called to add the devices which we have on this board
72 static int __init
ip7500wspkr_init(void)
74 struct platform_device
*audio_dev
;
75 struct platform_device
*audio_dev2
;
81 platform_add_devices(ip7500wspkr_devices
, ARRAY_SIZE(ip7500wspkr_devices
));
83 audio_dev
= audio_device_alloc("snd-ubi32-cs4350", "audio", "audio-i2sout", 0);
85 ip7500wspkr_i2c_board_info
[0].platform_data
= audio_dev
;
88 audio_dev2
= audio_device_alloc("snd-ubi32-generic", "audio", "audio-spdifout", 0);
90 platform_device_register(audio_dev2
);
93 printk(KERN_INFO
"%s: registering i2c resources\n", __FUNCTION__
);
94 i2c_register_board_info(0, ip7500wspkr_i2c_board_info
, ARRAY_SIZE(ip7500wspkr_i2c_board_info
));
96 printk(KERN_INFO
"IP7500 Wireless Speaker Board\n");
101 arch_initcall(ip7500wspkr_init
);