Index: rbutil/e200rpatcher/Makefile =================================================================== --- rbutil/e200rpatcher/Makefile (revision 15548) +++ rbutil/e200rpatcher/Makefile (working copy) @@ -28,12 +28,12 @@ e200rpatcher-mac: e200rpatcher-i386 e200rpatcher-ppc lipo -create e200rpatcher-ppc e200rpatcher-i386 -output e200rpatcher-mac -e200rpatcher-i386: e200rpatcher.c bootimg.c usb.h libusb-i386.a - gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch i386 $(CFLAGS) -o e200rpatcher-i386 e200rpatcher.c bootimg.c -I. libusb-i386.a +e200rpatcher-i386: e200rpatcher.c bootimg.c + gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch i386 $(CFLAGS) -I/usr/local/include -L/usr/local/lib -lusb -o e200rpatcher-i386 e200rpatcher.c bootimg.c strip e200rpatcher-i386 -e200rpatcher-ppc: e200rpatcher.c bootimg.c usb.h libusb-ppc.a - gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch ppc $(CFLAGS) -o e200rpatcher-ppc e200rpatcher.c bootimg.c -I. libusb-ppc.a +e200rpatcher-ppc: e200rpatcher.c bootimg.c + gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -framework iokit -framework coreservices -arch ppc $(CFLAGS) -I/usr/local/include -L/usr/local/lib -lusb -o e200rpatcher-ppc e200rpatcher.c bootimg.c strip e200rpatcher-ppc bin2c: ../sansapatcher/bin2c.c Index: firmware/export/config-h10.h =================================================================== --- firmware/export/config-h10.h (revision 15548) +++ firmware/export/config-h10.h (working copy) @@ -12,7 +12,7 @@ #define HAVE_RECORDING /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ -#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) /* define the bitmask of hardware sample rates */ #define HW_SAMPR_CAPS (SAMPR_CAP_44) @@ -85,8 +85,8 @@ #define AB_REPEAT_ENABLE 1 /* FM Tuner */ -/*#define CONFIG_TUNER TEA5767 -#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */ +#define CONFIG_TUNER TEA5767 +#define CONFIG_TUNER_XTAL 32768 /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT Index: firmware/export/config-h10_5gb.h =================================================================== --- firmware/export/config-h10_5gb.h (revision 15548) +++ firmware/export/config-h10_5gb.h (working copy) @@ -12,7 +12,7 @@ #define HAVE_RECORDING /* Define bitmask of input sources - recordable bitmask can be defined explicitly if different */ -#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN) +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO) /* define the bitmask of hardware sample rates */ #define HW_SAMPR_CAPS (SAMPR_CAP_44) @@ -71,8 +71,8 @@ #define AB_REPEAT_ENABLE 1 /* FM Tuner */ -/*#define CONFIG_TUNER TEA5767 -#define CONFIG_TUNER_XTAL 32768 *//* TODO: what is this? */ +#define CONFIG_TUNER TEA5767 +#define CONFIG_TUNER_XTAL 32768 /* Define this for LCD backlight available */ #define HAVE_BACKLIGHT Index: firmware/target/arm/audio-pp.c =================================================================== --- firmware/target/arm/audio-pp.c (revision 15548) +++ firmware/target/arm/audio-pp.c (working copy) @@ -35,6 +35,7 @@ /* Prevent pops from unneeded switching */ static int last_source = AUDIO_SRC_PLAYBACK; #ifdef HAVE_FMRADIO_REC + bool recording = flags & SRCF_RECORDING; static bool last_recording = false; #endif @@ -90,3 +91,4 @@ } /* audio_input_mux */ + Index: firmware/target/arm/iriver/h10/power-h10.c =================================================================== --- firmware/target/arm/iriver/h10/power-h10.c (revision 15548) +++ firmware/target/arm/iriver/h10/power-h10.c (working copy) @@ -35,18 +35,25 @@ bool charger_enabled; #endif -#if 0 #if CONFIG_TUNER bool tuner_power(bool status) { (void)status; /* TODO: tuner power control */ - return true; + if(status==true) + { + /* switch recording input to the tuner */ + GPIOB_OUTPUT_VAL |= 0x04; + } + else + { + GPIOB_OUTPUT_VAL &= ~0x04; + } + return status; } #endif /* #if CONFIG_TUNER */ -#endif void power_init(void) { Index: firmware/drivers/fmradio_i2c.c =================================================================== --- firmware/drivers/fmradio_i2c.c (revision 15548) +++ firmware/drivers/fmradio_i2c.c (working copy) @@ -41,7 +41,7 @@ { return i2c_read(I2C_IFACE_0, address, buf, count); } -#else +#else /* IAUDIO_X5 */ /* cute little functions, atomic read-modify-write */ /* SDA is GPIO1,23 */ @@ -61,7 +61,7 @@ #define SCL_HI or_l( 0x01000000, &GPIO1_OUT) #define SCL ( 0x01000000 & GPIO1_READ) -#else +#else /* IRIVER_H300_SERIES */ /* SDA is GPIO55 */ #define SDA_OUTINIT and_l(~0x00800000, &GPIO1_OUT) @@ -75,8 +75,9 @@ #define SCL_LO and_l(~0x00000008, &GPIO_OUT) #define SCL_HI or_l( 0x00000008, &GPIO_OUT) #define SCL ( 0x00000008 & GPIO_READ) -#endif +#endif /* IRIVER_H300_SERIES */ + /* delay loop to achieve 400kHz at 120MHz CPU frequency */ #define DELAY \ ({ \ @@ -258,24 +259,25 @@ return x; } #endif /* ! IAUDIO_X5 */ -#else +#else /* CONFIG_I2C == I2C_COLDFIRE */ + /* cute little functions, atomic read-modify-write */ -/* SDA is PB4 */ -#define SDA_LO and_b(~0x10, &PBDRL) -#define SDA_HI or_b(0x10, &PBDRL) -#define SDA_INPUT and_b(~0x10, &PBIORL) -#define SDA_OUTPUT or_b(0x10, &PBIORL) -#define SDA (PBDR & 0x0010) +/* SDA is GPIOD.3 */ +#define SDA_LO (GPIOD_OUTPUT_VAL &=~0x08) +#define SDA_HI (GPIOD_OUTPUT_VAL |= 0x08) +#define SDA_INPUT (GPIOD_OUTPUT_EN &=~0x08) +#define SDA_OUTPUT (GPIOD_OUTPUT_EN |= 0x08) +#define SDA (GPIOD_OUTPUT_VAL & 0x0008) -/* SCL is PB1 */ -#define SCL_INPUT and_b(~0x02, &PBIORL) -#define SCL_OUTPUT or_b(0x02, &PBIORL) -#define SCL_LO and_b(~0x02, &PBDRL) -#define SCL_HI or_b(0x02, &PBDRL) -#define SCL (PBDR & 0x0002) +/* SCL is GPIOD.4 */ +#define SCL_INPUT (GPIOD_OUTPUT_EN &=~0x10) +#define SCL_OUTPUT (GPIOD_OUTPUT_EN |= 0x10) +#define SCL_LO (GPIOD_OUTPUT_VAL &=~0x10) +#define SCL_HI (GPIOD_OUTPUT_VAL |= 0x10) +#define SCL (GPIOD_OUTPUT_EN & 0x0010) /* arbitrary delay loop */ -#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) +#define DELAY udelay(1) static void fmradio_i2c_start(void) {