From 58f8bddf88e1968542300a7ea9eb555ed5600585 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Sat, 19 May 2012 18:28:07 +0200 Subject: [PATCH] zenxfi2: add fmradio i2c glue Change-Id: Ifa8781b3c416002355b17591a4fdbed8a20979a8 --- firmware/SOURCES | 1 + .../creative-zenxfi2/fmradio-i2c-zenxfi2.c | 40 +++++++++++++++++++ firmware/target/arm/imx233/system-imx233.c | 4 +- 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 firmware/target/arm/imx233/creative-zenxfi2/fmradio-i2c-zenxfi2.c diff --git a/firmware/SOURCES b/firmware/SOURCES index 5cb464e6b1..c2bd45996c 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1132,6 +1132,7 @@ target/arm/tms320dm320/creative-zvm/usb-creativezvm.c #endif /* CREATIVE_ZVx */ #ifdef CREATIVE_ZENXFI2 +target/arm/imx233/creative-zenxfi2/fmradio-i2c-zenxfi2.c target/arm/imx233/creative-zenxfi2/backlight-zenxfi2.c target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c target/arm/imx233/creative-zenxfi2/button-zenxfi2.c diff --git a/firmware/target/arm/imx233/creative-zenxfi2/fmradio-i2c-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/fmradio-i2c-zenxfi2.c new file mode 100644 index 0000000000..58ac8e6a08 --- /dev/null +++ b/firmware/target/arm/imx233/creative-zenxfi2/fmradio-i2c-zenxfi2.c @@ -0,0 +1,40 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2012 by Amaury Pouly + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "system.h" +#include "fmradio_i2c.h" +#include "pinctrl-imx233.h" +#include "i2c.h" + +void fmradio_i2c_init(void) +{ +} + +int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count) +{ + return i2c_write(address, buf, count); +} + +int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) +{ + return i2c_read(address, buf, count); +} diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c index a24927f9a5..07c29a8644 100644 --- a/firmware/target/arm/imx233/system-imx233.c +++ b/firmware/target/arm/imx233/system-imx233.c @@ -110,8 +110,8 @@ void system_init(void) imx233_pwm_init(); imx233_lradc_init(); imx233_i2c_init(); -#if !defined(BOOTLOADER) && \ - (defined(SANSA_FUZEPLUS) || defined(CREATIVE_ZENXFI3)) +#if !defined(BOOTLOADER) &&(defined(SANSA_FUZEPLUS) || \ + defined(CREATIVE_ZENXFI3) || defined(CREATIVE_ZENXFI2)) fmradio_i2c_init(); #endif }