Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merged Asus changes from kernel release v9.4.2.21

-Power management - suspend LP0 change
-BCMDHD wifi driver changes
-Real time clock driver TI TPS6591x changes
-video/tegra/dc HDMI changes
-fs/proc/base.c changes
-peripheral clock parm changes
-sound/pci/hda changes - HDMI/ELD (EDID Like Data) changes
-sound/soc - RT5631 ALSA Soc Audio driver retry write changes
  • Loading branch information...
commit 5c2825580d31b1750ae833869e3d890fcb1093f9 1 parent f38bf43
@motley-git authored
View
2  arch/arm/configs/tegra3_android_defconfig
@@ -218,6 +218,7 @@ CONFIG_BLK_DEV_DM=y
CONFIG_DM_CRYPT=y
CONFIG_DM_UEVENT=y
CONFIG_NETDEVICES=y
+CONFIG_TUN=y
CONFIG_DUMMY=y
# CONFIG_NETDEV_10000 is not set
CONFIG_BCM4329=m
@@ -363,6 +364,7 @@ CONFIG_DSP_FM34=y
CONFIG_HEADSET_FUNCTION=y
CONFIG_SND_SOC_TEGRA_TLV320AIC326X=y
CONFIG_HID_SONY=y
+CONFIG_HID_APPLE=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
CONFIG_USB_DEVICEFS=y
CONFIG_USB_SUSPEND=y
View
1  arch/arm/mach-tegra/pm.c
@@ -707,6 +707,7 @@ static void tegra_pm_set(enum tegra_suspend_mode mode)
switch (mode) {
case TEGRA_SUSPEND_LP0:
+ rate = clk_get_rate_all_locked(tegra_pclk);
if (pdata->combined_req) {
reg |= TEGRA_POWER_PWRREQ_OE;
reg &= ~TEGRA_POWER_CPU_PWRREQ_OE;
View
20 arch/arm/mach-tegra/sleep-t3.S
@@ -513,8 +513,19 @@ tegra3_tear_down_core:
* r7 = TEGRA_TMRUS_BASE
*/
tegra3_cpu_clk32k:
+ ldr r0, [r4, #PMC_CTRL]
+ tst r0, #PMC_CTRL_SIDE_EFFECT_LP0
+ beq lp1_clocks_prepare
+
+ /* enable PLLM via PMC in LP0 */
+ ldr r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
+ orr r0, r0, #((1<<12) | (1 << 11))
+ str r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
+ mov pc, lr
+
/* start by jumping to clkm to safely disable PLLs, then jump
* to clks */
+lp1_clocks_prepare:
mov r0, #(1 << 28)
str r0, [r5, #CLK_RESET_SCLK_BURST]
str r0, [r5, #CLK_RESET_CCLK_BURST]
@@ -539,20 +550,11 @@ tegra3_cpu_clk32k:
#endif
/* disable PLLM via PMC in LP1 */
- ldr r0, [r4, #PMC_CTRL]
- tst r0, #PMC_CTRL_SIDE_EFFECT_LP0
- bne enable_pllm_lp0
ldr r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
bic r0, r0, #(1<<12)
str r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
b powerdown_pll_pcx
-enable_pllm_lp0:
- /* enable PLLM via PMC in LP0 */
- ldr r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
- orr r0, r0, #((1<<12) | (1 << 11))
- str r0, [r4, #PMC_PLLP_WB0_OVERRIDE]
-
powerdown_pll_pcx:
/* disable PLLP, PLLA, PLLC, and PLLX in LP0 and LP1 states */
ldr r0, [r4, #PMC_CTRL]
View
22 arch/arm/mach-tegra/tegra3_clocks.c
@@ -3321,6 +3321,14 @@ static struct clk tegra_pll_u = {
};
static struct clk_pll_freq_table tegra_pll_x_freq_table[] = {
+
+ /* 1.8 GHz */
+ { 12000000, 1800000000, 850, 6, 1, 8},
+ { 13000000, 1800000000, 915, 7, 1, 8}, /* actual: 1799.2 MHz */
+ { 16800000, 1800000000, 708, 7, 1, 8}, /* actual: 1799.2 MHz */
+ { 19200000, 1800000000, 885, 10, 1, 8}, /* actual: 1799.2 MHz */
+ { 26000000, 1800000000, 850, 13, 1, 8},
+
/* 1.7 GHz */
{ 12000000, 1700000000, 850, 6, 1, 8},
{ 13000000, 1700000000, 915, 7, 1, 8}, /* actual: 1699.2 MHz */
@@ -3386,14 +3394,14 @@ static struct clk tegra_pll_x = {
.ops = &tegra_pll_ops,
.reg = 0xe0,
.parent = &tegra_pll_ref,
- .max_rate = 1700000000,
+ .max_rate = 1800000000,
.u.pll = {
.input_min = 2000000,
.input_max = 31000000,
.cf_min = 1000000,
.cf_max = 6000000,
.vco_min = 20000000,
- .vco_max = 1700000000,
+ .vco_max = 1800000000,
.freq_table = tegra_pll_x_freq_table,
.lock_delay = 300,
},
@@ -4014,9 +4022,9 @@ struct clk tegra_list_clks[] = {
PERIPH_CLK("dam0", "tegra30-dam.0", NULL, 108, 0x3d8, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
PERIPH_CLK("dam1", "tegra30-dam.1", NULL, 109, 0x3dc, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
PERIPH_CLK("dam2", "tegra30-dam.2", NULL, 110, 0x3e0, 48000000, mux_plla_pllc_pllp_clkm, MUX | DIV_U71),
- PERIPH_CLK("hda", "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
- PERIPH_CLK("hda2codec_2x", "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71),
- PERIPH_CLK("hda2hdmi", "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, 0),
+ PERIPH_CLK("hda", "tegra30-hda", "hda", 125, 0x428, 108000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
+ PERIPH_CLK("hda2codec_2x", "tegra30-hda", "hda2codec", 111, 0x3e4, 48000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
+ PERIPH_CLK("hda2hdmi", "tegra30-hda", "hda2hdmi", 128, 0, 48000000, mux_clk_m, PERIPH_ON_APB),
PERIPH_CLK("sbc1", "spi_tegra.0", NULL, 41, 0x134, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
PERIPH_CLK("sbc2", "spi_tegra.1", NULL, 44, 0x118, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
PERIPH_CLK("sbc3", "spi_tegra.2", NULL, 46, 0x11c, 160000000, mux_pllp_pllc_pllm_clkm, MUX | DIV_U71 | PERIPH_ON_APB),
@@ -4342,7 +4350,7 @@ static struct cpufreq_frequency_table freq_table_1p6GHz[] = {
{ 1, 204000 },
{ 2, 370000 },
{ 3, 475000 },
- { 4, 640000 },
+ { 4, 620000 },
{ 5, 760000 },
{ 6, 880000 },
{ 7, 1000000 },
@@ -4360,7 +4368,7 @@ static struct cpufreq_frequency_table freq_table_1p8GHz[] = {
{ 2, 370000 },
{ 3, 475000 },
{ 4, 620000 },
- { 5, 880000 },
+ { 5, 800000 },
{ 6, 1000000 },
{ 7, 1300000 },
{ 8, 1400000 },
View
2  drivers/net/wireless/bcmdhd/Makefile
@@ -29,7 +29,7 @@ DHDOFILES = aiutils.o bcmsdh_sdmmc_linux.o dhd_linux.o siutils.o bcmutils.o \
obj-$(CONFIG_BCMDHD) += bcmdhd.o
bcmdhd-objs += $(DHDOFILES)
-ifneq ($(CONFIG_WIRELESS_EXT),)
+ifneq ($(CONFIG_BCMDHD_WEXT),)
bcmdhd-objs += wl_iw.o
DHDCFLAGS += -DSOFTAP
endif
View
40 drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -148,10 +148,10 @@ print_tainted()
#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 15) */
/* Linux wireless extension support */
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
#include <wl_iw.h>
extern wl_iw_extra_params_t g_wl_iw_params;
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
#if defined(CONFIG_HAS_EARLYSUSPEND)
#include <linux/earlysuspend.h>
@@ -211,9 +211,9 @@ static uint32 maxdelay = 0, tspktcnt = 0, maxdelaypktno = 0;
/* Local private structure (extension of pub) */
typedef struct dhd_info {
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
wl_iw_t iw; /* wireless extensions state (must be first) */
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
dhd_pub_t pub;
@@ -454,9 +454,9 @@ int dhd_monitor_init(void *dhd_pub);
int dhd_monitor_uninit(void);
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
static void dhd_dpc(ulong data);
/* forward decl */
@@ -2033,7 +2033,7 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
return -1;
}
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
/* linux wireless extensions */
if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
/* may recurse, do NOT lock */
@@ -2041,7 +2041,7 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return ret;
}
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 2)
if (cmd == SIOCETHTOOL) {
@@ -2594,7 +2594,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
dhd_monitor_init(&dhd->pub);
dhd_state |= DHD_ATTACH_STATE_CFG80211;
#endif
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
/* Attach and link in the iw */
if (!(dhd_state & DHD_ATTACH_STATE_CFG80211)) {
if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
@@ -2603,7 +2603,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
}
dhd_state |= DHD_ATTACH_STATE_WL_ATTACH;
}
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
/* Set up the watchdog timer */
@@ -3357,14 +3357,14 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
net->ethtool_ops = &dhd_ethtool_ops;
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
#if WIRELESS_EXT < 19
net->get_wireless_stats = dhd_get_wireless_stats;
#endif /* WIRELESS_EXT < 19 */
#if WIRELESS_EXT > 12
net->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
#endif /* WIRELESS_EXT > 12 */
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);
@@ -3380,7 +3380,7 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
net->dev_addr[0], net->dev_addr[1], net->dev_addr[2],
net->dev_addr[3], net->dev_addr[4], net->dev_addr[5]);
-#if defined(SOFTAP) && defined(CONFIG_WIRELESS_EXT) && !defined(WL_CFG80211)
+#if defined(SOFTAP) && defined(CONFIG_BCMDHD_WEXT) && !defined(WL_CFG80211)
wl_iw_iscan_set_scan_broadcast_prep(net, 1);
#endif
@@ -3465,12 +3465,12 @@ void dhd_detach(dhd_pub_t *dhdp)
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) {
/* Detatch and unlink in the iw */
wl_iw_detach();
}
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
if (&dhd->thr_sysioc_ctl.thr_pid >= 0) {
PROC_STOP(&dhd->thr_sysioc_ctl);
@@ -3918,7 +3918,7 @@ void dhd_os_prefree(void *osh, void *addr, uint size)
}
#endif /* defined(CONFIG_WIFI_CONTROL_FUNC) */
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
struct iw_statistics *
dhd_get_wireless_stats(struct net_device *dev)
{
@@ -3936,7 +3936,7 @@ dhd_get_wireless_stats(struct net_device *dev)
else
return NULL;
}
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
@@ -3949,7 +3949,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
if (bcmerror != BCME_OK)
return (bcmerror);
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
if (event->bsscfgidx == 0) {
/*
* Wireless ext is on primary interface only
@@ -3962,7 +3962,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
}
}
-#endif /* defined(CONFIG_WIRELESS_EXT) */
+#endif /* defined(CONFIG_BCMDHD_WEXT) */
#ifdef WL_CFG80211
@@ -4269,7 +4269,7 @@ int net_os_send_hang_message(struct net_device *dev)
if (dhd) {
if (!dhd->pub.hang_was_sent) {
dhd->pub.hang_was_sent = 1;
-#if defined(CONFIG_WIRELESS_EXT)
+#if defined(CONFIG_BCMDHD_WEXT)
ret = wl_iw_send_priv_event(dev, "HANG");
#endif
#if defined(WL_CFG80211)
View
3  drivers/net/wireless/bcmdhd/dhd_sdio.c
@@ -6057,7 +6057,6 @@ _dhdsdio_download_firmware(struct dhd_bus *bus)
bool embed = FALSE; /* download embedded firmware */
bool dlok = FALSE; /* download firmware succeeded */
- printf("%s: fw_path = %s, nv_path=%s\n", __FUNCTION__, bus->fw_path, bus->nv_path);
/* Out immediately if no image to download */
if ((bus->fw_path == NULL) || (bus->fw_path[0] == '\0')) {
#ifdef BCMEMBEDIMAGE
@@ -6092,6 +6091,8 @@ _dhdsdio_download_firmware(struct dhd_bus *bus)
strcpy(bus->fw_path, "/system/vendor/firmware/bcm4330/fw_bcmdhd_b1.bin");
}
+ printf("%s: fw_path = %s, nv_path=%s\n", __FUNCTION__, bus->fw_path, bus->nv_path);
+
if (dhdsdio_download_code_file(bus, bus->fw_path)) {
DHD_ERROR(("%s: dongle image file download failed\n", __FUNCTION__));
#ifdef BCMEMBEDIMAGE
View
14 drivers/net/wireless/bcmdhd/wl_android.c
@@ -612,19 +612,9 @@ int wl_android_post_init(void)
char buf[IFNAMSIZ];
if (!dhd_download_fw_on_driverload) {
/* Call customer gpio to turn off power with WL_REG_ON signal */
- //dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
+ sdioh_stop(NULL);
+ dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
g_wifi_on = 0;
-
- memset(buf, 0, IFNAMSIZ);
-#ifdef CUSTOMER_HW2
- snprintf(buf, IFNAMSIZ, "%s%d", iface_name, 0);
-#else
- snprintf(buf, IFNAMSIZ, "%s%d", "eth", 0);
-#endif
- if ((ndev = dev_get_by_name (&init_net, buf)) != NULL) {
- wl_android_wifi_on(ndev);
- wl_android_wifi_off(ndev);
- }
} else {
memset(buf, 0, IFNAMSIZ);
#ifdef CUSTOMER_HW2
View
2  drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -2549,7 +2549,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
return -EINVAL;
}
swap_key_from_BE(&key);
-#ifdef CONFIG_WIRELESS_EXT
+#ifdef CONFIG_BCMDHD_WEXT
dhd_wait_pend8021x(dev);
#endif
wldev_iovar_setbuf_bsscfg(dev, "wsec_key", &key, sizeof(key), ioctlbuf,
View
2  drivers/net/wireless/bcmdhd/wl_iw.c
@@ -162,7 +162,7 @@ uint wl_msg_level = WL_ERROR_VAL;
#define htodchanspec(i) i
#define dtohchanspec(i) i
-#ifdef CONFIG_WIRELESS_EXT
+#ifdef CONFIG_BCMDHD_WEXT
extern struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
extern int dhd_wait_pend8021x(struct net_device *dev);
View
20 drivers/rtc/rtc-tps6591x.c 100644 → 100755
@@ -111,8 +111,16 @@ static int tps6591x_rtc_valid_tm(struct rtc_time *tm)
|| tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + OS_REF_YEAR)
|| tm->tm_hour >= 24
|| tm->tm_min >= 60
- || tm->tm_sec >= 60)
+ || tm->tm_sec >= 60){
+ printk("tps6591x_rtc_valid_tm: rtc time not valid %u %u %u %u %u %u\n",tm->tm_year >= (RTC_YEAR_OFFSET + 99),
+ tm->tm_mon >= 12,
+ tm->tm_mday < 1,
+ tm->tm_mday > rtc_month_days(tm->tm_mon, tm->tm_year + OS_REF_YEAR),
+ tm->tm_hour >= 24,
+ tm->tm_min >= 60,
+ tm->tm_sec >= 60);
return -EINVAL;
+ }
return 0;
}
@@ -164,6 +172,10 @@ static int tps6591x_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_mon = buff[4];
tm->tm_year = buff[5];
tm->tm_wday = buff[6];
+ if(tm->tm_mon >= 1)
+ tm->tm_mon -=1;
+ else
+ printk("[Error]tps6591x_rtc_read_time tm->tm_mon=%x! This value should be above 0. \n", tm->tm_mon );
print_time(dev, tm);
return tps6591x_rtc_valid_tm(tm);
}
@@ -252,7 +264,7 @@ static int tps6591x_rtc_set_time(struct device *dev, struct rtc_time *tm)
buff[4] = tm->tm_mon;
buff[5] = tm->tm_year;
buff[6] = tm->tm_wday;
-
+ buff[4] = tm->tm_mon+1;
print_time(dev, tm);
convert_decimal_to_bcd(buff, sizeof(buff));
err = tps6591x_rtc_stop(dev);
@@ -308,7 +320,7 @@ static int tps6591x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
buff[1] = alrm->time.tm_min;
buff[2] = alrm->time.tm_hour;
buff[3] = alrm->time.tm_mday;
- buff[4] = alrm->time.tm_mon;
+ buff[4] = alrm->time.tm_mon+1;
buff[5] = alrm->time.tm_year;
convert_decimal_to_bcd(buff, sizeof(buff));
err = tps6591x_write_regs(dev, RTC_ALARM, sizeof(buff), buff);
@@ -332,7 +344,7 @@ static int tps6591x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->time.tm_min = buff[1];
alrm->time.tm_hour = buff[2];
alrm->time.tm_mday = buff[3];
- alrm->time.tm_mon = buff[4];
+ alrm->time.tm_mon = buff[4]-1;
alrm->time.tm_year = buff[5];
dev_info(dev->parent, "\n getting alarm time::\n");
View
67 drivers/usb/class/cdc-acm.c
@@ -202,6 +202,9 @@ static int acm_write_start(struct acm *acm, int wbn)
unsigned long flags;
struct acm_wb *wb = &acm->wb[wbn];
int rc;
+#ifdef CONFIG_PM
+ struct urb *res;
+#endif
spin_lock_irqsave(&acm->write_lock, flags);
if (!acm->dev) {
@@ -214,23 +217,32 @@ static int acm_write_start(struct acm *acm, int wbn)
usb_autopm_get_interface_async(acm->control);
if (acm->susp_count) {
#ifdef CONFIG_PM
- printk("%s buffer urb\n", __func__);
acm->transmitting++;
wb->urb->transfer_buffer = wb->buf;
wb->urb->transfer_dma = wb->dmah;
wb->urb->transfer_buffer_length = wb->len;
wb->urb->dev = acm->dev;
usb_anchor_urb(wb->urb, &acm->deferred);
-#endif
+#else
if (!acm->delayed_wb)
acm->delayed_wb = wb;
else
usb_autopm_put_interface_async(acm->control);
+#endif
spin_unlock_irqrestore(&acm->write_lock, flags);
return 0; /* A white lie */
}
usb_mark_last_busy(acm->dev);
-
+#ifdef CONFIG_PM
+ while ((res = usb_get_from_anchor(&acm->deferred))) {
+ rc = usb_submit_urb(res, GFP_ATOMIC);
+ if (rc < 0) {
+ dbg("usb_submit_urb(pending request) failed: %d", rc);
+ usb_unanchor_urb(res);
+ acm_write_done(acm, res->context);
+ }
+ }
+#endif
rc = acm_start_wb(acm, wb);
spin_unlock_irqrestore(&acm->write_lock, flags);
@@ -674,7 +686,6 @@ static int acm_tty_chars_in_buffer(struct tty_struct *tty);
static void acm_port_down(struct acm *acm)
{
int i, nr = acm->rx_buflimit;
- mutex_lock(&open_mutex);
if (acm->dev) {
usb_autopm_get_interface(acm->control);
acm_set_control(acm, acm->ctrlout = 0);
@@ -688,14 +699,23 @@ static void acm_port_down(struct acm *acm)
acm->control->needs_remote_wakeup = 0;
usb_autopm_put_interface(acm->control);
}
- mutex_unlock(&open_mutex);
}
static void acm_tty_hangup(struct tty_struct *tty)
{
- struct acm *acm = tty->driver_data;
+ struct acm *acm;
+
+ mutex_lock(&open_mutex);
+ acm = tty->driver_data;
+
+ if (!acm)
+ goto out;
+
tty_port_hangup(&acm->port);
acm_port_down(acm);
+
+out:
+ mutex_unlock(&open_mutex);
}
static void acm_tty_close(struct tty_struct *tty, struct file *filp)
@@ -706,8 +726,8 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
shutdown */
if (!acm)
return;
+ mutex_lock(&open_mutex);
if (tty_port_close_start(&acm->port, tty, filp) == 0) {
- mutex_lock(&open_mutex);
if (!acm->dev) {
tty_port_tty_set(&acm->port, NULL);
acm_tty_unregister(acm);
@@ -719,6 +739,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
acm_port_down(acm);
tty_port_close_end(&acm->port, tty);
tty_port_tty_set(&acm->port, NULL);
+ mutex_unlock(&open_mutex);
}
static int acm_tty_write(struct tty_struct *tty,
@@ -1400,6 +1421,7 @@ static void acm_disconnect(struct usb_interface *intf)
stop_data_traffic(acm);
+ usb_kill_anchored_urbs(&acm->deferred);
acm_write_buffers_free(acm);
usb_free_coherent(usb_dev, acm->ctrlsize, acm->ctrl_buffer,
acm->ctrl_dma);
@@ -1465,10 +1487,13 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message)
static int acm_resume(struct usb_interface *intf)
{
struct acm *acm = usb_get_intfdata(intf);
- struct acm_wb *wb;
int rv = 0;
- struct urb *res;
int cnt;
+#ifdef CONFIG_PM
+ struct urb *res;
+#else
+ struct acm_wb *wb;
+#endif
spin_lock_irq(&acm->read_lock);
acm->susp_count -= 1;
@@ -1481,19 +1506,21 @@ static int acm_resume(struct usb_interface *intf)
mutex_lock(&acm->mutex);
-#ifdef CONFIG_PM
- while ((res = usb_get_from_anchor(&acm->deferred))) {
- printk("%s process buffered request \n", __func__);
- rv = usb_submit_urb(res, GFP_ATOMIC);
- if (rv < 0) {
- dbg("usb_submit_urb(pending request) failed: %d", rv);
- }
- }
-#endif
-
if (acm->port.count) {
rv = usb_submit_urb(acm->ctrlurb, GFP_NOIO);
spin_lock_irq(&acm->write_lock);
+#ifdef CONFIG_PM
+ while ((res = usb_get_from_anchor(&acm->deferred))) {
+ rv = usb_submit_urb(res, GFP_ATOMIC);
+ if (rv < 0) {
+ dbg("usb_submit_urb(pending request)"
+ " failed: %d", rv);
+ usb_unanchor_urb(res);
+ acm_write_done(acm, res->context);
+ }
+ }
+ spin_unlock_irq(&acm->write_lock);
+#else
if (acm->delayed_wb) {
wb = acm->delayed_wb;
acm->delayed_wb = NULL;
@@ -1502,7 +1529,7 @@ static int acm_resume(struct usb_interface *intf)
} else {
spin_unlock_irq(&acm->write_lock);
}
-
+#endif
/*
* delayed error checking because we must
View
2  drivers/video/tegra/dc/hdmi.c
@@ -1269,7 +1269,7 @@ static int tegra_dc_hdmi_setup_audio(struct tegra_dc *dc, unsigned audio_freq,
a_source = AUDIO_CNTRL0_SOURCE_SELECT_SPDIF;
#if !defined(CONFIG_ARCH_TEGRA_2x_SOC)
- tegra_hdmi_writel(hdmi,a_source,
+ tegra_hdmi_writel(hdmi,a_source | AUDIO_CNTRL0_INJECT_NULLSMPL,
HDMI_NV_PDISP_SOR_AUDIO_CNTRL0_0);
tegra_hdmi_writel(hdmi,
AUDIO_CNTRL0_ERROR_TOLERANCE(6) |
View
1  drivers/video/tegra/dc/hdmi_reg.h
@@ -414,6 +414,7 @@
#define AUDIO_CNTRL0_SOURCE_SELECT_AUTO (0 << 20)
#define AUDIO_CNTRL0_SOURCE_SELECT_SPDIF (1 << 20)
#define AUDIO_CNTRL0_SOURCE_SELECT_HDAL (2 << 20)
+#define AUDIO_CNTRL0_INJECT_NULLSMPL (1 << 29)
#define AUDIO_CNTRL0_FRAMES_PER_BLOCK(x) (((x) & 0xff) << 24)
#define HDMI_NV_PDISP_AUDIO_N 0x8c
View
5 fs/proc/base.c
@@ -888,6 +888,10 @@ static ssize_t mem_read(struct file * file, char __user * buf,
return ret;
}
+#define mem_write NULL
+
+#ifndef mem_write
+/* This is a security hazard */
static ssize_t mem_write(struct file * file, const char __user *buf,
size_t count, loff_t *ppos)
{
@@ -944,6 +948,7 @@ static ssize_t mem_write(struct file * file, const char __user *buf,
out_no_task:
return copied;
}
+#endif
loff_t mem_lseek(struct file *file, loff_t offset, int orig)
{
View
76 sound/pci/hda/hda_eld.c
@@ -312,6 +312,79 @@ static int hdmi_update_eld(struct hdmi_eld *e,
return -EINVAL;
}
+#define GET_BITS(val, lowbit, bits) \
+({ \
+ BUILD_BUG_ON(lowbit > 7); \
+ BUILD_BUG_ON(bits > 8); \
+ BUILD_BUG_ON(bits <= 0); \
+ \
+ (val >> (lowbit)) & ((1 << (bits)) - 1); \
+})
+
+/* update ELD information relevant for getting PCM info */
+static int hdmi_update_lpcm_sad_eld (struct hda_codec *codec, hda_nid_t nid,
+ struct hdmi_eld *e, int size)
+{
+ int i, j;
+ u32 val, sad_base;
+ struct cea_sad *a;
+
+ val = hdmi_get_eld_byte(codec, nid, 0);
+ e->eld_ver = GET_BITS(val, 3, 5);
+ if (e->eld_ver != ELD_VER_CEA_861D &&
+ e->eld_ver != ELD_VER_PARTIAL) {
+ snd_printd(KERN_INFO "HDMI: Unknown ELD version %d\n",
+ e->eld_ver);
+ goto out_fail;
+ }
+
+ val = hdmi_get_eld_byte(codec, nid, 4);
+ sad_base = GET_BITS(val, 0, 5);
+ sad_base += ELD_FIXED_BYTES;
+
+ val = hdmi_get_eld_byte(codec, nid, 5);
+ e->sad_count = GET_BITS(val, 4, 4);
+
+ for (i = 0; i < e->sad_count; i++, sad_base += 3) {
+ if ((sad_base + 3) > size) {
+ snd_printd(KERN_INFO "HDMI: out of range SAD %d\n", i);
+ goto out_fail;
+ }
+ a = &e->sad[i];
+
+ val = hdmi_get_eld_byte(codec, nid, sad_base);
+ a->format = GET_BITS(val, 3, 4);
+ a->channels = GET_BITS(val, 0, 3);
+ a->channels++;
+
+ a->rates = 0;
+ a->sample_bits = 0;
+ a->max_bitrate = 0;
+
+ if (a->format != AUDIO_CODING_TYPE_LPCM)
+ continue;
+
+ val = hdmi_get_eld_byte(codec, nid, sad_base + 1);
+ val = GET_BITS(val, 0, 7);
+ for (j = 0; j < 7; j++)
+ if (val & (1 << j))
+ a->rates |= cea_sampling_frequencies[j + 1];
+
+ val = hdmi_get_eld_byte(codec, nid, sad_base + 2);
+ val = GET_BITS(val, 0, 3);
+ for (j = 0; j < 3; j++)
+ if (val & (1 << j))
+ a->sample_bits |= cea_sample_sizes[j + 1];
+ }
+
+ e->lpcm_sad_ready = 1;
+ return 0;
+
+out_fail:
+ e->eld_ver = 0;
+ return -EINVAL;
+}
+
static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid)
{
int eldv;
@@ -357,6 +430,9 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
return -ERANGE;
}
+ if (!eld->lpcm_sad_ready)
+ hdmi_update_lpcm_sad_eld(codec, nid, eld, size);
+
buf = kmalloc(size, GFP_KERNEL);
if (!buf)
return -ENOMEM;
View
1  sound/pci/hda/hda_local.h
@@ -610,6 +610,7 @@ struct cea_sad {
struct hdmi_eld {
bool monitor_present;
bool eld_valid;
+ bool lpcm_sad_ready;
int eld_size;
int baseline_len;
int eld_ver;
View
22 sound/pci/hda/patch_hdmi.c
@@ -719,6 +719,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res)
spec->sink_eld[index].monitor_present = pind;
spec->sink_eld[index].eld_valid = eldv;
+ if (!eldv)
+ spec->sink_eld[index].lpcm_sad_ready = eldv;
if (pind && eldv) {
hdmi_get_show_eld(codec, spec->pin[index],
@@ -847,29 +849,17 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
#ifdef CONFIG_SND_HDA_PLATFORM_NVIDIA_TEGRA
if ((codec->preset->id == 0x10de0020) &&
- (!eld->eld_valid || !eld->sad_count)) {
- int err = 0;
- unsigned long timeout;
-
+ (!eld->eld_valid || !eld->sad_count || !eld->lpcm_sad_ready)) {
if (!eld->eld_valid) {
- err = tegra_hdmi_setup_hda_presence();
- if (err < 0) {
+ if (tegra_hdmi_setup_hda_presence() < 0) {
snd_printk(KERN_WARNING
"HDMI: No HDMI device connected\n");
return -ENODEV;
}
}
- timeout = jiffies + msecs_to_jiffies(5000);
- for (;;) {
- if (eld->eld_valid && eld->sad_count)
- break;
-
- if (time_after(jiffies, timeout))
- break;
-
- mdelay(10);
- }
+ if (!eld->lpcm_sad_ready)
+ return -EAGAIN;
}
#endif
View
41 sound/soc/codecs/rt5631.c
@@ -55,6 +55,7 @@
#define RT5631_VERSION "0.01 alsa 1.0.24"
+#define RETRY_MAX (5)
struct rt5631_priv {
int codec_version;
@@ -114,6 +115,8 @@ static inline void rt5631_write_reg_cache(struct snd_soc_codec *codec,
static inline int rt5631_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int val)
{
+ int ret = 0;
+ int retry = 0;
if (reg > 0x7e) {
if (reg == 0x90)
@@ -121,13 +124,22 @@ static inline int rt5631_write(struct snd_soc_codec *codec,
return 0;
}
- if (snd_soc_write(codec, reg, val) == 0) {
+ ret = snd_soc_write(codec, reg, val);
+ while((ret != 0) && (retry < RETRY_MAX)){
+ msleep(1);
+ ret = snd_soc_write(codec, reg, val);
+ retry++;
+ printk("%s: retry times = %d\n", __func__, retry);
+ }
+
+ if(ret == 0){
rt5631_write_reg_cache(codec, reg, val);
- return 0;
+ return 0;
}else{
- printk(KERN_ERR "%s failed\n", __func__);
- return -EIO;
- }
+ printk(KERN_ERR "%s failed\n", __func__);
+ return -EIO;
+ }
+
}
static inline unsigned int rt5631_read(struct snd_soc_codec *codec,
@@ -370,15 +382,6 @@ static int rt5631_dmic_get(struct snd_kcontrol *kcontrol,
static void rt5631_enable_dmic(struct snd_soc_codec *codec)
{
- if(output_source==OUTPUT_SOURCE_VOICE || input_source==INPUT_SOURCE_VR || input_source == INPUT_SOURCE_AGC ){
- printk("%s(): use dsp for capture gain = 0dB\n", __func__);
- rt5631_write_mask(codec, RT5631_ADC_CTRL_1, 0x0000, 0x001f); //boost 0dB
- }
- else{
- printk("%s(): use codec for capture gain = 28.5dB\n", __func__);
- rt5631_write_mask(codec, RT5631_ADC_CTRL_1, 0x0013, 0x001f); //boost 28.5dB
- }
-
rt5631_write_mask(codec, RT5631_DIG_MIC_CTRL, DMIC_ENA, DMIC_ENA_MASK);
rt5631_write_mask(codec, RT5631_DIG_MIC_CTRL,
DMIC_L_CH_UNMUTE | DMIC_R_CH_UNMUTE,
@@ -407,10 +410,10 @@ static int rt5631_dmic_put(struct snd_kcontrol *kcontrol,
return 0;
if (ucontrol->value.integer.value[0]) {
- //rt5631_enable_dmic(codec);
+ rt5631_enable_dmic(codec);
rt5631->dmic_used_flag = 1;
} else {
- //rt5631_close_dmic(codec);
+ rt5631_close_dmic(codec);
rt5631->dmic_used_flag = 0;
}
@@ -499,11 +502,11 @@ static int rt5631_set_gain(struct snd_kcontrol *kcontrol,
}else{
/* set dmic gain */
if(output_source==OUTPUT_SOURCE_VOICE || input_source==INPUT_SOURCE_VR || input_agc==INPUT_SOURCE_AGC){
- printk("%s(): use dsp for capture gain = 0dB\n", __func__);
+ printk("%s(): use dsp for capture gain\n", __func__);
rt5631_write_mask(codec, RT5631_ADC_CTRL_1, 0x0000, 0x001f); //boost 0dB
}else{
- printk("%s(): use codec for capture gain = 28.5dB\n", __func__);
- rt5631_write_mask(codec, RT5631_ADC_CTRL_1, 0x0013, 0x001f); //boost 28.5dB
+ printk("%s(): use codec for capture gain\n", __func__);
+ rt5631_write_mask(codec, RT5631_ADC_CTRL_1, 0x000f, 0x001f); //boost 22.5dB
}
}
mutex_unlock(&codec->mutex);
View
13 sound/soc/soc-cache.c
@@ -17,6 +17,7 @@
#include <linux/lzo.h>
#include <linux/bitmap.h>
#include <linux/rbtree.h>
+#include <linux/delay.h>
#include <trace/events/asoc.h>
@@ -392,6 +393,7 @@ static unsigned int snd_soc_8_16_read_i2c(struct snd_soc_codec *codec,
u8 reg = r;
u16 data;
int ret;
+ int retry = 0;
struct i2c_client *client = codec->control_data;
/* Write register */
@@ -408,8 +410,15 @@ static unsigned int snd_soc_8_16_read_i2c(struct snd_soc_codec *codec,
ret = i2c_transfer(client->adapter, xfer, 2);
if (ret != 2) {
- dev_err(&client->dev, "i2c_transfer() returned %d\n", ret);
- return 0;
+ dev_err(&client->dev, "%s i2c_transfer() returned %d\n", __func__, ret);
+ while((retry < 5) && ret != 2){
+ msleep(1);
+ retry++;
+ ret = i2c_transfer(client->adapter, xfer, 2);
+ dev_err(&client->dev, "i2c_transfer() retry = %d", retry);
+ }
+ if(ret != 2)
+ return 0;
}
return (data >> 8) | ((data & 0xff) << 8);
Please sign in to comment.
Something went wrong with that request. Please try again.