diff --git a/packages/linux/patches/linux-3.2.30-601-RPi_support-e33263e.patch b/packages/linux/patches/linux-3.2.30-601-RPi_support-8524c78.patch similarity index 99% rename from packages/linux/patches/linux-3.2.30-601-RPi_support-e33263e.patch rename to packages/linux/patches/linux-3.2.30-601-RPi_support-8524c78.patch index 818c93deab..f8d7654cc3 100644 --- a/packages/linux/patches/linux-3.2.30-601-RPi_support-e33263e.patch +++ b/packages/linux/patches/linux-3.2.30-601-RPi_support-8524c78.patch @@ -619,10 +619,10 @@ index 0000000..3b8bd74 +CONFIG_LIBCRC32C=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig new file mode 100644 -index 0000000..35c5042 +index 0000000..b4a3da1 --- /dev/null +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -0,0 +1,913 @@ +@@ -0,0 +1,945 @@ +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -673,9 +673,10 @@ index 0000000..35c5042 +CONFIG_KEXEC=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_STAT=m -+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -+CONFIG_CPU_FREQ_GOV_POWERSAVE=y ++CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y ++CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y ++CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_IDLE=y +CONFIG_VFP=y @@ -854,6 +855,7 @@ index 0000000..35c5042 +CONFIG_BRIDGE_EBT_LOG=m +CONFIG_BRIDGE_EBT_ULOG=m +CONFIG_BRIDGE_EBT_NFLOG=m ++CONFIG_L2TP=m +CONFIG_BRIDGE=m +CONFIG_VLAN_8021Q=m +CONFIG_VLAN_8021Q_GVRP=y @@ -1049,6 +1051,7 @@ index 0000000..35c5042 +CONFIG_RT73USB=m +CONFIG_RT2800USB=m +CONFIG_RT2800USB_RT53XX=y ++CONFIG_RT2800USB_UNKNOWN=y +CONFIG_WL1251=m +CONFIG_WL12XX_MENU=m +CONFIG_ZD1211RW=m @@ -1108,6 +1111,8 @@ index 0000000..35c5042 +CONFIG_W1_SLAVE_DS2780=m +CONFIG_W1_SLAVE_BQ27000=m +# CONFIG_HWMON is not set ++CONFIG_THERMAL=y ++CONFIG_THERMAL_BCM2835=y +CONFIG_WATCHDOG=y +CONFIG_BCM2708_WDT=m +CONFIG_MEDIA_SUPPORT=m @@ -1394,6 +1399,33 @@ index 0000000..35c5042 +CONFIG_LEDS_TRIGGER_DEFAULT_ON=m +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=m ++CONFIG_RTC_DRV_DS1374=m ++CONFIG_RTC_DRV_DS1672=m ++CONFIG_RTC_DRV_DS3232=m ++CONFIG_RTC_DRV_MAX6900=m ++CONFIG_RTC_DRV_RS5C372=m ++CONFIG_RTC_DRV_ISL1208=m ++CONFIG_RTC_DRV_ISL12022=m ++CONFIG_RTC_DRV_X1205=m ++CONFIG_RTC_DRV_PCF8563=m ++CONFIG_RTC_DRV_PCF8583=m ++CONFIG_RTC_DRV_M41T80=m ++CONFIG_RTC_DRV_BQ32K=m ++CONFIG_RTC_DRV_S35390A=m ++CONFIG_RTC_DRV_FM3130=m ++CONFIG_RTC_DRV_RX8581=m ++CONFIG_RTC_DRV_RX8025=m ++CONFIG_RTC_DRV_EM3027=m ++CONFIG_RTC_DRV_RV3029C2=m ++CONFIG_RTC_DRV_M41T93=m ++CONFIG_RTC_DRV_M41T94=m ++CONFIG_RTC_DRV_DS1305=m ++CONFIG_RTC_DRV_DS1390=m ++CONFIG_RTC_DRV_MAX6902=m ++CONFIG_RTC_DRV_R9701=m ++CONFIG_RTC_DRV_RS5C348=m ++CONFIG_RTC_DRV_DS3234=m ++CONFIG_RTC_DRV_PCF2123=m +CONFIG_UIO=m +CONFIG_UIO_PDRV=m +CONFIG_UIO_PDRV_GENIRQ=m @@ -2642,10 +2674,10 @@ index 0000000..0aa916e +#endif diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c new file mode 100644 -index 0000000..b3dbbd1 +index 0000000..72dcf31 --- /dev/null +++ b/arch/arm/mach-bcm2708/bcm2708.c -@@ -0,0 +1,825 @@ +@@ -0,0 +1,867 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708.c + * @@ -3164,6 +3196,48 @@ index 0000000..b3dbbd1 + .resource = 0, + .num_resources = 0, + }, ++ [1] = { ++ .name = "bcm2835_AUD1", ++ .id = 1, /* second audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [2] = { ++ .name = "bcm2835_AUD2", ++ .id = 2, /* third audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [3] = { ++ .name = "bcm2835_AUD3", ++ .id = 3, /* forth audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [4] = { ++ .name = "bcm2835_AUD4", ++ .id = 4, /* fifth audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [5] = { ++ .name = "bcm2835_AUD5", ++ .id = 5, /* sixth audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [6] = { ++ .name = "bcm2835_AUD6", ++ .id = 6, /* seventh audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, ++ [7] = { ++ .name = "bcm2835_AUD7", ++ .id = 7, /* eighth audio device */ ++ .resource = 0, ++ .num_resources = 0, ++ }, +}; + +static struct resource bcm2708_spi_resources[] = { @@ -7271,7 +7345,7 @@ index a48bc02..51ebbb3 100644 # PowerPC platform drivers diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c new file mode 100755 -index 0000000..aa6fc66 +index 0000000..6ff1edb --- /dev/null +++ b/drivers/cpufreq/bcm2835-cpufreq.c @@ -0,0 +1,239 @@ @@ -7473,7 +7547,7 @@ index 0000000..aa6fc66 + policy->cur = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE); + return -EINVAL; + } -+ print_info("Freq %d->%d (min=%d max=%d target=%d request=%d)", cur, policy->cur, policy->min, policy->max, target_freq, target); ++ print_debug("Freq %d->%d (min=%d max=%d target=%d request=%d)", cur, policy->cur, policy->min, policy->max, target_freq, target); + return 0; +} + @@ -7515,14 +7589,15 @@ index 0000000..aa6fc66 +module_exit(bcm2835_cpufreq_module_exit); + diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig -index 83e3e9d..761b528 100644 +index 83e3e9d..a22de2a 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig -@@ -1361,6 +1361,15 @@ config SENSORS_MC13783_ADC +@@ -1361,6 +1361,16 @@ config SENSORS_MC13783_ADC help Support for the A/D converter on MC13783 PMIC. +config SENSORS_BCM2835 ++ depends on THERMAL_BCM2835=n + tristate "Broadcom BCM2835 HWMON Driver" + help + If you say yes here you get support for the hardware @@ -7548,11 +7623,23 @@ index 8251ce8..8f2743b 100644 diff --git a/drivers/hwmon/bcm2835-hwmon.c b/drivers/hwmon/bcm2835-hwmon.c new file mode 100644 -index 0000000..4976387 +index 0000000..5bbed45 --- /dev/null +++ b/drivers/hwmon/bcm2835-hwmon.c -@@ -0,0 +1,211 @@ -+//bcm2835-hwmon.c +@@ -0,0 +1,219 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ + +#include +#include @@ -7579,12 +7666,12 @@ index 0000000..4976387 + +#define VC_TAG_GET_TEMP 0x00030006 +#define VC_TAG_GET_MAX_TEMP 0x0003000A ++ ++/* --- STRUCTS --- */ +struct bcm2835_hwmon_data { + struct device *hwmon_dev; +}; + -+/* --- STRUCTS --- */ -+ +/* tag part of the message */ +struct vc_msg_tag { + uint32_t tag_id; /* the tag ID for the temperature */ @@ -7618,16 +7705,12 @@ index 0000000..4976387 + +static SENSOR_DEVICE_ATTR(name, S_IRUGO,bcm2835_get_name,NULL,0); +static SENSOR_DEVICE_ATTR(temp1_input,S_IRUGO,bcm2835_get_temp,NULL,TEMP); -+static SENSOR_DEVICE_ATTR(temp,S_IRUGO,bcm2835_get_temp,NULL,TEMP); +static SENSOR_DEVICE_ATTR(temp1_max,S_IRUGO,bcm2835_get_temp,NULL,MAX_TEMP); -+static SENSOR_DEVICE_ATTR(trip_point_0_temp,S_IRUGO,bcm2835_get_temp,NULL,MAX_TEMP); + +static struct attribute* bcm2835_attributes[] = { + &sensor_dev_attr_name.dev_attr.attr, + &sensor_dev_attr_temp1_input.dev_attr.attr, + &sensor_dev_attr_temp1_max.dev_attr.attr, -+ &sensor_dev_attr_temp.dev_attr.attr, -+ &sensor_dev_attr_trip_point_0_temp.dev_attr.attr, + NULL, +}; + @@ -30097,7 +30180,7 @@ index 0000000..2703103 + + diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 6ce32a7..0562295 100644 +index 6ce32a7..b4ffbe3 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -27,6 +27,7 @@ @@ -30134,9 +30217,9 @@ index 6ce32a7..0562295 100644 + if(enable_llm) + { + local_irq_disable(); -+ enable_irq(host->irq); + if(host->second_irq) + enable_irq(host->second_irq); ++ enable_irq(host->irq); + } +#endif + spin_unlock(&host->lock); @@ -30168,9 +30251,9 @@ index 6ce32a7..0562295 100644 + if(enable_llm) + { + local_irq_disable(); -+ enable_irq(host->irq); + if(host->second_irq) + enable_irq(host->second_irq); ++ enable_irq(host->irq); + } +#endif + spin_unlock_irqrestore(&host->lock,flags); @@ -30200,17 +30283,7 @@ index 6ce32a7..0562295 100644 static void sdhci_clear_set_irqs(struct sdhci_host *host, u32 clear, u32 set) { -@@ -206,7 +292,9 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) - return; - } - timeout--; -+ sdhci_spin_enable_schedule(host); - mdelay(1); -+ sdhci_spin_disable_schedule(host); - } - - if (host->ops->platform_reset_exit) -@@ -269,7 +357,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -269,7 +355,7 @@ static void sdhci_led_control(struct led_classdev *led, struct sdhci_host *host = container_of(led, struct sdhci_host, led); unsigned long flags; @@ -30219,7 +30292,7 @@ index 6ce32a7..0562295 100644 if (host->runtime_suspended) goto out; -@@ -279,7 +367,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -279,7 +365,7 @@ static void sdhci_led_control(struct led_classdev *led, else sdhci_activate_led(host); out: @@ -30228,7 +30301,7 @@ index 6ce32a7..0562295 100644 } #endif -@@ -296,7 +384,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) +@@ -296,7 +382,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) u32 uninitialized_var(scratch); u8 *buf; @@ -30237,7 +30310,7 @@ index 6ce32a7..0562295 100644 blksize = host->data->blksz; chunk = 0; -@@ -341,7 +429,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host) +@@ -341,7 +427,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host) u32 scratch; u8 *buf; @@ -30246,7 +30319,7 @@ index 6ce32a7..0562295 100644 blksize = host->data->blksz; chunk = 0; -@@ -380,19 +468,28 @@ static void sdhci_write_block_pio(struct sdhci_host *host) +@@ -380,19 +466,28 @@ static void sdhci_write_block_pio(struct sdhci_host *host) local_irq_restore(flags); } @@ -30278,7 +30351,7 @@ index 6ce32a7..0562295 100644 /* * Some controllers (JMicron JMB38x) mess up the buffer bits -@@ -403,7 +500,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host) +@@ -403,7 +498,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host) (host->data->blocks == 1)) mask = ~0; @@ -30287,7 +30360,7 @@ index 6ce32a7..0562295 100644 if (host->quirks & SDHCI_QUIRK_PIO_NEEDS_DELAY) udelay(100); -@@ -415,9 +512,11 @@ static void sdhci_transfer_pio(struct sdhci_host *host) +@@ -415,9 +510,11 @@ static void sdhci_transfer_pio(struct sdhci_host *host) host->blocks--; if (host->blocks == 0) break; @@ -30300,7 +30373,7 @@ index 6ce32a7..0562295 100644 } static char *sdhci_kmap_atomic(struct scatterlist *sg, unsigned long *flags) -@@ -690,7 +789,9 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host) +@@ -690,7 +787,9 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host) u32 pio_irqs = SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL; u32 dma_irqs = SDHCI_INT_DMA_END | SDHCI_INT_ADMA_ERROR; @@ -30311,7 +30384,7 @@ index 6ce32a7..0562295 100644 sdhci_clear_set_irqs(host, pio_irqs, dma_irqs); else sdhci_clear_set_irqs(host, dma_irqs, pio_irqs); -@@ -722,44 +823,25 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -722,44 +821,25 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) host->data_early = 0; host->data->bytes_xfered = 0; @@ -30364,7 +30437,7 @@ index 6ce32a7..0562295 100644 int broken, i; struct scatterlist *sg; -@@ -818,7 +900,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -818,7 +898,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) */ WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; @@ -30374,7 +30447,7 @@ index 6ce32a7..0562295 100644 WARN_ON(sg_cnt != 1); sdhci_writel(host, sg_dma_address(data->sg), SDHCI_DMA_ADDRESS); -@@ -834,11 +917,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -834,11 +915,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) if (host->version >= SDHCI_SPEC_200) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); ctrl &= ~SDHCI_CTRL_DMA_MASK; @@ -30393,7 +30466,7 @@ index 6ce32a7..0562295 100644 sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } -@@ -890,7 +975,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, +@@ -890,7 +973,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, if (data->flags & MMC_DATA_READ) mode |= SDHCI_TRNS_READ; @@ -30403,7 +30476,7 @@ index 6ce32a7..0562295 100644 mode |= SDHCI_TRNS_DMA; sdhci_writew(host, mode, SDHCI_TRANSFER_MODE); -@@ -906,13 +992,16 @@ static void sdhci_finish_data(struct sdhci_host *host) +@@ -906,13 +990,16 @@ static void sdhci_finish_data(struct sdhci_host *host) host->data = NULL; if (host->flags & SDHCI_REQ_USE_DMA) { @@ -30424,7 +30497,7 @@ index 6ce32a7..0562295 100644 } /* -@@ -965,6 +1054,12 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) +@@ -965,6 +1052,12 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) mask |= SDHCI_DATA_INHIBIT; @@ -30437,7 +30510,7 @@ index 6ce32a7..0562295 100644 /* We shouldn't wait for data inihibit for stop commands, even though they might use busy signaling */ if (host->mrq->data && (cmd == host->mrq->data->stop)) -@@ -980,12 +1075,20 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) +@@ -980,12 +1073,20 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) return; } timeout--; @@ -30458,7 +30531,7 @@ index 6ce32a7..0562295 100644 sdhci_prepare_data(host, cmd); -@@ -1150,7 +1253,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) +@@ -1150,7 +1251,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) return; } timeout--; @@ -30468,7 +30541,7 @@ index 6ce32a7..0562295 100644 } clk |= SDHCI_CLOCK_CARD_EN; -@@ -1218,6 +1323,35 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) +@@ -1218,6 +1321,35 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) mdelay(10); } @@ -30504,7 +30577,7 @@ index 6ce32a7..0562295 100644 /*****************************************************************************\ * * * MMC callbacks * -@@ -1234,7 +1368,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1234,7 +1366,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) sdhci_runtime_pm_get(host); @@ -30513,7 +30586,7 @@ index 6ce32a7..0562295 100644 WARN_ON(host->mrq != NULL); -@@ -1276,9 +1410,9 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1276,9 +1408,9 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) */ if ((host->flags & SDHCI_NEEDS_RETUNING) && !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) { @@ -30525,7 +30598,7 @@ index 6ce32a7..0562295 100644 /* Restore original mmc_request structure */ host->mrq = mrq; -@@ -1291,15 +1425,16 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1291,15 +1423,16 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) } mmiowb(); @@ -30544,7 +30617,7 @@ index 6ce32a7..0562295 100644 if (host->flags & SDHCI_DEVICE_DEAD) goto out; -@@ -1356,7 +1491,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1356,7 +1489,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) else ctrl &= ~SDHCI_CTRL_HISPD; @@ -30553,7 +30626,7 @@ index 6ce32a7..0562295 100644 u16 clk, ctrl_2; unsigned int clock; -@@ -1364,7 +1499,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1364,7 +1497,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) if ((ios->timing == MMC_TIMING_UHS_SDR50) || (ios->timing == MMC_TIMING_UHS_SDR104) || (ios->timing == MMC_TIMING_UHS_DDR50) || @@ -30563,7 +30636,7 @@ index 6ce32a7..0562295 100644 ctrl |= SDHCI_CTRL_HISPD; ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1444,7 +1580,13 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1444,7 +1578,13 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) out: mmiowb(); @@ -30578,7 +30651,7 @@ index 6ce32a7..0562295 100644 } static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -1461,7 +1603,7 @@ static int sdhci_check_ro(struct sdhci_host *host) +@@ -1461,7 +1601,7 @@ static int sdhci_check_ro(struct sdhci_host *host) unsigned long flags; int is_readonly; @@ -30587,7 +30660,7 @@ index 6ce32a7..0562295 100644 if (host->flags & SDHCI_DEVICE_DEAD) is_readonly = 0; -@@ -1471,7 +1613,7 @@ static int sdhci_check_ro(struct sdhci_host *host) +@@ -1471,7 +1611,7 @@ static int sdhci_check_ro(struct sdhci_host *host) is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_WRITE_PROTECT); @@ -30596,7 +30669,7 @@ index 6ce32a7..0562295 100644 /* This quirk needs to be replaced by a callback-function later */ return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ? -@@ -1544,9 +1686,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) +@@ -1544,9 +1684,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; @@ -30608,7 +30681,7 @@ index 6ce32a7..0562295 100644 } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, -@@ -1849,7 +1991,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) +@@ -1849,7 +1989,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) if (host->version < SDHCI_SPEC_300) return; @@ -30617,7 +30690,7 @@ index 6ce32a7..0562295 100644 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1867,7 +2009,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) +@@ -1867,7 +2007,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) host->flags &= ~SDHCI_PV_ENABLED; } @@ -30626,7 +30699,7 @@ index 6ce32a7..0562295 100644 } static void sdhci_enable_preset_value(struct mmc_host *mmc, bool enable) -@@ -1888,6 +2030,8 @@ static const struct mmc_host_ops sdhci_ops = { +@@ -1888,6 +2028,8 @@ static const struct mmc_host_ops sdhci_ops = { .start_signal_voltage_switch = sdhci_start_signal_voltage_switch, .execute_tuning = sdhci_execute_tuning, .enable_preset_value = sdhci_enable_preset_value, @@ -30635,7 +30708,7 @@ index 6ce32a7..0562295 100644 }; /*****************************************************************************\ -@@ -1903,7 +2047,7 @@ static void sdhci_tasklet_card(unsigned long param) +@@ -1903,7 +2045,7 @@ static void sdhci_tasklet_card(unsigned long param) host = (struct sdhci_host*)param; @@ -30644,7 +30717,7 @@ index 6ce32a7..0562295 100644 /* Check host->mrq first in case we are runtime suspended */ if (host->mrq && -@@ -1920,7 +2064,7 @@ static void sdhci_tasklet_card(unsigned long param) +@@ -1920,7 +2062,7 @@ static void sdhci_tasklet_card(unsigned long param) tasklet_schedule(&host->finish_tasklet); } @@ -30653,7 +30726,7 @@ index 6ce32a7..0562295 100644 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); } -@@ -1933,14 +2077,14 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -1933,14 +2075,14 @@ static void sdhci_tasklet_finish(unsigned long param) host = (struct sdhci_host*)param; @@ -30670,7 +30743,7 @@ index 6ce32a7..0562295 100644 return; } -@@ -1983,7 +2127,7 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -1983,7 +2125,7 @@ static void sdhci_tasklet_finish(unsigned long param) #endif mmiowb(); @@ -30679,7 +30752,7 @@ index 6ce32a7..0562295 100644 mmc_request_done(host->mmc, mrq); sdhci_runtime_pm_put(host); -@@ -1996,11 +2140,11 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -1996,11 +2138,11 @@ static void sdhci_timeout_timer(unsigned long data) host = (struct sdhci_host*)data; @@ -30693,7 +30766,7 @@ index 6ce32a7..0562295 100644 sdhci_dumpregs(host); if (host->data) { -@@ -2017,7 +2161,7 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2017,7 +2159,7 @@ static void sdhci_timeout_timer(unsigned long data) } mmiowb(); @@ -30702,7 +30775,7 @@ index 6ce32a7..0562295 100644 } static void sdhci_tuning_timer(unsigned long data) -@@ -2027,11 +2171,11 @@ static void sdhci_tuning_timer(unsigned long data) +@@ -2027,11 +2169,11 @@ static void sdhci_tuning_timer(unsigned long data) host = (struct sdhci_host *)data; @@ -30716,7 +30789,7 @@ index 6ce32a7..0562295 100644 } /*****************************************************************************\ -@@ -2045,10 +2189,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) +@@ -2045,10 +2187,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) BUG_ON(intmask == 0); if (!host->cmd) { @@ -30734,7 +30807,7 @@ index 6ce32a7..0562295 100644 return; } -@@ -2118,6 +2265,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) +@@ -2118,6 +2263,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) static void sdhci_show_adma_error(struct sdhci_host *host) { } #endif @@ -30754,7 +30827,7 @@ index 6ce32a7..0562295 100644 static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) { BUG_ON(intmask == 0); -@@ -2144,34 +2304,57 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2144,34 +2302,57 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) return; } } @@ -30827,7 +30900,7 @@ index 6ce32a7..0562295 100644 /* * We currently don't do anything fancy with DMA -@@ -2200,18 +2383,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2200,18 +2381,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS); } @@ -30848,7 +30921,7 @@ index 6ce32a7..0562295 100644 } } -@@ -2222,10 +2395,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2222,10 +2393,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) u32 intmask; int cardint = 0; @@ -30861,7 +30934,7 @@ index 6ce32a7..0562295 100644 pr_warning("%s: got irq while runtime suspended\n", mmc_hostname(host->mmc)); return IRQ_HANDLED; -@@ -2266,6 +2439,22 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2266,6 +2437,22 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) tasklet_schedule(&host->card_tasklet); } @@ -30884,7 +30957,7 @@ index 6ce32a7..0562295 100644 if (intmask & SDHCI_INT_CMD_MASK) { sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, SDHCI_INT_STATUS); -@@ -2280,7 +2469,13 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2280,7 +2467,13 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); @@ -30899,7 +30972,7 @@ index 6ce32a7..0562295 100644 if (intmask & SDHCI_INT_BUS_POWER) { pr_err("%s: Card is consuming too much power!\n", -@@ -2307,7 +2502,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2307,7 +2500,7 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) mmiowb(); out: @@ -30908,7 +30981,7 @@ index 6ce32a7..0562295 100644 /* * We have to delay this as it calls back into the driver. -@@ -2363,7 +2558,8 @@ int sdhci_resume_host(struct sdhci_host *host) +@@ -2363,7 +2556,8 @@ int sdhci_resume_host(struct sdhci_host *host) return ret; } @@ -30918,7 +30991,7 @@ index 6ce32a7..0562295 100644 if (host->ops->enable_dma) host->ops->enable_dma(host); } -@@ -2426,15 +2622,15 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) +@@ -2426,15 +2620,15 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) host->flags &= ~SDHCI_NEEDS_RETUNING; } @@ -30938,7 +31011,7 @@ index 6ce32a7..0562295 100644 return ret; } -@@ -2466,7 +2662,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2466,7 +2660,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) (host->tuning_mode == SDHCI_TUNING_MODE_1)) host->flags |= SDHCI_NEEDS_RETUNING; @@ -30947,7 +31020,7 @@ index 6ce32a7..0562295 100644 host->runtime_suspended = false; -@@ -2477,7 +2673,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2477,7 +2671,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) /* Enable Card Detection */ sdhci_enable_card_detection(host); @@ -30956,7 +31029,7 @@ index 6ce32a7..0562295 100644 return ret; } -@@ -2570,14 +2766,16 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2570,14 +2764,16 @@ int sdhci_add_host(struct sdhci_host *host) host->flags &= ~SDHCI_USE_ADMA; } @@ -30975,7 +31048,7 @@ index 6ce32a7..0562295 100644 } } } -@@ -2688,7 +2886,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2688,7 +2884,7 @@ int sdhci_add_host(struct sdhci_host *host) /* Auto-CMD23 stuff only works in ADMA or PIO. */ if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || @@ -30984,7 +31057,7 @@ index 6ce32a7..0562295 100644 host->flags |= SDHCI_AUTO_CMD23; DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); } else { -@@ -2821,6 +3019,12 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2821,6 +3017,12 @@ int sdhci_add_host(struct sdhci_host *host) mmc->caps |= MMC_CAP_MAX_CURRENT_200; } @@ -30997,7 +31070,7 @@ index 6ce32a7..0562295 100644 mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio) -@@ -2915,7 +3119,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2915,7 +3117,7 @@ int sdhci_add_host(struct sdhci_host *host) host->tuning_timer.function = sdhci_tuning_timer; } @@ -31006,7 +31079,7 @@ index 6ce32a7..0562295 100644 mmc_hostname(mmc), host); if (ret) goto untasklet; -@@ -2953,6 +3157,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2953,6 +3155,7 @@ int sdhci_add_host(struct sdhci_host *host) pr_info("%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -31014,7 +31087,7 @@ index 6ce32a7..0562295 100644 (host->flags & SDHCI_USE_ADMA) ? "ADMA" : (host->flags & SDHCI_USE_SDMA) ? "DMA" : "PIO"); -@@ -2979,7 +3184,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -2979,7 +3182,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) unsigned long flags; if (dead) { @@ -31023,7 +31096,7 @@ index 6ce32a7..0562295 100644 host->flags |= SDHCI_DEVICE_DEAD; -@@ -2991,7 +3196,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -2991,7 +3194,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) tasklet_schedule(&host->finish_tasklet); } @@ -32347,11 +32420,24 @@ index 31108a0..48081d1 100644 +obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c new file mode 100644 -index 0000000..c6420de +index 0000000..72454d4 --- /dev/null +++ b/drivers/thermal/bcm2835-thermal.c -@@ -0,0 +1,195 @@ -+//bcm2835-thermal.c +@@ -0,0 +1,208 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ +#include +#include +#include @@ -86615,10 +86701,10 @@ index 9b9d8ff..6e9e8e9 100644 obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o diff --git a/drivers/video/bcm2708_fb.c b/drivers/video/bcm2708_fb.c new file mode 100644 -index 0000000..5ca8aca +index 0000000..efdee9d --- /dev/null +++ b/drivers/video/bcm2708_fb.c -@@ -0,0 +1,487 @@ +@@ -0,0 +1,491 @@ +/* + * linux/drivers/video/bcm2708_fb.c + * @@ -86657,6 +86743,12 @@ index 0000000..5ca8aca +#include +#include + ++#ifdef BCM2708_FB_DEBUG ++#define print_debug(fmt,...) pr_debug("%s:%s:%d: "fmt, MODULE_NAME, __func__, __LINE__, ##__VA_ARGS__) ++#else ++#define print_debug(fmt,...) ++#endif ++ +/* This is limited to 16 characters when displayed by X startup */ +static const char *bcm2708_name = "BCM2708 FB"; + @@ -86756,17 +86848,15 @@ index 0000000..5ca8aca +{ + /* info input, var output */ + int yres; -+ /* memory size in pixels */ -+ unsigned pixels = info->screen_size * 8 / var->bits_per_pixel; + + /* info input, var output */ -+ pr_info("bcm2708_fb_check_var info(%p) %dx%d (%dx%d), %d, %d\n", info, ++ print_debug("bcm2708_fb_check_var info(%p) %dx%d (%dx%d), %d, %d\n", info, + info->var.xres, info->var.yres, info->var.xres_virtual, + info->var.yres_virtual, (int)info->screen_size, + info->var.bits_per_pixel); -+ pr_info("bcm2708_fb_check_var var(%p) %dx%d (%dx%d), %d, %d\n", var, ++ print_debug("bcm2708_fb_check_var var(%p) %dx%d (%dx%d), %d\n", var, + var->xres, var->yres, var->xres_virtual, var->yres_virtual, -+ var->bits_per_pixel, pixels); ++ var->bits_per_pixel); + + if (!var->bits_per_pixel) + var->bits_per_pixel = 16; @@ -86832,7 +86922,7 @@ index 0000000..5ca8aca + fbinfo->base = 0; /* filled in by VC */ + fbinfo->pitch = 0; /* filled in by VC */ + -+ pr_info("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info, ++ print_debug("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info, + info->var.xres, info->var.yres, info->var.xres_virtual, + info->var.yres_virtual, (int)info->screen_size, + info->var.bits_per_pixel); @@ -86872,7 +86962,7 @@ index 0000000..5ca8aca + BUG(); /* what can we do here */ + } + } -+ pr_info ++ print_debug + ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d success=%d\n", + (void *)fb->fb.screen_base, (void *)fb->fb.fix.smem_start, + fbinfo->xres, fbinfo->yres, fbinfo->bpp, @@ -86895,7 +86985,7 @@ index 0000000..5ca8aca +{ + struct bcm2708_fb *fb = to_bcm2708(info); + -+ /*pr_info("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/ ++ /*print_debug("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/ + if (fb->fb.var.bits_per_pixel <= 8) { + if (regno < 256) { + /* blue [0:4], green [5:10], red [11:15] */ @@ -86918,28 +87008,28 @@ index 0000000..5ca8aca + +static int bcm2708_fb_blank(int blank_mode, struct fb_info *info) +{ -+ /*pr_info("bcm2708_fb_blank\n"); */ ++ /*print_debug("bcm2708_fb_blank\n"); */ + return -1; +} + +static void bcm2708_fb_fillrect(struct fb_info *info, + const struct fb_fillrect *rect) +{ -+ /* (is called) pr_info("bcm2708_fb_fillrect\n"); */ ++ /* (is called) print_debug("bcm2708_fb_fillrect\n"); */ + cfb_fillrect(info, rect); +} + +static void bcm2708_fb_copyarea(struct fb_info *info, + const struct fb_copyarea *region) +{ -+ /*pr_info("bcm2708_fb_copyarea\n"); */ ++ /*print_debug("bcm2708_fb_copyarea\n"); */ + cfb_copyarea(info, region); +} + +static void bcm2708_fb_imageblit(struct fb_info *info, + const struct fb_image *image) +{ -+ /* (is called) pr_info("bcm2708_fb_imageblit\n"); */ ++ /* (is called) print_debug("bcm2708_fb_imageblit\n"); */ + cfb_imageblit(info, image); +} + @@ -87014,15 +87104,15 @@ index 0000000..5ca8aca + + fb_set_var(&fb->fb, &fb->fb.var); + -+ pr_info("BCM2708FB: registering framebuffer (%dx%d@%d)\n", fbwidth, ++ print_debug("BCM2708FB: registering framebuffer (%dx%d@%d)\n", fbwidth, + fbheight, fbdepth); + + ret = register_framebuffer(&fb->fb); -+ pr_info("BCM2708FB: register framebuffer (%d)\n", ret); ++ print_debug("BCM2708FB: register framebuffer (%d)\n", ret); + if (ret == 0) + goto out; + -+ pr_info("BCM2708FB: cannot register framebuffer (%d)\n", ret); ++ print_debug("BCM2708FB: cannot register framebuffer (%d)\n", ret); +out: + return ret; +} @@ -90336,7 +90426,7 @@ index 0000000..0c1b80a +} diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c new file mode 100755 -index 0000000..bc146a2 +index 0000000..2f63ac6 --- /dev/null +++ b/sound/arm/bcm2835-pcm.c @@ -0,0 +1,408 @@ @@ -90440,7 +90530,7 @@ index 0000000..bc146a2 + + audio_info(" .. IN (%d)\n", substream->number); + -+ audio_warning("Alsa open (%d)\n", substream->number); ++ audio_info("Alsa open (%d)\n", substream->number); + idx = substream->number; + + if (idx > MAX_SUBSTREAMS) { @@ -90509,7 +90599,7 @@ index 0000000..bc146a2 + bcm2835_alsa_stream_t *alsa_stream = runtime->private_data; + + audio_info(" .. IN\n"); -+ audio_warning("Alsa close\n"); ++ audio_info("Alsa close\n"); + + /* + * Call stop if it's still running. This happens when app @@ -90750,10 +90840,10 @@ index 0000000..bc146a2 +} diff --git a/sound/arm/bcm2835-vchiq.c b/sound/arm/bcm2835-vchiq.c new file mode 100755 -index 0000000..68d838d +index 0000000..3b7ed1e --- /dev/null +++ b/sound/arm/bcm2835-vchiq.c -@@ -0,0 +1,834 @@ +@@ -0,0 +1,825 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. +* @@ -90788,17 +90878,10 @@ index 0000000..68d838d +/* ---- Include Files -------------------------------------------------------- */ + +#include "interface/vchi/vchi.h" -+#include "interface/vcos/vcos.h" -+#include "interface/vcos/vcos_logging.h" +#include "vc_vchi_audioserv_defs.h" + +/* ---- Private Constants and Types ------------------------------------------ */ + -+/* VCOS logging category for this service */ -+#define VCOS_LOG_CATEGORY (&audio_log_category) -+ -+/* Default VCOS logging level */ -+#define LOG_LEVEL VCOS_LOG_WARN +/* Logging macros (for remapping to other logging mechanisms, i.e., printf) */ +#ifdef AUDIO_DEBUG_ENABLE + #define LOG_ERR( fmt, arg... ) pr_err( "%s:%d " fmt, __func__, __LINE__, ##arg) @@ -90806,26 +90889,23 @@ index 0000000..68d838d + #define LOG_INFO( fmt, arg... ) pr_info( "%s:%d " fmt, __func__, __LINE__, ##arg) + #define LOG_DBG( fmt, arg... ) pr_info( "%s:%d " fmt, __func__, __LINE__, ##arg) +#else -+ #define LOG_ERR( fmt, arg... ) vcos_log_error( "%s:%d " fmt, __func__, __LINE__, ##arg) -+ #define LOG_WARN( fmt, arg... ) vcos_log_warn( "%s:%d " fmt, __func__, __LINE__, ##arg) -+ #define LOG_INFO( fmt, arg... ) vcos_log_info( "%s:%d " fmt, __func__, __LINE__, ##arg) -+ #define LOG_DBG( fmt, arg... ) vcos_log_info( "%s:%d " fmt, __func__, __LINE__, ##arg) ++ #define LOG_ERR( fmt, arg... ) ++ #define LOG_WARN( fmt, arg... ) ++ #define LOG_INFO( fmt, arg... ) ++ #define LOG_DBG( fmt, arg... ) +#endif + +typedef struct opaque_AUDIO_INSTANCE_T { + uint32_t num_connections; + VCHI_SERVICE_HANDLE_T vchi_handle[VCHI_MAX_NUM_CONNECTIONS]; -+ VCOS_EVENT_T msg_avail_event; -+ VCOS_MUTEX_T vchi_mutex; ++ struct semaphore msg_avail_event; ++ struct mutex vchi_mutex; + bcm2835_alsa_stream_t *alsa_stream; + int32_t result, got_result; +} AUDIO_INSTANCE_T; + +/* ---- Private Variables ---------------------------------------------------- */ + -+/* VCOS logging category for this service */ -+static VCOS_LOG_CAT_T audio_log_category; -+ +/* ---- Private Function Prototypes ------------------------------------------ */ + +/* ---- Private Functions ---------------------------------------------------- */ @@ -90942,7 +91022,7 @@ index 0000000..68d838d + BUG_ON(instance->got_result); + instance->result = m.u.result.success; + instance->got_result = 1; -+ vcos_event_signal(&instance->msg_avail_event); ++ up(&instance->msg_avail_event); + } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { + irq_handler_t callback = (irq_handler_t) m.u.complete.callback; + LOG_DBG @@ -90955,7 +91035,7 @@ index 0000000..68d838d + LOG_DBG(" .. unexpected alsa_stream=%p, callback=%p\n", + alsa_stream, callback); + } -+ vcos_event_signal(&instance->msg_avail_event); ++ up(&instance->msg_avail_event); + } else { + LOG_DBG(" .. unexpected m.type=%d\n", m.type); + } @@ -90968,7 +91048,7 @@ index 0000000..68d838d +{ + uint32_t i; + AUDIO_INSTANCE_T *instance; -+ VCOS_STATUS_T status; ++ int status; + + LOG_DBG("%s: start", __func__); + @@ -90979,27 +91059,16 @@ index 0000000..68d838d + return NULL; + } + /* Allocate memory for this instance */ -+ instance = vcos_malloc(sizeof(*instance), "audio_instance"); ++ instance = kmalloc(sizeof(*instance), GFP_KERNEL); ++ + memset(instance, 0, sizeof(*instance)); + + instance->num_connections = num_connections; + /* Create the message available event */ -+ status = -+ vcos_event_create(&instance->msg_avail_event, "audio_msg_avail"); -+ if (status != VCOS_SUCCESS) { -+ LOG_ERR("%s: failed to create event (status=%d)", __func__, -+ status); ++ sema_init(&instance->msg_avail_event,1); + -+ goto err_free_mem; -+ } + /* Create a lock for exclusive, serialized VCHI connection access */ -+ status = vcos_mutex_create(&instance->vchi_mutex, "audio_vchi_mutex"); -+ if (status != VCOS_SUCCESS) { -+ LOG_ERR("%s: failed to create event (status=%d)", __func__, -+ status); -+ -+ goto err_delete_event; -+ } ++ mutex_init(&instance->vchi_mutex); + /* Open the VCHI service connections */ + for (i = 0; i < num_connections; i++) { + SERVICE_CREATION_T params = { @@ -91009,14 +91078,14 @@ index 0000000..68d838d + 0, // tx fifo size (unused) + audio_vchi_callback, // service callback + instance, // service callback parameter -+ VCOS_TRUE, //TODO: remove VCOS_FALSE, // unaligned bulk recieves -+ VCOS_TRUE, //TODO: remove VCOS_FALSE, // unaligned bulk transmits -+ VCOS_FALSE // want crc check on bulk transfers ++ 1, //TODO: remove VCOS_FALSE, // unaligned bulk recieves ++ 1, //TODO: remove VCOS_FALSE, // unaligned bulk transmits ++ 0 // want crc check on bulk transfers + }; + + status = vchi_service_open(vchi_instance, ¶ms, + &instance->vchi_handle[i]); -+ if (status != VCOS_SUCCESS) { ++ if (status) { + LOG_ERR + ("%s: failed to open VCHI service connection (status=%d)", + __func__, status); @@ -91034,13 +91103,7 @@ index 0000000..68d838d + vchi_service_close(instance->vchi_handle[i]); + } + -+ vcos_mutex_delete(&instance->vchi_mutex); -+ -+err_delete_event: -+ vcos_event_delete(&instance->msg_avail_event); -+ -+err_free_mem: -+ vcos_free(instance); ++ kfree(instance); + + return NULL; +} @@ -91058,7 +91121,11 @@ index 0000000..68d838d + } + + LOG_DBG(" .. about to lock (%d)\n", instance->num_connections); -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + + /* Close all VCHI service connections */ + for (i = 0; i < instance->num_connections; i++) { @@ -91074,16 +91141,9 @@ index 0000000..68d838d + } + } + -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + -+ vcos_mutex_delete(&instance->vchi_mutex); -+ -+ vcos_event_delete(&instance->msg_avail_event); -+ -+ vcos_free(instance); -+ -+ /* Unregister the log category so we can add it back next time */ -+ vcos_log_unregister(&audio_log_category); ++ kfree(instance); + + LOG_DBG(" .. OUT\n"); + @@ -91127,10 +91187,6 @@ index 0000000..68d838d + goto err_free_mem; + } + -+ /* Set up the VCOS logging */ -+ vcos_log_set_level(VCOS_LOG_CATEGORY, LOG_LEVEL); -+ vcos_log_register("audio", VCOS_LOG_CATEGORY); -+ + /* Initialize an instance of the audio service */ + instance = vc_vchi_audio_init(vchi_instance, &vchi_connection, 1); + @@ -91168,7 +91224,11 @@ index 0000000..68d838d + } + instance = alsa_stream->instance; + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + m.type = VC_AUDIO_MSG_TYPE_OPEN; @@ -91190,7 +91250,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); +exit: + LOG_DBG(" .. OUT\n"); + return ret; @@ -91208,7 +91268,11 @@ index 0000000..68d838d + LOG_INFO + (" Setting ALSA dest(%d), volume(%d)\n", chip->dest, chip->volume); + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + instance->got_result = 0; @@ -91233,8 +91297,7 @@ index 0000000..68d838d + + /* We are expecting a reply from the videocore */ + while (!instance->got_result) { -+ success = vcos_event_wait(&instance->msg_avail_event); -+ if (success != VCOS_SUCCESS) { ++ if (down_interruptible(&instance->msg_avail_event)) { + LOG_ERR("%s: failed on waiting for event (status=%d)", + __func__, success); + @@ -91254,7 +91317,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + + LOG_DBG(" .. OUT\n"); + return ret; @@ -91308,7 +91371,11 @@ index 0000000..68d838d + return -EINVAL; + } + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + instance->got_result = 0; @@ -91334,8 +91401,7 @@ index 0000000..68d838d + + /* We are expecting a reply from the videocore */ + while (!instance->got_result) { -+ success = vcos_event_wait(&instance->msg_avail_event); -+ if (success != VCOS_SUCCESS) { ++ if (down_interruptible(&instance->msg_avail_event)) { + LOG_ERR("%s: failed on waiting for event (status=%d)", + __func__, success); + @@ -91355,7 +91421,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + + LOG_DBG(" .. OUT\n"); + return ret; @@ -91378,7 +91444,11 @@ index 0000000..68d838d + int ret; + LOG_DBG(" .. IN\n"); + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + m.type = VC_AUDIO_MSG_TYPE_START; @@ -91400,7 +91470,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + LOG_DBG(" .. OUT\n"); + return ret; +} @@ -91413,7 +91483,11 @@ index 0000000..68d838d + int ret; + LOG_DBG(" .. IN\n"); + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + m.type = VC_AUDIO_MSG_TYPE_STOP; @@ -91436,7 +91510,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + LOG_DBG(" .. OUT\n"); + return ret; +} @@ -91451,7 +91525,11 @@ index 0000000..68d838d + + my_workqueue_quit(alsa_stream); + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + m.type = VC_AUDIO_MSG_TYPE_CLOSE; @@ -91468,8 +91546,7 @@ index 0000000..68d838d + goto unlock; + } + while (!instance->got_result) { -+ success = vcos_event_wait(&instance->msg_avail_event); -+ if (success != VCOS_SUCCESS) { ++ if (down_interruptible(&instance->msg_avail_event)) { + LOG_ERR("%s: failed on waiting for event (status=%d)", + __func__, success); + @@ -91489,7 +91566,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + + /* Stop the audio service */ + if (instance) { @@ -91512,7 +91589,11 @@ index 0000000..68d838d + + LOG_INFO(" Writing %d bytes from %p\n", count, src); + -+ vcos_mutex_lock(&instance->vchi_mutex); ++ if(mutex_lock_interruptible(&instance->vchi_mutex)) ++ { ++ LOG_DBG("Interrupted whilst waiting for lock on (%d)\n",instance->num_connections); ++ return -EINTR; ++ } + vchi_service_use(instance->vchi_handle[0]); + + m.type = VC_AUDIO_MSG_TYPE_WRITE; @@ -91557,7 +91638,7 @@ index 0000000..68d838d + +unlock: + vchi_service_release(instance->vchi_handle[0]); -+ vcos_mutex_unlock(&instance->vchi_mutex); ++ mutex_unlock(&instance->vchi_mutex); + LOG_DBG(" .. OUT\n"); + return ret; +} @@ -91590,10 +91671,10 @@ index 0000000..68d838d +} diff --git a/sound/arm/bcm2835.c b/sound/arm/bcm2835.c new file mode 100755 -index 0000000..44bedb5 +index 0000000..9546fe6 --- /dev/null +++ b/sound/arm/bcm2835.c -@@ -0,0 +1,418 @@ +@@ -0,0 +1,413 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. +* @@ -91683,8 +91764,6 @@ index 0000000..44bedb5 + bcm2835_chip_t *chip; + struct snd_card *card; + int err; -+ printk(KERN_INFO "Probing FOR bcm2835 ALSA device (%d):(%d)\n", -+ dev, enable[dev]); + + if (dev >= MAX_SUBSTREAMS) + return -ENODEV; @@ -91697,7 +91776,6 @@ index 0000000..44bedb5 + if (dev > 0) + goto add_register_map; + -+ printk("Creating card...\n"); + err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card); + if (err < 0) + goto out; @@ -91970,8 +92048,6 @@ index 0000000..44bedb5 + printk("Error registering bcm2835_alsa7_driver %d .\n", err); + goto unregister_6; + } -+ printk(KERN_INFO "BCM2835 ALSA driver init %s\n", -+ err ? "FAILED" : "OK"); + + return 0; +