diff options
| -rw-r--r-- | Documentation/sound/alsa/HD-Audio-Models.txt | 6 | ||||
| -rw-r--r-- | drivers/video/mmp/hw/mmp_ctrl.c | 17 | ||||
| -rw-r--r-- | drivers/video/mxsfb.c | 1 | ||||
| -rw-r--r-- | drivers/video/neofb.c | 4 | ||||
| -rw-r--r-- | drivers/video/of_display_timing.c | 6 | ||||
| -rw-r--r-- | drivers/video/omap2/displays-new/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/video/omap2/displays-new/connector-analog-tv.c | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/displays-new/connector-dvi.c | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/displays-new/connector-hdmi.c | 2 | ||||
| -rw-r--r-- | drivers/video/omap2/dss/dispc.c | 1 | ||||
| -rw-r--r-- | drivers/video/s3fb.c | 9 | ||||
| -rw-r--r-- | fs/reiserfs/journal.c | 67 | ||||
| -rw-r--r-- | fs/udf/ialloc.c | 16 | ||||
| -rw-r--r-- | fs/udf/super.c | 64 | ||||
| -rw-r--r-- | fs/udf/udf_sb.h | 2 | ||||
| -rw-r--r-- | lib/kobject.c | 5 | ||||
| -rw-r--r-- | lib/lockref.c | 13 | ||||
| -rw-r--r-- | sound/core/compress_offload.c | 15 | ||||
| -rw-r--r-- | sound/pci/hda/patch_cirrus.c | 72 | ||||
| -rw-r--r-- | sound/pci/hda/patch_hdmi.c | 47 | ||||
| -rw-r--r-- | sound/pci/hda/patch_realtek.c | 16 |
21 files changed, 210 insertions, 158 deletions
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index a46ddb85e83a..f911e3656209 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt | |||
| @@ -296,6 +296,12 @@ Cirrus Logic CS4206/4207 | |||
| 296 | imac27 IMac 27 Inch | 296 | imac27 IMac 27 Inch |
| 297 | auto BIOS setup (default) | 297 | auto BIOS setup (default) |
| 298 | 298 | ||
| 299 | Cirrus Logic CS4208 | ||
| 300 | =================== | ||
| 301 | mba6 MacBook Air 6,1 and 6,2 | ||
| 302 | gpio0 Enable GPIO 0 amp | ||
| 303 | auto BIOS setup (default) | ||
| 304 | |||
| 299 | VIA VT17xx/VT18xx/VT20xx | 305 | VIA VT17xx/VT18xx/VT20xx |
| 300 | ======================== | 306 | ======================== |
| 301 | auto BIOS setup (default) | 307 | auto BIOS setup (default) |
diff --git a/drivers/video/mmp/hw/mmp_ctrl.c b/drivers/video/mmp/hw/mmp_ctrl.c index 75dca19bf214..6ac755270ab4 100644 --- a/drivers/video/mmp/hw/mmp_ctrl.c +++ b/drivers/video/mmp/hw/mmp_ctrl.c | |||
| @@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev) | |||
| 514 | if (IS_ERR(ctrl->clk)) { | 514 | if (IS_ERR(ctrl->clk)) { |
| 515 | dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name); | 515 | dev_err(ctrl->dev, "unable to get clk %s\n", mi->clk_name); |
| 516 | ret = -ENOENT; | 516 | ret = -ENOENT; |
| 517 | goto failed_get_clk; | 517 | goto failed; |
| 518 | } | 518 | } |
| 519 | clk_prepare_enable(ctrl->clk); | 519 | clk_prepare_enable(ctrl->clk); |
| 520 | 520 | ||
| @@ -551,21 +551,8 @@ failed_path_init: | |||
| 551 | path_deinit(path_plat); | 551 | path_deinit(path_plat); |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | if (ctrl->clk) { | 554 | clk_disable_unprepare(ctrl->clk); |
| 555 | devm_clk_put(ctrl->dev, ctrl->clk); | ||
| 556 | clk_disable_unprepare(ctrl->clk); | ||
| 557 | } | ||
| 558 | failed_get_clk: | ||
| 559 | devm_free_irq(ctrl->dev, ctrl->irq, ctrl); | ||
| 560 | failed: | 555 | failed: |
| 561 | if (ctrl) { | ||
| 562 | if (ctrl->reg_base) | ||
| 563 | devm_iounmap(ctrl->dev, ctrl->reg_base); | ||
| 564 | devm_release_mem_region(ctrl->dev, res->start, | ||
| 565 | resource_size(res)); | ||
| 566 | devm_kfree(ctrl->dev, ctrl); | ||
| 567 | } | ||
| 568 | |||
| 569 | dev_err(&pdev->dev, "device init failed\n"); | 556 | dev_err(&pdev->dev, "device init failed\n"); |
| 570 | 557 | ||
| 571 | return ret; | 558 | return ret; |
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index d250ed0f806d..27197a8048c0 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c | |||
| @@ -620,6 +620,7 @@ static int mxsfb_restore_mode(struct mxsfb_info *host) | |||
| 620 | break; | 620 | break; |
| 621 | case 3: | 621 | case 3: |
| 622 | bits_per_pixel = 32; | 622 | bits_per_pixel = 32; |
| 623 | break; | ||
| 623 | case 1: | 624 | case 1: |
| 624 | default: | 625 | default: |
| 625 | return -EINVAL; | 626 | return -EINVAL; |
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 7ef079c146e7..c172a5281f9e 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c | |||
| @@ -2075,6 +2075,7 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 2075 | if (!fb_find_mode(&info->var, info, mode_option, NULL, 0, | 2075 | if (!fb_find_mode(&info->var, info, mode_option, NULL, 0, |
| 2076 | info->monspecs.modedb, 16)) { | 2076 | info->monspecs.modedb, 16)) { |
| 2077 | printk(KERN_ERR "neofb: Unable to find usable video mode.\n"); | 2077 | printk(KERN_ERR "neofb: Unable to find usable video mode.\n"); |
| 2078 | err = -EINVAL; | ||
| 2078 | goto err_map_video; | 2079 | goto err_map_video; |
| 2079 | } | 2080 | } |
| 2080 | 2081 | ||
| @@ -2097,7 +2098,8 @@ static int neofb_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 2097 | info->fix.smem_len >> 10, info->var.xres, | 2098 | info->fix.smem_len >> 10, info->var.xres, |
| 2098 | info->var.yres, h_sync / 1000, h_sync % 1000, v_sync); | 2099 | info->var.yres, h_sync / 1000, h_sync % 1000, v_sync); |
| 2099 | 2100 | ||
| 2100 | if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) | 2101 | err = fb_alloc_cmap(&info->cmap, 256, 0); |
| 2102 | if (err < 0) | ||
| 2101 | goto err_map_video; | 2103 | goto err_map_video; |
| 2102 | 2104 | ||
| 2103 | err = register_framebuffer(info); | 2105 | err = register_framebuffer(info); |
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 171821ddd78d..ba5b40f581f6 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c | |||
| @@ -120,7 +120,7 @@ int of_get_display_timing(struct device_node *np, const char *name, | |||
| 120 | return -EINVAL; | 120 | return -EINVAL; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | timing_np = of_find_node_by_name(np, name); | 123 | timing_np = of_get_child_by_name(np, name); |
| 124 | if (!timing_np) { | 124 | if (!timing_np) { |
| 125 | pr_err("%s: could not find node '%s'\n", | 125 | pr_err("%s: could not find node '%s'\n", |
| 126 | of_node_full_name(np), name); | 126 | of_node_full_name(np), name); |
| @@ -143,11 +143,11 @@ struct display_timings *of_get_display_timings(struct device_node *np) | |||
| 143 | struct display_timings *disp; | 143 | struct display_timings *disp; |
| 144 | 144 | ||
| 145 | if (!np) { | 145 | if (!np) { |
| 146 | pr_err("%s: no devicenode given\n", of_node_full_name(np)); | 146 | pr_err("%s: no device node given\n", of_node_full_name(np)); |
| 147 | return NULL; | 147 | return NULL; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | timings_np = of_find_node_by_name(np, "display-timings"); | 150 | timings_np = of_get_child_by_name(np, "display-timings"); |
| 151 | if (!timings_np) { | 151 | if (!timings_np) { |
| 152 | pr_err("%s: could not find display-timings node\n", | 152 | pr_err("%s: could not find display-timings node\n", |
| 153 | of_node_full_name(np)); | 153 | of_node_full_name(np)); |
diff --git a/drivers/video/omap2/displays-new/Kconfig b/drivers/video/omap2/displays-new/Kconfig index 6c90885b0940..10b25e7cd878 100644 --- a/drivers/video/omap2/displays-new/Kconfig +++ b/drivers/video/omap2/displays-new/Kconfig | |||
| @@ -35,6 +35,7 @@ config DISPLAY_PANEL_DPI | |||
| 35 | 35 | ||
| 36 | config DISPLAY_PANEL_DSI_CM | 36 | config DISPLAY_PANEL_DSI_CM |
| 37 | tristate "Generic DSI Command Mode Panel" | 37 | tristate "Generic DSI Command Mode Panel" |
| 38 | depends on BACKLIGHT_CLASS_DEVICE | ||
| 38 | help | 39 | help |
| 39 | Driver for generic DSI command mode panels. | 40 | Driver for generic DSI command mode panels. |
| 40 | 41 | ||
diff --git a/drivers/video/omap2/displays-new/connector-analog-tv.c b/drivers/video/omap2/displays-new/connector-analog-tv.c index 1b60698f141e..ccd9073f706f 100644 --- a/drivers/video/omap2/displays-new/connector-analog-tv.c +++ b/drivers/video/omap2/displays-new/connector-analog-tv.c | |||
| @@ -191,7 +191,7 @@ static int tvc_probe_pdata(struct platform_device *pdev) | |||
| 191 | in = omap_dss_find_output(pdata->source); | 191 | in = omap_dss_find_output(pdata->source); |
| 192 | if (in == NULL) { | 192 | if (in == NULL) { |
| 193 | dev_err(&pdev->dev, "Failed to find video source\n"); | 193 | dev_err(&pdev->dev, "Failed to find video source\n"); |
| 194 | return -ENODEV; | 194 | return -EPROBE_DEFER; |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | ddata->in = in; | 197 | ddata->in = in; |
diff --git a/drivers/video/omap2/displays-new/connector-dvi.c b/drivers/video/omap2/displays-new/connector-dvi.c index bc5f8ceda371..63d88ee6dfe4 100644 --- a/drivers/video/omap2/displays-new/connector-dvi.c +++ b/drivers/video/omap2/displays-new/connector-dvi.c | |||
| @@ -263,7 +263,7 @@ static int dvic_probe_pdata(struct platform_device *pdev) | |||
| 263 | in = omap_dss_find_output(pdata->source); | 263 | in = omap_dss_find_output(pdata->source); |
| 264 | if (in == NULL) { | 264 | if (in == NULL) { |
| 265 | dev_err(&pdev->dev, "Failed to find video source\n"); | 265 | dev_err(&pdev->dev, "Failed to find video source\n"); |
| 266 | return -ENODEV; | 266 | return -EPROBE_DEFER; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | ddata->in = in; | 269 | ddata->in = in; |
diff --git a/drivers/video/omap2/displays-new/connector-hdmi.c b/drivers/video/omap2/displays-new/connector-hdmi.c index c5826716d6ab..9abe2c039ae9 100644 --- a/drivers/video/omap2/displays-new/connector-hdmi.c +++ b/drivers/video/omap2/displays-new/connector-hdmi.c | |||
| @@ -290,7 +290,7 @@ static int hdmic_probe_pdata(struct platform_device *pdev) | |||
| 290 | in = omap_dss_find_output(pdata->source); | 290 | in = omap_dss_find_output(pdata->source); |
| 291 | if (in == NULL) { | 291 | if (in == NULL) { |
| 292 | dev_err(&pdev->dev, "Failed to find video source\n"); | 292 | dev_err(&pdev->dev, "Failed to find video source\n"); |
| 293 | return -ENODEV; | 293 | return -EPROBE_DEFER; |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | ddata->in = in; | 296 | ddata->in = in; |
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 02a7340111df..477975009eee 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
| @@ -3691,6 +3691,7 @@ static int __init omap_dispchw_probe(struct platform_device *pdev) | |||
| 3691 | } | 3691 | } |
| 3692 | 3692 | ||
| 3693 | pm_runtime_enable(&pdev->dev); | 3693 | pm_runtime_enable(&pdev->dev); |
| 3694 | pm_runtime_irq_safe(&pdev->dev); | ||
| 3694 | 3695 | ||
| 3695 | r = dispc_runtime_get(); | 3696 | r = dispc_runtime_get(); |
| 3696 | if (r) | 3697 | if (r) |
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 47ca86c5c6c0..d838ba829459 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
| @@ -1336,14 +1336,7 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
| 1336 | (info->var.bits_per_pixel * info->var.xres_virtual); | 1336 | (info->var.bits_per_pixel * info->var.xres_virtual); |
| 1337 | if (info->var.yres_virtual < info->var.yres) { | 1337 | if (info->var.yres_virtual < info->var.yres) { |
| 1338 | dev_err(info->device, "virtual vertical size smaller than real\n"); | 1338 | dev_err(info->device, "virtual vertical size smaller than real\n"); |
| 1339 | goto err_find_mode; | 1339 | rc = -EINVAL; |
| 1340 | } | ||
| 1341 | |||
| 1342 | /* maximize virtual vertical size for fast scrolling */ | ||
| 1343 | info->var.yres_virtual = info->fix.smem_len * 8 / | ||
| 1344 | (info->var.bits_per_pixel * info->var.xres_virtual); | ||
| 1345 | if (info->var.yres_virtual < info->var.yres) { | ||
| 1346 | dev_err(info->device, "virtual vertical size smaller than real\n"); | ||
| 1347 | goto err_find_mode; | 1340 | goto err_find_mode; |
| 1348 | } | 1341 | } |
| 1349 | 1342 | ||
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index 73feacc49b2e..fd777032c2ba 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
| @@ -1163,21 +1163,6 @@ static struct reiserfs_journal_list *find_newer_jl_for_cn(struct | |||
| 1163 | return NULL; | 1163 | return NULL; |
| 1164 | } | 1164 | } |
| 1165 | 1165 | ||
| 1166 | static int newer_jl_done(struct reiserfs_journal_cnode *cn) | ||
| 1167 | { | ||
| 1168 | struct super_block *sb = cn->sb; | ||
| 1169 | b_blocknr_t blocknr = cn->blocknr; | ||
| 1170 | |||
| 1171 | cn = cn->hprev; | ||
| 1172 | while (cn) { | ||
| 1173 | if (cn->sb == sb && cn->blocknr == blocknr && cn->jlist && | ||
| 1174 | atomic_read(&cn->jlist->j_commit_left) != 0) | ||
| 1175 | return 0; | ||
| 1176 | cn = cn->hprev; | ||
| 1177 | } | ||
| 1178 | return 1; | ||
| 1179 | } | ||
| 1180 | |||
| 1181 | static void remove_journal_hash(struct super_block *, | 1166 | static void remove_journal_hash(struct super_block *, |
| 1182 | struct reiserfs_journal_cnode **, | 1167 | struct reiserfs_journal_cnode **, |
| 1183 | struct reiserfs_journal_list *, unsigned long, | 1168 | struct reiserfs_journal_list *, unsigned long, |
| @@ -1353,7 +1338,6 @@ static int flush_journal_list(struct super_block *s, | |||
| 1353 | reiserfs_warning(s, "clm-2048", "called with wcount %d", | 1338 | reiserfs_warning(s, "clm-2048", "called with wcount %d", |
| 1354 | atomic_read(&journal->j_wcount)); | 1339 | atomic_read(&journal->j_wcount)); |
| 1355 | } | 1340 | } |
| 1356 | BUG_ON(jl->j_trans_id == 0); | ||
| 1357 | 1341 | ||
| 1358 | /* if flushall == 0, the lock is already held */ | 1342 | /* if flushall == 0, the lock is already held */ |
| 1359 | if (flushall) { | 1343 | if (flushall) { |
| @@ -1593,31 +1577,6 @@ static int flush_journal_list(struct super_block *s, | |||
| 1593 | return err; | 1577 | return err; |
| 1594 | } | 1578 | } |
| 1595 | 1579 | ||
| 1596 | static int test_transaction(struct super_block *s, | ||
| 1597 | struct reiserfs_journal_list *jl) | ||
| 1598 | { | ||
| 1599 | struct reiserfs_journal_cnode *cn; | ||
| 1600 | |||
| 1601 | if (jl->j_len == 0 || atomic_read(&jl->j_nonzerolen) == 0) | ||
| 1602 | return 1; | ||
| 1603 | |||
| 1604 | cn = jl->j_realblock; | ||
| 1605 | while (cn) { | ||
| 1606 | /* if the blocknr == 0, this has been cleared from the hash, | ||
| 1607 | ** skip it | ||
| 1608 | */ | ||
| 1609 | if (cn->blocknr == 0) { | ||
| 1610 | goto next; | ||
| 1611 | } | ||
| 1612 | if (cn->bh && !newer_jl_done(cn)) | ||
| 1613 | return 0; | ||
| 1614 | next: | ||
| 1615 | cn = cn->next; | ||
| 1616 | cond_resched(); | ||
| 1617 | } | ||
| 1618 | return 0; | ||
| 1619 | } | ||
| 1620 | |||
| 1621 | static int write_one_transaction(struct super_block *s, | 1580 | static int write_one_transaction(struct super_block *s, |
| 1622 | struct reiserfs_journal_list *jl, | 1581 | struct reiserfs_journal_list *jl, |
| 1623 | struct buffer_chunk *chunk) | 1582 | struct buffer_chunk *chunk) |
| @@ -1805,6 +1764,8 @@ static int flush_used_journal_lists(struct super_block *s, | |||
| 1805 | break; | 1764 | break; |
| 1806 | tjl = JOURNAL_LIST_ENTRY(tjl->j_list.next); | 1765 | tjl = JOURNAL_LIST_ENTRY(tjl->j_list.next); |
| 1807 | } | 1766 | } |
| 1767 | get_journal_list(jl); | ||
| 1768 | get_journal_list(flush_jl); | ||
| 1808 | /* try to find a group of blocks we can flush across all the | 1769 | /* try to find a group of blocks we can flush across all the |
| 1809 | ** transactions, but only bother if we've actually spanned | 1770 | ** transactions, but only bother if we've actually spanned |
| 1810 | ** across multiple lists | 1771 | ** across multiple lists |
| @@ -1813,6 +1774,8 @@ static int flush_used_journal_lists(struct super_block *s, | |||
| 1813 | ret = kupdate_transactions(s, jl, &tjl, &trans_id, len, i); | 1774 | ret = kupdate_transactions(s, jl, &tjl, &trans_id, len, i); |
| 1814 | } | 1775 | } |
| 1815 | flush_journal_list(s, flush_jl, 1); | 1776 | flush_journal_list(s, flush_jl, 1); |
| 1777 | put_journal_list(s, flush_jl); | ||
| 1778 | put_journal_list(s, jl); | ||
| 1816 | return 0; | 1779 | return 0; |
| 1817 | } | 1780 | } |
| 1818 | 1781 | ||
| @@ -3868,27 +3831,6 @@ int reiserfs_prepare_for_journal(struct super_block *sb, | |||
| 3868 | return 1; | 3831 | return 1; |
| 3869 | } | 3832 | } |
| 3870 | 3833 | ||
| 3871 | static void flush_old_journal_lists(struct super_block *s) | ||
| 3872 | { | ||
| 3873 | struct reiserfs_journal *journal = SB_JOURNAL(s); | ||
| 3874 | struct reiserfs_journal_list *jl; | ||
| 3875 | struct list_head *entry; | ||
| 3876 | time_t now = get_seconds(); | ||
| 3877 | |||
| 3878 | while (!list_empty(&journal->j_journal_list)) { | ||
| 3879 | entry = journal->j_journal_list.next; | ||
| 3880 | jl = JOURNAL_LIST_ENTRY(entry); | ||
| 3881 | /* this check should always be run, to send old lists to disk */ | ||
| 3882 | if (jl->j_timestamp < (now - (JOURNAL_MAX_TRANS_AGE * 4)) && | ||
| 3883 | atomic_read(&jl->j_commit_left) == 0 && | ||
| 3884 | test_transaction(s, jl)) { | ||
| 3885 | flush_used_journal_lists(s, jl); | ||
| 3886 | } else { | ||
| 3887 | break; | ||
| 3888 | } | ||
| 3889 | } | ||
| 3890 | } | ||
| 3891 | |||
| 3892 | /* | 3834 | /* |
| 3893 | ** long and ugly. If flush, will not return until all commit | 3835 | ** long and ugly. If flush, will not return until all commit |
| 3894 | ** blocks and all real buffers in the trans are on disk. | 3836 | ** blocks and all real buffers in the trans are on disk. |
| @@ -4232,7 +4174,6 @@ static int do_journal_end(struct reiserfs_transaction_handle *th, | |||
| 4232 | } | 4174 | } |
| 4233 | } | 4175 | } |
| 4234 | } | 4176 | } |
| 4235 | flush_old_journal_lists(sb); | ||
| 4236 | 4177 | ||
| 4237 | journal->j_current_jl->j_list_bitmap = | 4178 | journal->j_current_jl->j_list_bitmap = |
| 4238 | get_list_bitmap(sb, journal->j_current_jl); | 4179 | get_list_bitmap(sb, journal->j_current_jl); |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 7e5aae4bf46f..6eaf5edf1ea1 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
| @@ -30,18 +30,17 @@ void udf_free_inode(struct inode *inode) | |||
| 30 | { | 30 | { |
| 31 | struct super_block *sb = inode->i_sb; | 31 | struct super_block *sb = inode->i_sb; |
| 32 | struct udf_sb_info *sbi = UDF_SB(sb); | 32 | struct udf_sb_info *sbi = UDF_SB(sb); |
| 33 | struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sb); | ||
| 33 | 34 | ||
| 34 | mutex_lock(&sbi->s_alloc_mutex); | 35 | if (lvidiu) { |
| 35 | if (sbi->s_lvid_bh) { | 36 | mutex_lock(&sbi->s_alloc_mutex); |
| 36 | struct logicalVolIntegrityDescImpUse *lvidiu = | ||
| 37 | udf_sb_lvidiu(sbi); | ||
| 38 | if (S_ISDIR(inode->i_mode)) | 37 | if (S_ISDIR(inode->i_mode)) |
| 39 | le32_add_cpu(&lvidiu->numDirs, -1); | 38 | le32_add_cpu(&lvidiu->numDirs, -1); |
| 40 | else | 39 | else |
| 41 | le32_add_cpu(&lvidiu->numFiles, -1); | 40 | le32_add_cpu(&lvidiu->numFiles, -1); |
| 42 | udf_updated_lvid(sb); | 41 | udf_updated_lvid(sb); |
| 42 | mutex_unlock(&sbi->s_alloc_mutex); | ||
| 43 | } | 43 | } |
| 44 | mutex_unlock(&sbi->s_alloc_mutex); | ||
| 45 | 44 | ||
| 46 | udf_free_blocks(sb, NULL, &UDF_I(inode)->i_location, 0, 1); | 45 | udf_free_blocks(sb, NULL, &UDF_I(inode)->i_location, 0, 1); |
| 47 | } | 46 | } |
| @@ -55,6 +54,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) | |||
| 55 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; | 54 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; |
| 56 | struct udf_inode_info *iinfo; | 55 | struct udf_inode_info *iinfo; |
| 57 | struct udf_inode_info *dinfo = UDF_I(dir); | 56 | struct udf_inode_info *dinfo = UDF_I(dir); |
| 57 | struct logicalVolIntegrityDescImpUse *lvidiu; | ||
| 58 | 58 | ||
| 59 | inode = new_inode(sb); | 59 | inode = new_inode(sb); |
| 60 | 60 | ||
| @@ -92,12 +92,10 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) | |||
| 92 | return NULL; | 92 | return NULL; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | if (sbi->s_lvid_bh) { | 95 | lvidiu = udf_sb_lvidiu(sb); |
| 96 | struct logicalVolIntegrityDescImpUse *lvidiu; | 96 | if (lvidiu) { |
| 97 | |||
| 98 | iinfo->i_unique = lvid_get_unique_id(sb); | 97 | iinfo->i_unique = lvid_get_unique_id(sb); |
| 99 | mutex_lock(&sbi->s_alloc_mutex); | 98 | mutex_lock(&sbi->s_alloc_mutex); |
| 100 | lvidiu = udf_sb_lvidiu(sbi); | ||
| 101 | if (S_ISDIR(mode)) | 99 | if (S_ISDIR(mode)) |
| 102 | le32_add_cpu(&lvidiu->numDirs, 1); | 100 | le32_add_cpu(&lvidiu->numDirs, 1); |
| 103 | else | 101 | else |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 839a2bad7f45..91219385691d 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
| @@ -94,13 +94,25 @@ static unsigned int udf_count_free(struct super_block *); | |||
| 94 | static int udf_statfs(struct dentry *, struct kstatfs *); | 94 | static int udf_statfs(struct dentry *, struct kstatfs *); |
| 95 | static int udf_show_options(struct seq_file *, struct dentry *); | 95 | static int udf_show_options(struct seq_file *, struct dentry *); |
| 96 | 96 | ||
| 97 | struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi) | 97 | struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb) |
| 98 | { | 98 | { |
| 99 | struct logicalVolIntegrityDesc *lvid = | 99 | struct logicalVolIntegrityDesc *lvid; |
| 100 | (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data; | 100 | unsigned int partnum; |
| 101 | __u32 number_of_partitions = le32_to_cpu(lvid->numOfPartitions); | 101 | unsigned int offset; |
| 102 | __u32 offset = number_of_partitions * 2 * | 102 | |
| 103 | sizeof(uint32_t)/sizeof(uint8_t); | 103 | if (!UDF_SB(sb)->s_lvid_bh) |
| 104 | return NULL; | ||
| 105 | lvid = (struct logicalVolIntegrityDesc *)UDF_SB(sb)->s_lvid_bh->b_data; | ||
| 106 | partnum = le32_to_cpu(lvid->numOfPartitions); | ||
| 107 | if ((sb->s_blocksize - sizeof(struct logicalVolIntegrityDescImpUse) - | ||
| 108 | offsetof(struct logicalVolIntegrityDesc, impUse)) / | ||
| 109 | (2 * sizeof(uint32_t)) < partnum) { | ||
| 110 | udf_err(sb, "Logical volume integrity descriptor corrupted " | ||
| 111 | "(numOfPartitions = %u)!\n", partnum); | ||
| 112 | return NULL; | ||
| 113 | } | ||
| 114 | /* The offset is to skip freeSpaceTable and sizeTable arrays */ | ||
| 115 | offset = partnum * 2 * sizeof(uint32_t); | ||
| 104 | return (struct logicalVolIntegrityDescImpUse *)&(lvid->impUse[offset]); | 116 | return (struct logicalVolIntegrityDescImpUse *)&(lvid->impUse[offset]); |
| 105 | } | 117 | } |
| 106 | 118 | ||
| @@ -629,9 +641,10 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options) | |||
| 629 | struct udf_options uopt; | 641 | struct udf_options uopt; |
| 630 | struct udf_sb_info *sbi = UDF_SB(sb); | 642 | struct udf_sb_info *sbi = UDF_SB(sb); |
| 631 | int error = 0; | 643 | int error = 0; |
| 644 | struct logicalVolIntegrityDescImpUse *lvidiu = udf_sb_lvidiu(sb); | ||
| 632 | 645 | ||
| 633 | if (sbi->s_lvid_bh) { | 646 | if (lvidiu) { |
| 634 | int write_rev = le16_to_cpu(udf_sb_lvidiu(sbi)->minUDFWriteRev); | 647 | int write_rev = le16_to_cpu(lvidiu->minUDFWriteRev); |
| 635 | if (write_rev > UDF_MAX_WRITE_VERSION && !(*flags & MS_RDONLY)) | 648 | if (write_rev > UDF_MAX_WRITE_VERSION && !(*flags & MS_RDONLY)) |
| 636 | return -EACCES; | 649 | return -EACCES; |
| 637 | } | 650 | } |
| @@ -1905,11 +1918,12 @@ static void udf_open_lvid(struct super_block *sb) | |||
| 1905 | 1918 | ||
| 1906 | if (!bh) | 1919 | if (!bh) |
| 1907 | return; | 1920 | return; |
| 1908 | |||
| 1909 | mutex_lock(&sbi->s_alloc_mutex); | ||
| 1910 | lvid = (struct logicalVolIntegrityDesc *)bh->b_data; | 1921 | lvid = (struct logicalVolIntegrityDesc *)bh->b_data; |
| 1911 | lvidiu = udf_sb_lvidiu(sbi); | 1922 | lvidiu = udf_sb_lvidiu(sb); |
| 1923 | if (!lvidiu) | ||
| 1924 | return; | ||
| 1912 | 1925 | ||
| 1926 | mutex_lock(&sbi->s_alloc_mutex); | ||
| 1913 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1927 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
| 1914 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; | 1928 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; |
| 1915 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, | 1929 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, |
| @@ -1937,10 +1951,12 @@ static void udf_close_lvid(struct super_block *sb) | |||
| 1937 | 1951 | ||
| 1938 | if (!bh) | 1952 | if (!bh) |
| 1939 | return; | 1953 | return; |
| 1954 | lvid = (struct logicalVolIntegrityDesc *)bh->b_data; | ||
| 1955 | lvidiu = udf_sb_lvidiu(sb); | ||
| 1956 | if (!lvidiu) | ||
| 1957 | return; | ||
| 1940 | 1958 | ||
| 1941 | mutex_lock(&sbi->s_alloc_mutex); | 1959 | mutex_lock(&sbi->s_alloc_mutex); |
| 1942 | lvid = (struct logicalVolIntegrityDesc *)bh->b_data; | ||
| 1943 | lvidiu = udf_sb_lvidiu(sbi); | ||
| 1944 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1960 | lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
| 1945 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; | 1961 | lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; |
| 1946 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, CURRENT_TIME); | 1962 | udf_time_to_disk_stamp(&lvid->recordingDateAndTime, CURRENT_TIME); |
| @@ -2093,15 +2109,19 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
| 2093 | 2109 | ||
| 2094 | if (sbi->s_lvid_bh) { | 2110 | if (sbi->s_lvid_bh) { |
| 2095 | struct logicalVolIntegrityDescImpUse *lvidiu = | 2111 | struct logicalVolIntegrityDescImpUse *lvidiu = |
| 2096 | udf_sb_lvidiu(sbi); | 2112 | udf_sb_lvidiu(sb); |
| 2097 | uint16_t minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev); | 2113 | uint16_t minUDFReadRev; |
| 2098 | uint16_t minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev); | 2114 | uint16_t minUDFWriteRev; |
| 2099 | /* uint16_t maxUDFWriteRev = | ||
| 2100 | le16_to_cpu(lvidiu->maxUDFWriteRev); */ | ||
| 2101 | 2115 | ||
| 2116 | if (!lvidiu) { | ||
| 2117 | ret = -EINVAL; | ||
| 2118 | goto error_out; | ||
| 2119 | } | ||
| 2120 | minUDFReadRev = le16_to_cpu(lvidiu->minUDFReadRev); | ||
| 2121 | minUDFWriteRev = le16_to_cpu(lvidiu->minUDFWriteRev); | ||
| 2102 | if (minUDFReadRev > UDF_MAX_READ_VERSION) { | 2122 | if (minUDFReadRev > UDF_MAX_READ_VERSION) { |
| 2103 | udf_err(sb, "minUDFReadRev=%x (max is %x)\n", | 2123 | udf_err(sb, "minUDFReadRev=%x (max is %x)\n", |
| 2104 | le16_to_cpu(lvidiu->minUDFReadRev), | 2124 | minUDFReadRev, |
| 2105 | UDF_MAX_READ_VERSION); | 2125 | UDF_MAX_READ_VERSION); |
| 2106 | ret = -EINVAL; | 2126 | ret = -EINVAL; |
| 2107 | goto error_out; | 2127 | goto error_out; |
| @@ -2265,11 +2285,7 @@ static int udf_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
| 2265 | struct logicalVolIntegrityDescImpUse *lvidiu; | 2285 | struct logicalVolIntegrityDescImpUse *lvidiu; |
| 2266 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); | 2286 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); |
| 2267 | 2287 | ||
| 2268 | if (sbi->s_lvid_bh != NULL) | 2288 | lvidiu = udf_sb_lvidiu(sb); |
| 2269 | lvidiu = udf_sb_lvidiu(sbi); | ||
| 2270 | else | ||
| 2271 | lvidiu = NULL; | ||
| 2272 | |||
| 2273 | buf->f_type = UDF_SUPER_MAGIC; | 2289 | buf->f_type = UDF_SUPER_MAGIC; |
| 2274 | buf->f_bsize = sb->s_blocksize; | 2290 | buf->f_bsize = sb->s_blocksize; |
| 2275 | buf->f_blocks = sbi->s_partmaps[sbi->s_partition].s_partition_len; | 2291 | buf->f_blocks = sbi->s_partmaps[sbi->s_partition].s_partition_len; |
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h index ed401e94aa8c..1f32c7bd9f57 100644 --- a/fs/udf/udf_sb.h +++ b/fs/udf/udf_sb.h | |||
| @@ -162,7 +162,7 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb) | |||
| 162 | return sb->s_fs_info; | 162 | return sb->s_fs_info; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi); | 165 | struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb); |
| 166 | 166 | ||
| 167 | int udf_compute_nr_groups(struct super_block *sb, u32 partition); | 167 | int udf_compute_nr_groups(struct super_block *sb, u32 partition); |
| 168 | 168 | ||
diff --git a/lib/kobject.c b/lib/kobject.c index 962175134702..669bf190d4fb 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
| @@ -933,10 +933,7 @@ const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj) | |||
| 933 | 933 | ||
| 934 | bool kobj_ns_current_may_mount(enum kobj_ns_type type) | 934 | bool kobj_ns_current_may_mount(enum kobj_ns_type type) |
| 935 | { | 935 | { |
| 936 | bool may_mount = false; | 936 | bool may_mount = true; |
| 937 | |||
| 938 | if (type == KOBJ_NS_TYPE_NONE) | ||
| 939 | return true; | ||
| 940 | 937 | ||
| 941 | spin_lock(&kobj_ns_type_lock); | 938 | spin_lock(&kobj_ns_type_lock); |
| 942 | if ((type > KOBJ_NS_TYPE_NONE) && (type < KOBJ_NS_TYPES) && | 939 | if ((type > KOBJ_NS_TYPE_NONE) && (type < KOBJ_NS_TYPES) && |
diff --git a/lib/lockref.c b/lib/lockref.c index 677d036cf3c7..e294ae445c9a 100644 --- a/lib/lockref.c +++ b/lib/lockref.c | |||
| @@ -4,6 +4,14 @@ | |||
| 4 | #ifdef CONFIG_CMPXCHG_LOCKREF | 4 | #ifdef CONFIG_CMPXCHG_LOCKREF |
| 5 | 5 | ||
| 6 | /* | 6 | /* |
| 7 | * Allow weakly-ordered memory architectures to provide barrier-less | ||
| 8 | * cmpxchg semantics for lockref updates. | ||
| 9 | */ | ||
| 10 | #ifndef cmpxchg64_relaxed | ||
| 11 | # define cmpxchg64_relaxed cmpxchg64 | ||
| 12 | #endif | ||
| 13 | |||
| 14 | /* | ||
| 7 | * Note that the "cmpxchg()" reloads the "old" value for the | 15 | * Note that the "cmpxchg()" reloads the "old" value for the |
| 8 | * failure case. | 16 | * failure case. |
| 9 | */ | 17 | */ |
| @@ -14,8 +22,9 @@ | |||
| 14 | while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) { \ | 22 | while (likely(arch_spin_value_unlocked(old.lock.rlock.raw_lock))) { \ |
| 15 | struct lockref new = old, prev = old; \ | 23 | struct lockref new = old, prev = old; \ |
| 16 | CODE \ | 24 | CODE \ |
| 17 | old.lock_count = cmpxchg64(&lockref->lock_count, \ | 25 | old.lock_count = cmpxchg64_relaxed(&lockref->lock_count, \ |
| 18 | old.lock_count, new.lock_count); \ | 26 | old.lock_count, \ |
| 27 | new.lock_count); \ | ||
| 19 | if (likely(old.lock_count == prev.lock_count)) { \ | 28 | if (likely(old.lock_count == prev.lock_count)) { \ |
| 20 | SUCCESS; \ | 29 | SUCCESS; \ |
| 21 | } \ | 30 | } \ |
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index 98969541cbcc..bea523a5d852 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c | |||
| @@ -139,6 +139,18 @@ static int snd_compr_open(struct inode *inode, struct file *f) | |||
| 139 | static int snd_compr_free(struct inode *inode, struct file *f) | 139 | static int snd_compr_free(struct inode *inode, struct file *f) |
| 140 | { | 140 | { |
| 141 | struct snd_compr_file *data = f->private_data; | 141 | struct snd_compr_file *data = f->private_data; |
| 142 | struct snd_compr_runtime *runtime = data->stream.runtime; | ||
| 143 | |||
| 144 | switch (runtime->state) { | ||
| 145 | case SNDRV_PCM_STATE_RUNNING: | ||
| 146 | case SNDRV_PCM_STATE_DRAINING: | ||
| 147 | case SNDRV_PCM_STATE_PAUSED: | ||
| 148 | data->stream.ops->trigger(&data->stream, SNDRV_PCM_TRIGGER_STOP); | ||
| 149 | break; | ||
| 150 | default: | ||
| 151 | break; | ||
| 152 | } | ||
| 153 | |||
| 142 | data->stream.ops->free(&data->stream); | 154 | data->stream.ops->free(&data->stream); |
| 143 | kfree(data->stream.runtime->buffer); | 155 | kfree(data->stream.runtime->buffer); |
| 144 | kfree(data->stream.runtime); | 156 | kfree(data->stream.runtime); |
| @@ -837,7 +849,8 @@ static int snd_compress_dev_disconnect(struct snd_device *device) | |||
| 837 | struct snd_compr *compr; | 849 | struct snd_compr *compr; |
| 838 | 850 | ||
| 839 | compr = device->device_data; | 851 | compr = device->device_data; |
| 840 | snd_unregister_device(compr->direction, compr->card, compr->device); | 852 | snd_unregister_device(SNDRV_DEVICE_TYPE_COMPRESS, compr->card, |
| 853 | compr->device); | ||
| 841 | return 0; | 854 | return 0; |
| 842 | } | 855 | } |
| 843 | 856 | ||
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index b524f89a1f13..18d972501585 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
| @@ -111,6 +111,9 @@ enum { | |||
| 111 | /* 0x0009 - 0x0014 -> 12 test regs */ | 111 | /* 0x0009 - 0x0014 -> 12 test regs */ |
| 112 | /* 0x0015 - visibility reg */ | 112 | /* 0x0015 - visibility reg */ |
| 113 | 113 | ||
| 114 | /* Cirrus Logic CS4208 */ | ||
| 115 | #define CS4208_VENDOR_NID 0x24 | ||
| 116 | |||
| 114 | /* | 117 | /* |
| 115 | * Cirrus Logic CS4210 | 118 | * Cirrus Logic CS4210 |
| 116 | * | 119 | * |
| @@ -223,6 +226,16 @@ static const struct hda_verb cs_coef_init_verbs[] = { | |||
| 223 | {} /* terminator */ | 226 | {} /* terminator */ |
| 224 | }; | 227 | }; |
| 225 | 228 | ||
| 229 | static const struct hda_verb cs4208_coef_init_verbs[] = { | ||
| 230 | {0x01, AC_VERB_SET_POWER_STATE, 0x00}, /* AFG: D0 */ | ||
| 231 | {0x24, AC_VERB_SET_PROC_STATE, 0x01}, /* VPW: processing on */ | ||
| 232 | {0x24, AC_VERB_SET_COEF_INDEX, 0x0033}, | ||
| 233 | {0x24, AC_VERB_SET_PROC_COEF, 0x0001}, /* A1 ICS */ | ||
| 234 | {0x24, AC_VERB_SET_COEF_INDEX, 0x0034}, | ||
| 235 | {0x24, AC_VERB_SET_PROC_COEF, 0x1C01}, /* A1 Enable, A Thresh = 300mV */ | ||
| 236 | {} /* terminator */ | ||
| 237 | }; | ||
| 238 | |||
| 226 | /* Errata: CS4207 rev C0/C1/C2 Silicon | 239 | /* Errata: CS4207 rev C0/C1/C2 Silicon |
| 227 | * | 240 | * |
| 228 | * http://www.cirrus.com/en/pubs/errata/ER880C3.pdf | 241 | * http://www.cirrus.com/en/pubs/errata/ER880C3.pdf |
| @@ -295,6 +308,8 @@ static int cs_init(struct hda_codec *codec) | |||
| 295 | /* init_verb sequence for C0/C1/C2 errata*/ | 308 | /* init_verb sequence for C0/C1/C2 errata*/ |
| 296 | snd_hda_sequence_write(codec, cs_errata_init_verbs); | 309 | snd_hda_sequence_write(codec, cs_errata_init_verbs); |
| 297 | snd_hda_sequence_write(codec, cs_coef_init_verbs); | 310 | snd_hda_sequence_write(codec, cs_coef_init_verbs); |
| 311 | } else if (spec->vendor_nid == CS4208_VENDOR_NID) { | ||
| 312 | snd_hda_sequence_write(codec, cs4208_coef_init_verbs); | ||
| 298 | } | 313 | } |
| 299 | 314 | ||
| 300 | snd_hda_gen_init(codec); | 315 | snd_hda_gen_init(codec); |
| @@ -434,6 +449,29 @@ static const struct hda_pintbl mba42_pincfgs[] = { | |||
| 434 | {} /* terminator */ | 449 | {} /* terminator */ |
| 435 | }; | 450 | }; |
| 436 | 451 | ||
| 452 | static const struct hda_pintbl mba6_pincfgs[] = { | ||
| 453 | { 0x10, 0x032120f0 }, /* HP */ | ||
| 454 | { 0x11, 0x500000f0 }, | ||
| 455 | { 0x12, 0x90100010 }, /* Speaker */ | ||
| 456 | { 0x13, 0x500000f0 }, | ||
| 457 | { 0x14, 0x500000f0 }, | ||
| 458 | { 0x15, 0x770000f0 }, | ||
| 459 | { 0x16, 0x770000f0 }, | ||
| 460 | { 0x17, 0x430000f0 }, | ||
| 461 | { 0x18, 0x43ab9030 }, /* Mic */ | ||
| 462 | { 0x19, 0x770000f0 }, | ||
| 463 | { 0x1a, 0x770000f0 }, | ||
| 464 | { 0x1b, 0x770000f0 }, | ||
| 465 | { 0x1c, 0x90a00090 }, | ||
| 466 | { 0x1d, 0x500000f0 }, | ||
| 467 | { 0x1e, 0x500000f0 }, | ||
| 468 | { 0x1f, 0x500000f0 }, | ||
| 469 | { 0x20, 0x500000f0 }, | ||
| 470 | { 0x21, 0x430000f0 }, | ||
| 471 | { 0x22, 0x430000f0 }, | ||
| 472 | {} /* terminator */ | ||
| 473 | }; | ||
| 474 | |||
| 437 | static void cs420x_fixup_gpio_13(struct hda_codec *codec, | 475 | static void cs420x_fixup_gpio_13(struct hda_codec *codec, |
| 438 | const struct hda_fixup *fix, int action) | 476 | const struct hda_fixup *fix, int action) |
| 439 | { | 477 | { |
| @@ -556,22 +594,23 @@ static int patch_cs420x(struct hda_codec *codec) | |||
| 556 | 594 | ||
| 557 | /* | 595 | /* |
| 558 | * CS4208 support: | 596 | * CS4208 support: |
| 559 | * Its layout is no longer compatible with CS4206/CS4207, and the generic | 597 | * Its layout is no longer compatible with CS4206/CS4207 |
| 560 | * parser seems working fairly well, except for trivial fixups. | ||
| 561 | */ | 598 | */ |
| 562 | enum { | 599 | enum { |
| 600 | CS4208_MBA6, | ||
| 563 | CS4208_GPIO0, | 601 | CS4208_GPIO0, |
| 564 | }; | 602 | }; |
| 565 | 603 | ||
| 566 | static const struct hda_model_fixup cs4208_models[] = { | 604 | static const struct hda_model_fixup cs4208_models[] = { |
| 567 | { .id = CS4208_GPIO0, .name = "gpio0" }, | 605 | { .id = CS4208_GPIO0, .name = "gpio0" }, |
| 606 | { .id = CS4208_MBA6, .name = "mba6" }, | ||
| 568 | {} | 607 | {} |
| 569 | }; | 608 | }; |
| 570 | 609 | ||
| 571 | static const struct snd_pci_quirk cs4208_fixup_tbl[] = { | 610 | static const struct snd_pci_quirk cs4208_fixup_tbl[] = { |
| 572 | /* codec SSID */ | 611 | /* codec SSID */ |
| 573 | SND_PCI_QUIRK(0x106b, 0x7100, "MacBookPro 6,1", CS4208_GPIO0), | 612 | SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), |
| 574 | SND_PCI_QUIRK(0x106b, 0x7200, "MacBookPro 6,2", CS4208_GPIO0), | 613 | SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), |
| 575 | {} /* terminator */ | 614 | {} /* terminator */ |
| 576 | }; | 615 | }; |
| 577 | 616 | ||
| @@ -588,18 +627,35 @@ static void cs4208_fixup_gpio0(struct hda_codec *codec, | |||
| 588 | } | 627 | } |
| 589 | 628 | ||
| 590 | static const struct hda_fixup cs4208_fixups[] = { | 629 | static const struct hda_fixup cs4208_fixups[] = { |
| 630 | [CS4208_MBA6] = { | ||
| 631 | .type = HDA_FIXUP_PINS, | ||
| 632 | .v.pins = mba6_pincfgs, | ||
| 633 | .chained = true, | ||
| 634 | .chain_id = CS4208_GPIO0, | ||
| 635 | }, | ||
| 591 | [CS4208_GPIO0] = { | 636 | [CS4208_GPIO0] = { |
| 592 | .type = HDA_FIXUP_FUNC, | 637 | .type = HDA_FIXUP_FUNC, |
| 593 | .v.func = cs4208_fixup_gpio0, | 638 | .v.func = cs4208_fixup_gpio0, |
| 594 | }, | 639 | }, |
| 595 | }; | 640 | }; |
| 596 | 641 | ||
| 642 | /* correct the 0dB offset of input pins */ | ||
| 643 | static void cs4208_fix_amp_caps(struct hda_codec *codec, hda_nid_t adc) | ||
| 644 | { | ||
| 645 | unsigned int caps; | ||
| 646 | |||
| 647 | caps = query_amp_caps(codec, adc, HDA_INPUT); | ||
| 648 | caps &= ~(AC_AMPCAP_OFFSET); | ||
| 649 | caps |= 0x02; | ||
| 650 | snd_hda_override_amp_caps(codec, adc, HDA_INPUT, caps); | ||
| 651 | } | ||
| 652 | |||
| 597 | static int patch_cs4208(struct hda_codec *codec) | 653 | static int patch_cs4208(struct hda_codec *codec) |
| 598 | { | 654 | { |
| 599 | struct cs_spec *spec; | 655 | struct cs_spec *spec; |
| 600 | int err; | 656 | int err; |
| 601 | 657 | ||
| 602 | spec = cs_alloc_spec(codec, 0); /* no specific w/a */ | 658 | spec = cs_alloc_spec(codec, CS4208_VENDOR_NID); |
| 603 | if (!spec) | 659 | if (!spec) |
| 604 | return -ENOMEM; | 660 | return -ENOMEM; |
| 605 | 661 | ||
| @@ -609,6 +665,12 @@ static int patch_cs4208(struct hda_codec *codec) | |||
| 609 | cs4208_fixups); | 665 | cs4208_fixups); |
| 610 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); | 666 | snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); |
| 611 | 667 | ||
| 668 | snd_hda_override_wcaps(codec, 0x18, | ||
| 669 | get_wcaps(codec, 0x18) | AC_WCAP_STEREO); | ||
| 670 | cs4208_fix_amp_caps(codec, 0x18); | ||
| 671 | cs4208_fix_amp_caps(codec, 0x1b); | ||
| 672 | cs4208_fix_amp_caps(codec, 0x1c); | ||
| 673 | |||
| 612 | err = cs_parse_auto_config(codec); | 674 | err = cs_parse_auto_config(codec); |
| 613 | if (err < 0) | 675 | if (err < 0) |
| 614 | goto error; | 676 | goto error; |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 3d8cd04455a6..7ea0245fc6bd 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -1149,32 +1149,43 @@ static int hdmi_choose_cvt(struct hda_codec *codec, | |||
| 1149 | } | 1149 | } |
| 1150 | 1150 | ||
| 1151 | static void haswell_config_cvts(struct hda_codec *codec, | 1151 | static void haswell_config_cvts(struct hda_codec *codec, |
| 1152 | int pin_id, int mux_id) | 1152 | hda_nid_t pin_nid, int mux_idx) |
| 1153 | { | 1153 | { |
| 1154 | struct hdmi_spec *spec = codec->spec; | 1154 | struct hdmi_spec *spec = codec->spec; |
| 1155 | struct hdmi_spec_per_pin *per_pin; | 1155 | hda_nid_t nid, end_nid; |
| 1156 | int pin_idx, mux_idx; | 1156 | int cvt_idx, curr; |
| 1157 | int curr; | 1157 | struct hdmi_spec_per_cvt *per_cvt; |
| 1158 | int err; | ||
| 1159 | 1158 | ||
| 1160 | for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) { | 1159 | /* configure all pins, including "no physical connection" ones */ |
| 1161 | per_pin = get_pin(spec, pin_idx); | 1160 | end_nid = codec->start_nid + codec->num_nodes; |
| 1161 | for (nid = codec->start_nid; nid < end_nid; nid++) { | ||
| 1162 | unsigned int wid_caps = get_wcaps(codec, nid); | ||
| 1163 | unsigned int wid_type = get_wcaps_type(wid_caps); | ||
| 1162 | 1164 | ||
| 1163 | if (pin_idx == pin_id) | 1165 | if (wid_type != AC_WID_PIN) |
| 1164 | continue; | 1166 | continue; |
| 1165 | 1167 | ||
| 1166 | curr = snd_hda_codec_read(codec, per_pin->pin_nid, 0, | 1168 | if (nid == pin_nid) |
| 1169 | continue; | ||
| 1170 | |||
| 1171 | curr = snd_hda_codec_read(codec, nid, 0, | ||
| 1167 | AC_VERB_GET_CONNECT_SEL, 0); | 1172 | AC_VERB_GET_CONNECT_SEL, 0); |
| 1173 | if (curr != mux_idx) | ||
| 1174 | continue; | ||
| 1168 | 1175 | ||
| 1169 | /* Choose another unused converter */ | 1176 | /* choose an unassigned converter. The conveters in the |
| 1170 | if (curr == mux_id) { | 1177 | * connection list are in the same order as in the codec. |
| 1171 | err = hdmi_choose_cvt(codec, pin_idx, NULL, &mux_idx); | 1178 | */ |
| 1172 | if (err < 0) | 1179 | for (cvt_idx = 0; cvt_idx < spec->num_cvts; cvt_idx++) { |
| 1173 | return; | 1180 | per_cvt = get_cvt(spec, cvt_idx); |
| 1174 | snd_printdd("HDMI: choose converter %d for pin %d\n", mux_idx, pin_idx); | 1181 | if (!per_cvt->assigned) { |
| 1175 | snd_hda_codec_write_cache(codec, per_pin->pin_nid, 0, | 1182 | snd_printdd("choose cvt %d for pin nid %d\n", |
| 1183 | cvt_idx, nid); | ||
| 1184 | snd_hda_codec_write_cache(codec, nid, 0, | ||
| 1176 | AC_VERB_SET_CONNECT_SEL, | 1185 | AC_VERB_SET_CONNECT_SEL, |
| 1177 | mux_idx); | 1186 | cvt_idx); |
| 1187 | break; | ||
| 1188 | } | ||
| 1178 | } | 1189 | } |
| 1179 | } | 1190 | } |
| 1180 | } | 1191 | } |
| @@ -1216,7 +1227,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | |||
| 1216 | 1227 | ||
| 1217 | /* configure unused pins to choose other converters */ | 1228 | /* configure unused pins to choose other converters */ |
| 1218 | if (is_haswell(codec)) | 1229 | if (is_haswell(codec)) |
| 1219 | haswell_config_cvts(codec, pin_idx, mux_idx); | 1230 | haswell_config_cvts(codec, per_pin->pin_nid, mux_idx); |
| 1220 | 1231 | ||
| 1221 | snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); | 1232 | snd_hda_spdif_ctls_assign(codec, pin_idx, per_cvt->cvt_nid); |
| 1222 | 1233 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index bc07d369fac4..0e303b99a47c 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -3439,6 +3439,9 @@ static void alc283_fixup_chromebook(struct hda_codec *codec, | |||
| 3439 | /* Set to manual mode */ | 3439 | /* Set to manual mode */ |
| 3440 | val = alc_read_coef_idx(codec, 0x06); | 3440 | val = alc_read_coef_idx(codec, 0x06); |
| 3441 | alc_write_coef_idx(codec, 0x06, val & ~0x000c); | 3441 | alc_write_coef_idx(codec, 0x06, val & ~0x000c); |
| 3442 | /* Enable Line1 input control by verb */ | ||
| 3443 | val = alc_read_coef_idx(codec, 0x1a); | ||
| 3444 | alc_write_coef_idx(codec, 0x1a, val | (1 << 4)); | ||
| 3442 | break; | 3445 | break; |
| 3443 | } | 3446 | } |
| 3444 | } | 3447 | } |
| @@ -3531,6 +3534,7 @@ enum { | |||
| 3531 | ALC269VB_FIXUP_ORDISSIMO_EVE2, | 3534 | ALC269VB_FIXUP_ORDISSIMO_EVE2, |
| 3532 | ALC283_FIXUP_CHROME_BOOK, | 3535 | ALC283_FIXUP_CHROME_BOOK, |
| 3533 | ALC282_FIXUP_ASUS_TX300, | 3536 | ALC282_FIXUP_ASUS_TX300, |
| 3537 | ALC283_FIXUP_INT_MIC, | ||
| 3534 | }; | 3538 | }; |
| 3535 | 3539 | ||
| 3536 | static const struct hda_fixup alc269_fixups[] = { | 3540 | static const struct hda_fixup alc269_fixups[] = { |
| @@ -3790,6 +3794,16 @@ static const struct hda_fixup alc269_fixups[] = { | |||
| 3790 | .type = HDA_FIXUP_FUNC, | 3794 | .type = HDA_FIXUP_FUNC, |
| 3791 | .v.func = alc282_fixup_asus_tx300, | 3795 | .v.func = alc282_fixup_asus_tx300, |
| 3792 | }, | 3796 | }, |
| 3797 | [ALC283_FIXUP_INT_MIC] = { | ||
| 3798 | .type = HDA_FIXUP_VERBS, | ||
| 3799 | .v.verbs = (const struct hda_verb[]) { | ||
| 3800 | {0x20, AC_VERB_SET_COEF_INDEX, 0x1a}, | ||
| 3801 | {0x20, AC_VERB_SET_PROC_COEF, 0x0011}, | ||
| 3802 | { } | ||
| 3803 | }, | ||
| 3804 | .chained = true, | ||
| 3805 | .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST | ||
| 3806 | }, | ||
| 3793 | }; | 3807 | }; |
| 3794 | 3808 | ||
| 3795 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 3809 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
| @@ -3874,7 +3888,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
| 3874 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3888 | SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 3875 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3889 | SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 3876 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3890 | SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 3877 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3891 | SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), |
| 3878 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3892 | SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 3879 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 3893 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
| 3880 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), | 3894 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
