Raspberry Pi B+ 到着 & I2S出力確認

Raspberry Pi B+ が届きました。
しかし、P5がなくなってI2Sが使えるか謎でなんですよね~(´~`)
でも、公式フォーラムによると使えるとのことで試してみました。

sudo rpi-update

でファームウェア更新。

カーネルソースコードもってきてコンパイル。

bcm2708-i2s.c を以下のように赤字部分を修正。
static void bcm2708_i2s_setup_gpio(void)
{
        /*
         * This is the common way to handle the GPIO pins for
         * the Raspberry Pi.
         * TODO Better way would be to handle
         * this in the device tree!
         */
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
#define SET_GPIO_ALT(g,a) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))

        unsigned int *gpio;
        int pin;
        gpio = ioremap(GPIO_BASE, SZ_16K);

        /* SPI is on GPIO 7..11 */
        for (pin = 18; pin <= 21; pin++) {
                INP_GPIO(pin);          /* set mode to GPIO input first */
                SET_GPIO_ALT(pin, 0);   /* set mode to ALT 0 */
        }

#undef INP_GPIO
#undef SET_GPIO_ALT
}

でもって、このドライバーを組み込み、
http://elinux.org/RPi_BCM2835_GPIOs
を見つつ GPIO18、19、21 をDACに繋げば今までと同じように使えました。

/etc/modules に bcm2708_dmaengine も追加する必要あり。