mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
iAudio, iRiver: As both platforms use the same i2c interface i have renamed i2c-h100.c/h to i2c-coldfire.c/h. Also i have changed some stuff in config.h and config-xx.h. Hope everybody agrees with this patch, else we can unroll and improve it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7271 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6109a3b0be
commit
4894a06a15
8 changed files with 32 additions and 29 deletions
|
@ -79,8 +79,8 @@ drivers/fmradio_i2c.c
|
||||||
tuner_philips.c
|
tuner_philips.c
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_I2C == I2C_H100
|
#if CONFIG_I2C == I2C_COLDFIRE
|
||||||
drivers/i2c-h100.c
|
drivers/i2c-coldfire.c
|
||||||
#else
|
#else
|
||||||
drivers/i2c.c
|
drivers/i2c.c
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
#include "i2c-h100.h"
|
#include "i2c-coldfire.h"
|
||||||
|
|
||||||
#define I2C_DEVICE_1 ((volatile unsigned char *)&MADR)
|
#define I2C_DEVICE_1 ((volatile unsigned char *)&MADR)
|
||||||
#define I2C_DEVICE_2 ((volatile unsigned char *)&MADR2)
|
#define I2C_DEVICE_2 ((volatile unsigned char *)&MADR2)
|
||||||
|
@ -37,6 +37,7 @@ static volatile unsigned char *i2c_get_addr(int device);
|
||||||
|
|
||||||
void i2c_init(void)
|
void i2c_init(void)
|
||||||
{
|
{
|
||||||
|
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
|
||||||
/* Audio Codec */
|
/* Audio Codec */
|
||||||
MADR = 0x6c; /* iRiver firmware uses this addr */
|
MADR = 0x6c; /* iRiver firmware uses this addr */
|
||||||
MBDR = 0; /* iRiver firmware does this */
|
MBDR = 0; /* iRiver firmware does this */
|
||||||
|
@ -48,22 +49,21 @@ void i2c_init(void)
|
||||||
MBDR2 = 0;
|
MBDR2 = 0;
|
||||||
MBCR2 = IEN;
|
MBCR2 = IEN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void i2c_close(void)
|
void i2c_close(void)
|
||||||
{
|
{
|
||||||
MBCR = 0;
|
MBCR = 0;
|
||||||
|
|
||||||
#if 0
|
|
||||||
MBCR2 = 0;
|
MBCR2 = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes bytes to the selected device.
|
* Writes bytes to the selected device.
|
||||||
*
|
*
|
||||||
* Use device=1 for bus 1 at 0x40000280 (Audio Codec)
|
* Use device=1 for bus 1 at 0x40000280
|
||||||
* Use device=2 for bus 2 at 0x80000440 (Tuner ?)
|
* Use device=2 for bus 2 at 0x80000440
|
||||||
*
|
*
|
||||||
* Returns number of bytes successfully send or -1 if START failed
|
* Returns number of bytes successfully send or -1 if START failed
|
||||||
*/
|
*/
|
|
@ -52,7 +52,8 @@
|
||||||
/* Define this if you have a Motorola SCF5249 */
|
/* Define this if you have a Motorola SCF5249 */
|
||||||
#define CONFIG_CPU MCF5249
|
#define CONFIG_CPU MCF5249
|
||||||
|
|
||||||
#define CONFIG_I2C I2C_H100
|
/* Define this if you want to use coldfire's i2c interface */
|
||||||
|
#define CONFIG_I2C I2C_COLDFIRE
|
||||||
|
|
||||||
#define HAVE_UDA1380
|
#define HAVE_UDA1380
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,8 @@
|
||||||
/* Define this if you have a Motorola SCF5249 */
|
/* Define this if you have a Motorola SCF5249 */
|
||||||
#define CONFIG_CPU MCF5249
|
#define CONFIG_CPU MCF5249
|
||||||
|
|
||||||
#define CONFIG_I2C I2C_H100
|
/* Define this if you want to use coldfire's i2c interface */
|
||||||
|
#define CONFIG_I2C I2C_COLDFIRE
|
||||||
|
|
||||||
#define HAVE_UDA1380
|
#define HAVE_UDA1380
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@
|
||||||
/* Define this if you have a Motorola SCF5249 */
|
/* Define this if you have a Motorola SCF5249 */
|
||||||
#define CONFIG_CPU MCF5249
|
#define CONFIG_CPU MCF5249
|
||||||
|
|
||||||
#define CONFIG_I2C I2C_H100
|
/* Define this if you want to use coldfire's i2c interface */
|
||||||
|
#define CONFIG_I2C I2C_COLDFIRE
|
||||||
|
|
||||||
#define HAVE_UDA1380
|
#define HAVE_UDA1380
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,11 @@
|
||||||
|
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
|
|
||||||
/* Define this if you have a Motorola SCF5249 */
|
/* Define this if you have a Motorola SCF5250 */
|
||||||
#define CONFIG_CPU MCF5250
|
#define CONFIG_CPU MCF5250
|
||||||
|
|
||||||
#define CONFIG_I2C I2C_IAUDIO
|
/* Define this if you want to use coldfire's i2c interface */
|
||||||
|
#define CONFIG_I2C I2C_COLDFIRE
|
||||||
|
|
||||||
#define HAVE_TLV320
|
#define HAVE_TLV320
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,7 @@
|
||||||
#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
|
#define I2C_PLAYREC 0 /* Archos Player/Recorder style */
|
||||||
#define I2C_ONDIO 1 /* Ondio style */
|
#define I2C_ONDIO 1 /* Ondio style */
|
||||||
#define I2C_GMINI 2 /* Gmini style */
|
#define I2C_GMINI 2 /* Gmini style */
|
||||||
#define I2C_H100 3 /* iRiver h100 style */
|
#define I2C_COLDFIRE 3 /* Coldfire style */
|
||||||
#define I2C_IAUDIO 4 /* iAuido style */
|
|
||||||
|
|
||||||
/* CONFIG_LED */
|
/* CONFIG_LED */
|
||||||
#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
|
#define LED_REAL 1 /* SW controlled LED (Archos recorders, player, Gmini) */
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Driver for MCF5249's I2C interface
|
* Driver for MCF52xx's I2C interface
|
||||||
* 2005-02-17 hubble@mochine.com
|
* 2005-02-17 hubble@mochine.com
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _I2C_H100_H
|
#ifndef _I2C_COLDFIRE_H
|
||||||
#define _I2C_H100_H
|
#define _I2C_COLDFIRE_H
|
||||||
|
|
||||||
void i2c_init(void);
|
void i2c_init(void);
|
||||||
int i2c_write(int device, unsigned char *buf, int count);
|
int i2c_write(int device, unsigned char *buf, int count);
|
Loading…
Add table
Add a link
Reference in a new issue