diff options
Diffstat (limited to 'drivers')
30 files changed, 290 insertions, 213 deletions
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index 2b464b631f22..0b0625054a87 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
@@ -392,7 +392,10 @@ static int atmtcp_attach(struct atm_vcc *vcc,int itf) | |||
392 | atm_dev_put(dev); | 392 | atm_dev_put(dev); |
393 | return -EMEDIUMTYPE; | 393 | return -EMEDIUMTYPE; |
394 | } | 394 | } |
395 | if (PRIV(dev)->vcc) return -EBUSY; | 395 | if (PRIV(dev)->vcc) { |
396 | atm_dev_put(dev); | ||
397 | return -EBUSY; | ||
398 | } | ||
396 | } | 399 | } |
397 | else { | 400 | else { |
398 | int error; | 401 | int error; |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 411d5bf50fc4..a25f5f61e0e0 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -449,7 +449,7 @@ mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan) | |||
449 | static void mv_xor_tasklet(unsigned long data) | 449 | static void mv_xor_tasklet(unsigned long data) |
450 | { | 450 | { |
451 | struct mv_xor_chan *chan = (struct mv_xor_chan *) data; | 451 | struct mv_xor_chan *chan = (struct mv_xor_chan *) data; |
452 | __mv_xor_slot_cleanup(chan); | 452 | mv_xor_slot_cleanup(chan); |
453 | } | 453 | } |
454 | 454 | ||
455 | static struct mv_xor_desc_slot * | 455 | static struct mv_xor_desc_slot * |
diff --git a/drivers/gpu/drm/i915/dvo_ch7017.c b/drivers/gpu/drm/i915/dvo_ch7017.c index af70337567ce..d3e8c540f778 100644 --- a/drivers/gpu/drm/i915/dvo_ch7017.c +++ b/drivers/gpu/drm/i915/dvo_ch7017.c | |||
@@ -242,7 +242,7 @@ fail: | |||
242 | 242 | ||
243 | static enum drm_connector_status ch7017_detect(struct intel_dvo_device *dvo) | 243 | static enum drm_connector_status ch7017_detect(struct intel_dvo_device *dvo) |
244 | { | 244 | { |
245 | return connector_status_unknown; | 245 | return connector_status_connected; |
246 | } | 246 | } |
247 | 247 | ||
248 | static enum drm_mode_status ch7017_mode_valid(struct intel_dvo_device *dvo, | 248 | static enum drm_mode_status ch7017_mode_valid(struct intel_dvo_device *dvo, |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index e6800819bca8..cb900dc83d95 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "i915_drm.h" | 34 | #include "i915_drm.h" |
35 | #include "i915_drv.h" | 35 | #include "i915_drv.h" |
36 | #include "i915_trace.h" | 36 | #include "i915_trace.h" |
37 | #include "../../../platform/x86/intel_ips.h" | ||
37 | #include <linux/pci.h> | 38 | #include <linux/pci.h> |
38 | #include <linux/vgaarb.h> | 39 | #include <linux/vgaarb.h> |
39 | #include <linux/acpi.h> | 40 | #include <linux/acpi.h> |
@@ -1871,6 +1872,26 @@ out_unlock: | |||
1871 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); | 1872 | EXPORT_SYMBOL_GPL(i915_gpu_turbo_disable); |
1872 | 1873 | ||
1873 | /** | 1874 | /** |
1875 | * Tells the intel_ips driver that the i915 driver is now loaded, if | ||
1876 | * IPS got loaded first. | ||
1877 | * | ||
1878 | * This awkward dance is so that neither module has to depend on the | ||
1879 | * other in order for IPS to do the appropriate communication of | ||
1880 | * GPU turbo limits to i915. | ||
1881 | */ | ||
1882 | static void | ||
1883 | ips_ping_for_i915_load(void) | ||
1884 | { | ||
1885 | void (*link)(void); | ||
1886 | |||
1887 | link = symbol_get(ips_link_to_i915_driver); | ||
1888 | if (link) { | ||
1889 | link(); | ||
1890 | symbol_put(ips_link_to_i915_driver); | ||
1891 | } | ||
1892 | } | ||
1893 | |||
1894 | /** | ||
1874 | * i915_driver_load - setup chip and create an initial config | 1895 | * i915_driver_load - setup chip and create an initial config |
1875 | * @dev: DRM device | 1896 | * @dev: DRM device |
1876 | * @flags: startup flags | 1897 | * @flags: startup flags |
@@ -2075,6 +2096,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
2075 | dev_priv->mchdev_lock = &mchdev_lock; | 2096 | dev_priv->mchdev_lock = &mchdev_lock; |
2076 | spin_unlock(&mchdev_lock); | 2097 | spin_unlock(&mchdev_lock); |
2077 | 2098 | ||
2099 | ips_ping_for_i915_load(); | ||
2100 | |||
2078 | return 0; | 2101 | return 0; |
2079 | 2102 | ||
2080 | out_workqueue_free: | 2103 | out_workqueue_free: |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 878fc766a12c..cb8f43429279 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2471,6 +2471,9 @@ | |||
2471 | # define MARIUNIT_CLOCK_GATE_DISABLE (1 << 18) | 2471 | # define MARIUNIT_CLOCK_GATE_DISABLE (1 << 18) |
2472 | # define SVSMUNIT_CLOCK_GATE_DISABLE (1 << 1) | 2472 | # define SVSMUNIT_CLOCK_GATE_DISABLE (1 << 1) |
2473 | 2473 | ||
2474 | #define PCH_3DCGDIS1 0x46024 | ||
2475 | # define VFMUNIT_CLOCK_GATE_DISABLE (1 << 11) | ||
2476 | |||
2474 | #define FDI_PLL_FREQ_CTL 0x46030 | 2477 | #define FDI_PLL_FREQ_CTL 0x46030 |
2475 | #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24) | 2478 | #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24) |
2476 | #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00 | 2479 | #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00 |
@@ -2588,6 +2591,13 @@ | |||
2588 | #define ILK_DISPLAY_CHICKEN2 0x42004 | 2591 | #define ILK_DISPLAY_CHICKEN2 0x42004 |
2589 | #define ILK_DPARB_GATE (1<<22) | 2592 | #define ILK_DPARB_GATE (1<<22) |
2590 | #define ILK_VSDPFD_FULL (1<<21) | 2593 | #define ILK_VSDPFD_FULL (1<<21) |
2594 | #define ILK_DISPLAY_CHICKEN_FUSES 0x42014 | ||
2595 | #define ILK_INTERNAL_GRAPHICS_DISABLE (1<<31) | ||
2596 | #define ILK_INTERNAL_DISPLAY_DISABLE (1<<30) | ||
2597 | #define ILK_DISPLAY_DEBUG_DISABLE (1<<29) | ||
2598 | #define ILK_HDCP_DISABLE (1<<25) | ||
2599 | #define ILK_eDP_A_DISABLE (1<<24) | ||
2600 | #define ILK_DESKTOP (1<<23) | ||
2591 | #define ILK_DSPCLK_GATE 0x42020 | 2601 | #define ILK_DSPCLK_GATE 0x42020 |
2592 | #define ILK_DPARB_CLK_GATE (1<<5) | 2602 | #define ILK_DPARB_CLK_GATE (1<<5) |
2593 | /* According to spec this bit 7/8/9 of 0x42020 should be set to enable FBC */ | 2603 | /* According to spec this bit 7/8/9 of 0x42020 should be set to enable FBC */ |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 2b2078695d2a..b0b1200ed650 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -270,7 +270,7 @@ parse_general_features(struct drm_i915_private *dev_priv, | |||
270 | general->ssc_freq ? 66 : 48; | 270 | general->ssc_freq ? 66 : 48; |
271 | else if (IS_GEN5(dev) || IS_GEN6(dev)) | 271 | else if (IS_GEN5(dev) || IS_GEN6(dev)) |
272 | dev_priv->lvds_ssc_freq = | 272 | dev_priv->lvds_ssc_freq = |
273 | general->ssc_freq ? 120 : 100; | 273 | general->ssc_freq ? 100 : 120; |
274 | else | 274 | else |
275 | dev_priv->lvds_ssc_freq = | 275 | dev_priv->lvds_ssc_freq = |
276 | general->ssc_freq ? 100 : 96; | 276 | general->ssc_freq ? 100 : 96; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d9b7092439ef..fca523288aca 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5379,6 +5379,23 @@ static int intel_encoder_clones(struct drm_device *dev, int type_mask) | |||
5379 | return index_mask; | 5379 | return index_mask; |
5380 | } | 5380 | } |
5381 | 5381 | ||
5382 | static bool has_edp_a(struct drm_device *dev) | ||
5383 | { | ||
5384 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
5385 | |||
5386 | if (!IS_MOBILE(dev)) | ||
5387 | return false; | ||
5388 | |||
5389 | if ((I915_READ(DP_A) & DP_DETECTED) == 0) | ||
5390 | return false; | ||
5391 | |||
5392 | if (IS_GEN5(dev) && | ||
5393 | (I915_READ(ILK_DISPLAY_CHICKEN_FUSES) & ILK_eDP_A_DISABLE)) | ||
5394 | return false; | ||
5395 | |||
5396 | return true; | ||
5397 | } | ||
5398 | |||
5382 | static void intel_setup_outputs(struct drm_device *dev) | 5399 | static void intel_setup_outputs(struct drm_device *dev) |
5383 | { | 5400 | { |
5384 | struct drm_i915_private *dev_priv = dev->dev_private; | 5401 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -5396,7 +5413,7 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
5396 | if (HAS_PCH_SPLIT(dev)) { | 5413 | if (HAS_PCH_SPLIT(dev)) { |
5397 | dpd_is_edp = intel_dpd_is_edp(dev); | 5414 | dpd_is_edp = intel_dpd_is_edp(dev); |
5398 | 5415 | ||
5399 | if (IS_MOBILE(dev) && (I915_READ(DP_A) & DP_DETECTED)) | 5416 | if (has_edp_a(dev)) |
5400 | intel_dp_init(dev, DP_A); | 5417 | intel_dp_init(dev, DP_A); |
5401 | 5418 | ||
5402 | if (dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED)) | 5419 | if (dpd_is_edp && (I915_READ(PCH_DP_D) & DP_DETECTED)) |
@@ -5825,6 +5842,8 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
5825 | I915_WRITE(PCH_3DCGDIS0, | 5842 | I915_WRITE(PCH_3DCGDIS0, |
5826 | MARIUNIT_CLOCK_GATE_DISABLE | | 5843 | MARIUNIT_CLOCK_GATE_DISABLE | |
5827 | SVSMUNIT_CLOCK_GATE_DISABLE); | 5844 | SVSMUNIT_CLOCK_GATE_DISABLE); |
5845 | I915_WRITE(PCH_3DCGDIS1, | ||
5846 | VFMUNIT_CLOCK_GATE_DISABLE); | ||
5828 | } | 5847 | } |
5829 | 5848 | ||
5830 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | 5849 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 27e63abf2a73..6bc42fa2a6ec 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -2040,13 +2040,14 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
2040 | SDVO_COLORIMETRY_RGB256); | 2040 | SDVO_COLORIMETRY_RGB256); |
2041 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; | 2041 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; |
2042 | 2042 | ||
2043 | intel_sdvo_add_hdmi_properties(intel_sdvo_connector); | ||
2044 | intel_sdvo->is_hdmi = true; | 2043 | intel_sdvo->is_hdmi = true; |
2045 | } | 2044 | } |
2046 | intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | | 2045 | intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | |
2047 | (1 << INTEL_ANALOG_CLONE_BIT)); | 2046 | (1 << INTEL_ANALOG_CLONE_BIT)); |
2048 | 2047 | ||
2049 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); | 2048 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); |
2049 | if (intel_sdvo->is_hdmi) | ||
2050 | intel_sdvo_add_hdmi_properties(intel_sdvo_connector); | ||
2050 | 2051 | ||
2051 | return true; | 2052 | return true; |
2052 | } | 2053 | } |
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c index 05248f2d7581..92b42db43bcf 100644 --- a/drivers/hwmon/s3c-hwmon.c +++ b/drivers/hwmon/s3c-hwmon.c | |||
@@ -234,7 +234,6 @@ static int s3c_hwmon_create_attr(struct device *dev, | |||
234 | attr->index = channel; | 234 | attr->index = channel; |
235 | attr->dev_attr.attr.name = attrs->in_name; | 235 | attr->dev_attr.attr.name = attrs->in_name; |
236 | attr->dev_attr.attr.mode = S_IRUGO; | 236 | attr->dev_attr.attr.mode = S_IRUGO; |
237 | attr->dev_attr.attr.owner = THIS_MODULE; | ||
238 | attr->dev_attr.show = s3c_hwmon_ch_show; | 237 | attr->dev_attr.show = s3c_hwmon_ch_show; |
239 | 238 | ||
240 | ret = device_create_file(dev, &attr->dev_attr); | 239 | ret = device_create_file(dev, &attr->dev_attr); |
@@ -252,7 +251,6 @@ static int s3c_hwmon_create_attr(struct device *dev, | |||
252 | attr->index = channel; | 251 | attr->index = channel; |
253 | attr->dev_attr.attr.name = attrs->label_name; | 252 | attr->dev_attr.attr.name = attrs->label_name; |
254 | attr->dev_attr.attr.mode = S_IRUGO; | 253 | attr->dev_attr.attr.mode = S_IRUGO; |
255 | attr->dev_attr.attr.owner = THIS_MODULE; | ||
256 | attr->dev_attr.show = s3c_hwmon_label_show; | 254 | attr->dev_attr.show = s3c_hwmon_label_show; |
257 | 255 | ||
258 | ret = device_create_file(dev, &attr->dev_attr); | 256 | ret = device_create_file(dev, &attr->dev_attr); |
diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c index bcc174e4f3b1..658e75f18d05 100644 --- a/drivers/isdn/gigaset/capi.c +++ b/drivers/isdn/gigaset/capi.c | |||
@@ -1900,6 +1900,7 @@ static void do_disconnect_req(struct gigaset_capi_ctr *iif, | |||
1900 | if (b3skb == NULL) { | 1900 | if (b3skb == NULL) { |
1901 | dev_err(cs->dev, "%s: out of memory\n", __func__); | 1901 | dev_err(cs->dev, "%s: out of memory\n", __func__); |
1902 | send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); | 1902 | send_conf(iif, ap, skb, CAPI_MSGOSRESOURCEERR); |
1903 | kfree(b3cmsg); | ||
1903 | return; | 1904 | return; |
1904 | } | 1905 | } |
1905 | capi_cmsg2message(b3cmsg, | 1906 | capi_cmsg2message(b3cmsg, |
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index dfb198d0415b..f16461844c5c 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -1989,8 +1989,23 @@ static int cx25840_probe(struct i2c_client *client, | |||
1989 | v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops, | 1989 | v4l2_ctrl_new_std(&state->hdl, &cx25840_ctrl_ops, |
1990 | V4L2_CID_HUE, -128, 127, 1, 0); | 1990 | V4L2_CID_HUE, -128, 127, 1, 0); |
1991 | if (!is_cx2583x(state)) { | 1991 | if (!is_cx2583x(state)) { |
1992 | default_volume = 228 - cx25840_read(client, 0x8d4); | 1992 | default_volume = cx25840_read(client, 0x8d4); |
1993 | default_volume = ((default_volume / 2) + 23) << 9; | 1993 | /* |
1994 | * Enforce the legacy PVR-350/MSP3400 to PVR-150/CX25843 volume | ||
1995 | * scale mapping limits to avoid -ERANGE errors when | ||
1996 | * initializing the volume control | ||
1997 | */ | ||
1998 | if (default_volume > 228) { | ||
1999 | /* Bottom out at -96 dB, v4l2 vol range 0x2e00-0x2fff */ | ||
2000 | default_volume = 228; | ||
2001 | cx25840_write(client, 0x8d4, 228); | ||
2002 | } | ||
2003 | else if (default_volume < 20) { | ||
2004 | /* Top out at + 8 dB, v4l2 vol range 0xfe00-0xffff */ | ||
2005 | default_volume = 20; | ||
2006 | cx25840_write(client, 0x8d4, 20); | ||
2007 | } | ||
2008 | default_volume = (((228 - default_volume) >> 1) + 23) << 9; | ||
1994 | 2009 | ||
1995 | state->volume = v4l2_ctrl_new_std(&state->hdl, | 2010 | state->volume = v4l2_ctrl_new_std(&state->hdl, |
1996 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME, | 2011 | &cx25840_audio_ctrl_ops, V4L2_CID_AUDIO_VOLUME, |
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c index 4aaa47c0eabf..54b7fcd469a8 100644 --- a/drivers/media/video/cx88/cx88-alsa.c +++ b/drivers/media/video/cx88/cx88-alsa.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <sound/control.h> | 40 | #include <sound/control.h> |
41 | #include <sound/initval.h> | 41 | #include <sound/initval.h> |
42 | #include <sound/tlv.h> | 42 | #include <sound/tlv.h> |
43 | #include <media/wm8775.h> | ||
44 | 43 | ||
45 | #include "cx88.h" | 44 | #include "cx88.h" |
46 | #include "cx88-reg.h" | 45 | #include "cx88-reg.h" |
@@ -587,47 +586,26 @@ static int snd_cx88_volume_put(struct snd_kcontrol *kcontrol, | |||
587 | int left, right, v, b; | 586 | int left, right, v, b; |
588 | int changed = 0; | 587 | int changed = 0; |
589 | u32 old; | 588 | u32 old; |
590 | struct v4l2_control client_ctl; | ||
591 | |||
592 | /* Pass volume & balance onto any WM8775 */ | ||
593 | if (value->value.integer.value[0] >= value->value.integer.value[1]) { | ||
594 | v = value->value.integer.value[0] << 10; | ||
595 | b = value->value.integer.value[0] ? | ||
596 | (0x8000 * value->value.integer.value[1]) / value->value.integer.value[0] : | ||
597 | 0x8000; | ||
598 | } else { | ||
599 | v = value->value.integer.value[1] << 10; | ||
600 | b = value->value.integer.value[1] ? | ||
601 | 0xffff - (0x8000 * value->value.integer.value[0]) / value->value.integer.value[1] : | ||
602 | 0x8000; | ||
603 | } | ||
604 | client_ctl.value = v; | ||
605 | client_ctl.id = V4L2_CID_AUDIO_VOLUME; | ||
606 | call_hw(core, WM8775_GID, core, s_ctrl, &client_ctl); | ||
607 | |||
608 | client_ctl.value = b; | ||
609 | client_ctl.id = V4L2_CID_AUDIO_BALANCE; | ||
610 | call_hw(core, WM8775_GID, core, s_ctrl, &client_ctl); | ||
611 | 589 | ||
612 | left = value->value.integer.value[0] & 0x3f; | 590 | left = value->value.integer.value[0] & 0x3f; |
613 | right = value->value.integer.value[1] & 0x3f; | 591 | right = value->value.integer.value[1] & 0x3f; |
614 | b = right - left; | 592 | b = right - left; |
615 | if (b < 0) { | 593 | if (b < 0) { |
616 | v = 0x3f - left; | 594 | v = 0x3f - left; |
617 | b = (-b) | 0x40; | 595 | b = (-b) | 0x40; |
618 | } else { | 596 | } else { |
619 | v = 0x3f - right; | 597 | v = 0x3f - right; |
620 | } | 598 | } |
621 | /* Do we really know this will always be called with IRQs on? */ | 599 | /* Do we really know this will always be called with IRQs on? */ |
622 | spin_lock_irq(&chip->reg_lock); | 600 | spin_lock_irq(&chip->reg_lock); |
623 | old = cx_read(AUD_VOL_CTL); | 601 | old = cx_read(AUD_VOL_CTL); |
624 | if (v != (old & 0x3f)) { | 602 | if (v != (old & 0x3f)) { |
625 | cx_swrite(SHADOW_AUD_VOL_CTL, AUD_VOL_CTL, (old & ~0x3f) | v); | 603 | cx_write(AUD_VOL_CTL, (old & ~0x3f) | v); |
626 | changed = 1; | 604 | changed = 1; |
627 | } | 605 | } |
628 | if ((cx_read(AUD_BAL_CTL) & 0x7f) != b) { | 606 | if (cx_read(AUD_BAL_CTL) != b) { |
629 | cx_write(AUD_BAL_CTL, b); | 607 | cx_write(AUD_BAL_CTL, b); |
630 | changed = 1; | 608 | changed = 1; |
631 | } | 609 | } |
632 | spin_unlock_irq(&chip->reg_lock); | 610 | spin_unlock_irq(&chip->reg_lock); |
633 | 611 | ||
@@ -640,7 +618,7 @@ static const struct snd_kcontrol_new snd_cx88_volume = { | |||
640 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 618 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
641 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | | 619 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | |
642 | SNDRV_CTL_ELEM_ACCESS_TLV_READ, | 620 | SNDRV_CTL_ELEM_ACCESS_TLV_READ, |
643 | .name = "Analog-TV Volume", | 621 | .name = "Playback Volume", |
644 | .info = snd_cx88_volume_info, | 622 | .info = snd_cx88_volume_info, |
645 | .get = snd_cx88_volume_get, | 623 | .get = snd_cx88_volume_get, |
646 | .put = snd_cx88_volume_put, | 624 | .put = snd_cx88_volume_put, |
@@ -671,14 +649,7 @@ static int snd_cx88_switch_put(struct snd_kcontrol *kcontrol, | |||
671 | vol = cx_read(AUD_VOL_CTL); | 649 | vol = cx_read(AUD_VOL_CTL); |
672 | if (value->value.integer.value[0] != !(vol & bit)) { | 650 | if (value->value.integer.value[0] != !(vol & bit)) { |
673 | vol ^= bit; | 651 | vol ^= bit; |
674 | cx_swrite(SHADOW_AUD_VOL_CTL, AUD_VOL_CTL, vol); | 652 | cx_write(AUD_VOL_CTL, vol); |
675 | /* Pass mute onto any WM8775 */ | ||
676 | if ((1<<6) == bit) { | ||
677 | struct v4l2_control client_ctl; | ||
678 | client_ctl.value = 0 != (vol & bit); | ||
679 | client_ctl.id = V4L2_CID_AUDIO_MUTE; | ||
680 | call_hw(core, WM8775_GID, core, s_ctrl, &client_ctl); | ||
681 | } | ||
682 | ret = 1; | 653 | ret = 1; |
683 | } | 654 | } |
684 | spin_unlock_irq(&chip->reg_lock); | 655 | spin_unlock_irq(&chip->reg_lock); |
@@ -687,7 +658,7 @@ static int snd_cx88_switch_put(struct snd_kcontrol *kcontrol, | |||
687 | 658 | ||
688 | static const struct snd_kcontrol_new snd_cx88_dac_switch = { | 659 | static const struct snd_kcontrol_new snd_cx88_dac_switch = { |
689 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 660 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
690 | .name = "Audio-Out Switch", | 661 | .name = "Playback Switch", |
691 | .info = snd_ctl_boolean_mono_info, | 662 | .info = snd_ctl_boolean_mono_info, |
692 | .get = snd_cx88_switch_get, | 663 | .get = snd_cx88_switch_get, |
693 | .put = snd_cx88_switch_put, | 664 | .put = snd_cx88_switch_put, |
@@ -696,49 +667,13 @@ static const struct snd_kcontrol_new snd_cx88_dac_switch = { | |||
696 | 667 | ||
697 | static const struct snd_kcontrol_new snd_cx88_source_switch = { | 668 | static const struct snd_kcontrol_new snd_cx88_source_switch = { |
698 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 669 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
699 | .name = "Analog-TV Switch", | 670 | .name = "Capture Switch", |
700 | .info = snd_ctl_boolean_mono_info, | 671 | .info = snd_ctl_boolean_mono_info, |
701 | .get = snd_cx88_switch_get, | 672 | .get = snd_cx88_switch_get, |
702 | .put = snd_cx88_switch_put, | 673 | .put = snd_cx88_switch_put, |
703 | .private_value = (1<<6), | 674 | .private_value = (1<<6), |
704 | }; | 675 | }; |
705 | 676 | ||
706 | static int snd_cx88_alc_get(struct snd_kcontrol *kcontrol, | ||
707 | struct snd_ctl_elem_value *value) | ||
708 | { | ||
709 | snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); | ||
710 | struct cx88_core *core = chip->core; | ||
711 | struct v4l2_control client_ctl; | ||
712 | |||
713 | client_ctl.id = V4L2_CID_AUDIO_LOUDNESS; | ||
714 | call_hw(core, WM8775_GID, core, g_ctrl, &client_ctl); | ||
715 | value->value.integer.value[0] = client_ctl.value ? 1 : 0; | ||
716 | |||
717 | return 0; | ||
718 | } | ||
719 | |||
720 | static int snd_cx88_alc_put(struct snd_kcontrol *kcontrol, | ||
721 | struct snd_ctl_elem_value *value) | ||
722 | { | ||
723 | snd_cx88_card_t *chip = snd_kcontrol_chip(kcontrol); | ||
724 | struct cx88_core *core = chip->core; | ||
725 | struct v4l2_control client_ctl; | ||
726 | |||
727 | client_ctl.value = 0 != value->value.integer.value[0]; | ||
728 | client_ctl.id = V4L2_CID_AUDIO_LOUDNESS; | ||
729 | call_hw(core, WM8775_GID, core, s_ctrl, &client_ctl); | ||
730 | |||
731 | return 0; | ||
732 | } | ||
733 | |||
734 | static struct snd_kcontrol_new snd_cx88_alc_switch = { | ||
735 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
736 | .name = "Line-In ALC Switch", | ||
737 | .info = snd_ctl_boolean_mono_info, | ||
738 | .get = snd_cx88_alc_get, | ||
739 | .put = snd_cx88_alc_put, | ||
740 | }; | ||
741 | |||
742 | /**************************************************************************** | 677 | /**************************************************************************** |
743 | Basic Flow for Sound Devices | 678 | Basic Flow for Sound Devices |
744 | ****************************************************************************/ | 679 | ****************************************************************************/ |
@@ -860,7 +795,6 @@ static int __devinit cx88_audio_initdev(struct pci_dev *pci, | |||
860 | { | 795 | { |
861 | struct snd_card *card; | 796 | struct snd_card *card; |
862 | snd_cx88_card_t *chip; | 797 | snd_cx88_card_t *chip; |
863 | struct v4l2_subdev *sd; | ||
864 | int err; | 798 | int err; |
865 | 799 | ||
866 | if (devno >= SNDRV_CARDS) | 800 | if (devno >= SNDRV_CARDS) |
@@ -896,15 +830,6 @@ static int __devinit cx88_audio_initdev(struct pci_dev *pci, | |||
896 | if (err < 0) | 830 | if (err < 0) |
897 | goto error; | 831 | goto error; |
898 | 832 | ||
899 | /* If there's a wm8775 then add a Line-In ALC switch */ | ||
900 | list_for_each_entry(sd, &chip->core->v4l2_dev.subdevs, list) { | ||
901 | if (WM8775_GID == sd->grp_id) { | ||
902 | snd_ctl_add(card, snd_ctl_new1(&snd_cx88_alc_switch, | ||
903 | chip)); | ||
904 | break; | ||
905 | } | ||
906 | } | ||
907 | |||
908 | strcpy (card->driver, "CX88x"); | 833 | strcpy (card->driver, "CX88x"); |
909 | sprintf(card->shortname, "Conexant CX%x", pci->device); | 834 | sprintf(card->shortname, "Conexant CX%x", pci->device); |
910 | sprintf(card->longname, "%s at %#llx", | 835 | sprintf(card->longname, "%s at %#llx", |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 9b9e169cce90..0ccc2afd7266 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -1007,15 +1007,22 @@ static const struct cx88_board cx88_boards[] = { | |||
1007 | .radio_type = UNSET, | 1007 | .radio_type = UNSET, |
1008 | .tuner_addr = ADDR_UNSET, | 1008 | .tuner_addr = ADDR_UNSET, |
1009 | .radio_addr = ADDR_UNSET, | 1009 | .radio_addr = ADDR_UNSET, |
1010 | .audio_chip = V4L2_IDENT_WM8775, | ||
1010 | .input = {{ | 1011 | .input = {{ |
1011 | .type = CX88_VMUX_DVB, | 1012 | .type = CX88_VMUX_DVB, |
1012 | .vmux = 0, | 1013 | .vmux = 0, |
1014 | /* 2: Line-In */ | ||
1015 | .audioroute = 2, | ||
1013 | },{ | 1016 | },{ |
1014 | .type = CX88_VMUX_COMPOSITE1, | 1017 | .type = CX88_VMUX_COMPOSITE1, |
1015 | .vmux = 1, | 1018 | .vmux = 1, |
1019 | /* 2: Line-In */ | ||
1020 | .audioroute = 2, | ||
1016 | },{ | 1021 | },{ |
1017 | .type = CX88_VMUX_SVIDEO, | 1022 | .type = CX88_VMUX_SVIDEO, |
1018 | .vmux = 2, | 1023 | .vmux = 2, |
1024 | /* 2: Line-In */ | ||
1025 | .audioroute = 2, | ||
1019 | }}, | 1026 | }}, |
1020 | .mpeg = CX88_MPEG_DVB, | 1027 | .mpeg = CX88_MPEG_DVB, |
1021 | }, | 1028 | }, |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 62cea9549404..d9249e5a04c9 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include "cx88.h" | 40 | #include "cx88.h" |
41 | #include <media/v4l2-common.h> | 41 | #include <media/v4l2-common.h> |
42 | #include <media/v4l2-ioctl.h> | 42 | #include <media/v4l2-ioctl.h> |
43 | #include <media/wm8775.h> | ||
44 | 43 | ||
45 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 44 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
46 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 45 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
@@ -977,7 +976,6 @@ int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
977 | const struct cx88_ctrl *c = NULL; | 976 | const struct cx88_ctrl *c = NULL; |
978 | u32 value,mask; | 977 | u32 value,mask; |
979 | int i; | 978 | int i; |
980 | struct v4l2_control client_ctl; | ||
981 | 979 | ||
982 | for (i = 0; i < CX8800_CTLS; i++) { | 980 | for (i = 0; i < CX8800_CTLS; i++) { |
983 | if (cx8800_ctls[i].v.id == ctl->id) { | 981 | if (cx8800_ctls[i].v.id == ctl->id) { |
@@ -991,27 +989,6 @@ int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
991 | ctl->value = c->v.minimum; | 989 | ctl->value = c->v.minimum; |
992 | if (ctl->value > c->v.maximum) | 990 | if (ctl->value > c->v.maximum) |
993 | ctl->value = c->v.maximum; | 991 | ctl->value = c->v.maximum; |
994 | |||
995 | /* Pass changes onto any WM8775 */ | ||
996 | client_ctl.id = ctl->id; | ||
997 | switch (ctl->id) { | ||
998 | case V4L2_CID_AUDIO_MUTE: | ||
999 | client_ctl.value = ctl->value; | ||
1000 | break; | ||
1001 | case V4L2_CID_AUDIO_VOLUME: | ||
1002 | client_ctl.value = (ctl->value) ? | ||
1003 | (0x90 + ctl->value) << 8 : 0; | ||
1004 | break; | ||
1005 | case V4L2_CID_AUDIO_BALANCE: | ||
1006 | client_ctl.value = ctl->value << 9; | ||
1007 | break; | ||
1008 | default: | ||
1009 | client_ctl.id = 0; | ||
1010 | break; | ||
1011 | } | ||
1012 | if (client_ctl.id) | ||
1013 | call_hw(core, WM8775_GID, core, s_ctrl, &client_ctl); | ||
1014 | |||
1015 | mask=c->mask; | 992 | mask=c->mask; |
1016 | switch (ctl->id) { | 993 | switch (ctl->id) { |
1017 | case V4L2_CID_AUDIO_BALANCE: | 994 | case V4L2_CID_AUDIO_BALANCE: |
@@ -1558,9 +1535,7 @@ static int radio_queryctrl (struct file *file, void *priv, | |||
1558 | if (c->id < V4L2_CID_BASE || | 1535 | if (c->id < V4L2_CID_BASE || |
1559 | c->id >= V4L2_CID_LASTP1) | 1536 | c->id >= V4L2_CID_LASTP1) |
1560 | return -EINVAL; | 1537 | return -EINVAL; |
1561 | if (c->id == V4L2_CID_AUDIO_MUTE || | 1538 | if (c->id == V4L2_CID_AUDIO_MUTE) { |
1562 | c->id == V4L2_CID_AUDIO_VOLUME || | ||
1563 | c->id == V4L2_CID_AUDIO_BALANCE) { | ||
1564 | for (i = 0; i < CX8800_CTLS; i++) { | 1539 | for (i = 0; i < CX8800_CTLS; i++) { |
1565 | if (cx8800_ctls[i].v.id == c->id) | 1540 | if (cx8800_ctls[i].v.id == c->id) |
1566 | break; | 1541 | break; |
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h index e8c732e7ae4f..c9981e77416a 100644 --- a/drivers/media/video/cx88/cx88.h +++ b/drivers/media/video/cx88/cx88.h | |||
@@ -398,19 +398,17 @@ static inline struct cx88_core *to_core(struct v4l2_device *v4l2_dev) | |||
398 | return container_of(v4l2_dev, struct cx88_core, v4l2_dev); | 398 | return container_of(v4l2_dev, struct cx88_core, v4l2_dev); |
399 | } | 399 | } |
400 | 400 | ||
401 | #define call_hw(core, grpid, o, f, args...) \ | 401 | #define call_all(core, o, f, args...) \ |
402 | do { \ | 402 | do { \ |
403 | if (!core->i2c_rc) { \ | 403 | if (!core->i2c_rc) { \ |
404 | if (core->gate_ctrl) \ | 404 | if (core->gate_ctrl) \ |
405 | core->gate_ctrl(core, 1); \ | 405 | core->gate_ctrl(core, 1); \ |
406 | v4l2_device_call_all(&core->v4l2_dev, grpid, o, f, ##args); \ | 406 | v4l2_device_call_all(&core->v4l2_dev, 0, o, f, ##args); \ |
407 | if (core->gate_ctrl) \ | 407 | if (core->gate_ctrl) \ |
408 | core->gate_ctrl(core, 0); \ | 408 | core->gate_ctrl(core, 0); \ |
409 | } \ | 409 | } \ |
410 | } while (0) | 410 | } while (0) |
411 | 411 | ||
412 | #define call_all(core, o, f, args...) call_hw(core, 0, o, f, ##args) | ||
413 | |||
414 | struct cx8800_dev; | 412 | struct cx8800_dev; |
415 | struct cx8802_dev; | 413 | struct cx8802_dev; |
416 | 414 | ||
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 908e3bc88303..2c3007280032 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -2377,7 +2377,7 @@ static const struct v4l2_file_operations radio_fops = { | |||
2377 | .owner = THIS_MODULE, | 2377 | .owner = THIS_MODULE, |
2378 | .open = em28xx_v4l2_open, | 2378 | .open = em28xx_v4l2_open, |
2379 | .release = em28xx_v4l2_close, | 2379 | .release = em28xx_v4l2_close, |
2380 | .ioctl = video_ioctl2, | 2380 | .unlocked_ioctl = video_ioctl2, |
2381 | }; | 2381 | }; |
2382 | 2382 | ||
2383 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { | 2383 | static const struct v4l2_ioctl_ops radio_ioctl_ops = { |
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c index 135525649086..fe8ef6419f83 100644 --- a/drivers/media/video/wm8775.c +++ b/drivers/media/video/wm8775.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <media/v4l2-device.h> | 35 | #include <media/v4l2-device.h> |
36 | #include <media/v4l2-chip-ident.h> | 36 | #include <media/v4l2-chip-ident.h> |
37 | #include <media/v4l2-ctrls.h> | 37 | #include <media/v4l2-ctrls.h> |
38 | #include <media/wm8775.h> | ||
39 | 38 | ||
40 | MODULE_DESCRIPTION("wm8775 driver"); | 39 | MODULE_DESCRIPTION("wm8775 driver"); |
41 | MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); | 40 | MODULE_AUTHOR("Ulf Eklund, Hans Verkuil"); |
@@ -51,16 +50,10 @@ enum { | |||
51 | TOT_REGS | 50 | TOT_REGS |
52 | }; | 51 | }; |
53 | 52 | ||
54 | #define ALC_HOLD 0x85 /* R17: use zero cross detection, ALC hold time 42.6 ms */ | ||
55 | #define ALC_EN 0x100 /* R17: ALC enable */ | ||
56 | |||
57 | struct wm8775_state { | 53 | struct wm8775_state { |
58 | struct v4l2_subdev sd; | 54 | struct v4l2_subdev sd; |
59 | struct v4l2_ctrl_handler hdl; | 55 | struct v4l2_ctrl_handler hdl; |
60 | struct v4l2_ctrl *mute; | 56 | struct v4l2_ctrl *mute; |
61 | struct v4l2_ctrl *vol; | ||
62 | struct v4l2_ctrl *bal; | ||
63 | struct v4l2_ctrl *loud; | ||
64 | u8 input; /* Last selected input (0-0xf) */ | 57 | u8 input; /* Last selected input (0-0xf) */ |
65 | }; | 58 | }; |
66 | 59 | ||
@@ -92,30 +85,6 @@ static int wm8775_write(struct v4l2_subdev *sd, int reg, u16 val) | |||
92 | return -1; | 85 | return -1; |
93 | } | 86 | } |
94 | 87 | ||
95 | static void wm8775_set_audio(struct v4l2_subdev *sd, int quietly) | ||
96 | { | ||
97 | struct wm8775_state *state = to_state(sd); | ||
98 | u8 vol_l, vol_r; | ||
99 | int muted = 0 != state->mute->val; | ||
100 | u16 volume = (u16)state->vol->val; | ||
101 | u16 balance = (u16)state->bal->val; | ||
102 | |||
103 | /* normalize ( 65535 to 0 -> 255 to 0 (+24dB to -103dB) ) */ | ||
104 | vol_l = (min(65536 - balance, 32768) * volume) >> 23; | ||
105 | vol_r = (min(balance, (u16)32768) * volume) >> 23; | ||
106 | |||
107 | /* Mute */ | ||
108 | if (muted || quietly) | ||
109 | wm8775_write(sd, R21, 0x0c0 | state->input); | ||
110 | |||
111 | wm8775_write(sd, R14, vol_l | 0x100); /* 0x100= Left channel ADC zero cross enable */ | ||
112 | wm8775_write(sd, R15, vol_r | 0x100); /* 0x100= Right channel ADC zero cross enable */ | ||
113 | |||
114 | /* Un-mute */ | ||
115 | if (!muted) | ||
116 | wm8775_write(sd, R21, state->input); | ||
117 | } | ||
118 | |||
119 | static int wm8775_s_routing(struct v4l2_subdev *sd, | 88 | static int wm8775_s_routing(struct v4l2_subdev *sd, |
120 | u32 input, u32 output, u32 config) | 89 | u32 input, u32 output, u32 config) |
121 | { | 90 | { |
@@ -133,26 +102,25 @@ static int wm8775_s_routing(struct v4l2_subdev *sd, | |||
133 | state->input = input; | 102 | state->input = input; |
134 | if (!v4l2_ctrl_g_ctrl(state->mute)) | 103 | if (!v4l2_ctrl_g_ctrl(state->mute)) |
135 | return 0; | 104 | return 0; |
136 | if (!v4l2_ctrl_g_ctrl(state->vol)) | 105 | wm8775_write(sd, R21, 0x0c0); |
137 | return 0; | 106 | wm8775_write(sd, R14, 0x1d4); |
138 | if (!v4l2_ctrl_g_ctrl(state->bal)) | 107 | wm8775_write(sd, R15, 0x1d4); |
139 | return 0; | 108 | wm8775_write(sd, R21, 0x100 + state->input); |
140 | wm8775_set_audio(sd, 1); | ||
141 | return 0; | 109 | return 0; |
142 | } | 110 | } |
143 | 111 | ||
144 | static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl) | 112 | static int wm8775_s_ctrl(struct v4l2_ctrl *ctrl) |
145 | { | 113 | { |
146 | struct v4l2_subdev *sd = to_sd(ctrl); | 114 | struct v4l2_subdev *sd = to_sd(ctrl); |
115 | struct wm8775_state *state = to_state(sd); | ||
147 | 116 | ||
148 | switch (ctrl->id) { | 117 | switch (ctrl->id) { |
149 | case V4L2_CID_AUDIO_MUTE: | 118 | case V4L2_CID_AUDIO_MUTE: |
150 | case V4L2_CID_AUDIO_VOLUME: | 119 | wm8775_write(sd, R21, 0x0c0); |
151 | case V4L2_CID_AUDIO_BALANCE: | 120 | wm8775_write(sd, R14, 0x1d4); |
152 | wm8775_set_audio(sd, 0); | 121 | wm8775_write(sd, R15, 0x1d4); |
153 | return 0; | 122 | if (!ctrl->val) |
154 | case V4L2_CID_AUDIO_LOUDNESS: | 123 | wm8775_write(sd, R21, 0x100 + state->input); |
155 | wm8775_write(sd, R17, (ctrl->val ? ALC_EN : 0) | ALC_HOLD); | ||
156 | return 0; | 124 | return 0; |
157 | } | 125 | } |
158 | return -EINVAL; | 126 | return -EINVAL; |
@@ -176,7 +144,16 @@ static int wm8775_log_status(struct v4l2_subdev *sd) | |||
176 | 144 | ||
177 | static int wm8775_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) | 145 | static int wm8775_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *freq) |
178 | { | 146 | { |
179 | wm8775_set_audio(sd, 0); | 147 | struct wm8775_state *state = to_state(sd); |
148 | |||
149 | /* If I remove this, then it can happen that I have no | ||
150 | sound the first time I tune from static to a valid channel. | ||
151 | It's difficult to reproduce and is almost certainly related | ||
152 | to the zero cross detect circuit. */ | ||
153 | wm8775_write(sd, R21, 0x0c0); | ||
154 | wm8775_write(sd, R14, 0x1d4); | ||
155 | wm8775_write(sd, R15, 0x1d4); | ||
156 | wm8775_write(sd, R21, 0x100 + state->input); | ||
180 | return 0; | 157 | return 0; |
181 | } | 158 | } |
182 | 159 | ||
@@ -226,7 +203,6 @@ static int wm8775_probe(struct i2c_client *client, | |||
226 | { | 203 | { |
227 | struct wm8775_state *state; | 204 | struct wm8775_state *state; |
228 | struct v4l2_subdev *sd; | 205 | struct v4l2_subdev *sd; |
229 | int err; | ||
230 | 206 | ||
231 | /* Check if the adapter supports the needed features */ | 207 | /* Check if the adapter supports the needed features */ |
232 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 208 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
@@ -240,21 +216,15 @@ static int wm8775_probe(struct i2c_client *client, | |||
240 | return -ENOMEM; | 216 | return -ENOMEM; |
241 | sd = &state->sd; | 217 | sd = &state->sd; |
242 | v4l2_i2c_subdev_init(sd, client, &wm8775_ops); | 218 | v4l2_i2c_subdev_init(sd, client, &wm8775_ops); |
243 | sd->grp_id = WM8775_GID; /* subdev group id */ | ||
244 | state->input = 2; | 219 | state->input = 2; |
245 | 220 | ||
246 | v4l2_ctrl_handler_init(&state->hdl, 4); | 221 | v4l2_ctrl_handler_init(&state->hdl, 1); |
247 | state->mute = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops, | 222 | state->mute = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops, |
248 | V4L2_CID_AUDIO_MUTE, 0, 1, 1, 0); | 223 | V4L2_CID_AUDIO_MUTE, 0, 1, 1, 0); |
249 | state->vol = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops, | ||
250 | V4L2_CID_AUDIO_VOLUME, 0, 65535, (65535+99)/100, 0xCF00); /* 0dB*/ | ||
251 | state->bal = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops, | ||
252 | V4L2_CID_AUDIO_BALANCE, 0, 65535, (65535+99)/100, 32768); | ||
253 | state->loud = v4l2_ctrl_new_std(&state->hdl, &wm8775_ctrl_ops, | ||
254 | V4L2_CID_AUDIO_LOUDNESS, 0, 1, 1, 1); | ||
255 | sd->ctrl_handler = &state->hdl; | 224 | sd->ctrl_handler = &state->hdl; |
256 | err = state->hdl.error; | 225 | if (state->hdl.error) { |
257 | if (err) { | 226 | int err = state->hdl.error; |
227 | |||
258 | v4l2_ctrl_handler_free(&state->hdl); | 228 | v4l2_ctrl_handler_free(&state->hdl); |
259 | kfree(state); | 229 | kfree(state); |
260 | return err; | 230 | return err; |
@@ -266,25 +236,29 @@ static int wm8775_probe(struct i2c_client *client, | |||
266 | wm8775_write(sd, R23, 0x000); | 236 | wm8775_write(sd, R23, 0x000); |
267 | /* Disable zero cross detect timeout */ | 237 | /* Disable zero cross detect timeout */ |
268 | wm8775_write(sd, R7, 0x000); | 238 | wm8775_write(sd, R7, 0x000); |
269 | /* HPF enable, I2S mode, 24-bit */ | 239 | /* Left justified, 24-bit mode */ |
270 | wm8775_write(sd, R11, 0x022); | 240 | wm8775_write(sd, R11, 0x021); |
271 | /* Master mode, clock ratio 256fs */ | 241 | /* Master mode, clock ratio 256fs */ |
272 | wm8775_write(sd, R12, 0x102); | 242 | wm8775_write(sd, R12, 0x102); |
273 | /* Powered up */ | 243 | /* Powered up */ |
274 | wm8775_write(sd, R13, 0x000); | 244 | wm8775_write(sd, R13, 0x000); |
275 | /* ALC stereo, ALC target level -5dB FS, ALC max gain +8dB */ | 245 | /* ADC gain +2.5dB, enable zero cross */ |
276 | wm8775_write(sd, R16, 0x1bb); | 246 | wm8775_write(sd, R14, 0x1d4); |
277 | /* Set ALC mode and hold time */ | 247 | /* ADC gain +2.5dB, enable zero cross */ |
278 | wm8775_write(sd, R17, (state->loud->val ? ALC_EN : 0) | ALC_HOLD); | 248 | wm8775_write(sd, R15, 0x1d4); |
249 | /* ALC Stereo, ALC target level -1dB FS max gain +8dB */ | ||
250 | wm8775_write(sd, R16, 0x1bf); | ||
251 | /* Enable gain control, use zero cross detection, | ||
252 | ALC hold time 42.6 ms */ | ||
253 | wm8775_write(sd, R17, 0x185); | ||
279 | /* ALC gain ramp up delay 34 s, ALC gain ramp down delay 33 ms */ | 254 | /* ALC gain ramp up delay 34 s, ALC gain ramp down delay 33 ms */ |
280 | wm8775_write(sd, R18, 0x0a2); | 255 | wm8775_write(sd, R18, 0x0a2); |
281 | /* Enable noise gate, threshold -72dBfs */ | 256 | /* Enable noise gate, threshold -72dBfs */ |
282 | wm8775_write(sd, R19, 0x005); | 257 | wm8775_write(sd, R19, 0x005); |
283 | /* Transient window 4ms, ALC min gain -5dB */ | 258 | /* Transient window 4ms, lower PGA gain limit -1dB */ |
284 | wm8775_write(sd, R20, 0x0fb); | 259 | wm8775_write(sd, R20, 0x07a); |
285 | 260 | /* LRBOTH = 1, use input 2. */ | |
286 | wm8775_set_audio(sd, 1); /* set volume/mute/mux */ | 261 | wm8775_write(sd, R21, 0x102); |
287 | |||
288 | return 0; | 262 | return 0; |
289 | } | 263 | } |
290 | 264 | ||
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 53363108994e..3acf5123a6ef 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -3504,6 +3504,8 @@ static int atl1_set_ringparam(struct net_device *netdev, | |||
3504 | struct atl1_rfd_ring rfd_old, rfd_new; | 3504 | struct atl1_rfd_ring rfd_old, rfd_new; |
3505 | struct atl1_rrd_ring rrd_old, rrd_new; | 3505 | struct atl1_rrd_ring rrd_old, rrd_new; |
3506 | struct atl1_ring_header rhdr_old, rhdr_new; | 3506 | struct atl1_ring_header rhdr_old, rhdr_new; |
3507 | struct atl1_smb smb; | ||
3508 | struct atl1_cmb cmb; | ||
3507 | int err; | 3509 | int err; |
3508 | 3510 | ||
3509 | tpd_old = adapter->tpd_ring; | 3511 | tpd_old = adapter->tpd_ring; |
@@ -3544,11 +3546,19 @@ static int atl1_set_ringparam(struct net_device *netdev, | |||
3544 | adapter->rrd_ring = rrd_old; | 3546 | adapter->rrd_ring = rrd_old; |
3545 | adapter->tpd_ring = tpd_old; | 3547 | adapter->tpd_ring = tpd_old; |
3546 | adapter->ring_header = rhdr_old; | 3548 | adapter->ring_header = rhdr_old; |
3549 | /* | ||
3550 | * Save SMB and CMB, since atl1_free_ring_resources | ||
3551 | * will clear them. | ||
3552 | */ | ||
3553 | smb = adapter->smb; | ||
3554 | cmb = adapter->cmb; | ||
3547 | atl1_free_ring_resources(adapter); | 3555 | atl1_free_ring_resources(adapter); |
3548 | adapter->rfd_ring = rfd_new; | 3556 | adapter->rfd_ring = rfd_new; |
3549 | adapter->rrd_ring = rrd_new; | 3557 | adapter->rrd_ring = rrd_new; |
3550 | adapter->tpd_ring = tpd_new; | 3558 | adapter->tpd_ring = tpd_new; |
3551 | adapter->ring_header = rhdr_new; | 3559 | adapter->ring_header = rhdr_new; |
3560 | adapter->smb = smb; | ||
3561 | adapter->cmb = cmb; | ||
3552 | 3562 | ||
3553 | err = atl1_up(adapter); | 3563 | err = atl1_up(adapter); |
3554 | if (err) | 3564 | if (err) |
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 92bac19ad60a..6dff32196c92 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -940,7 +940,7 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages) | |||
940 | &udev->l2_ring_map, | 940 | &udev->l2_ring_map, |
941 | GFP_KERNEL | __GFP_COMP); | 941 | GFP_KERNEL | __GFP_COMP); |
942 | if (!udev->l2_ring) | 942 | if (!udev->l2_ring) |
943 | return -ENOMEM; | 943 | goto err_udev; |
944 | 944 | ||
945 | udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size; | 945 | udev->l2_buf_size = (cp->l2_rx_ring_size + 1) * cp->l2_single_buf_size; |
946 | udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size); | 946 | udev->l2_buf_size = PAGE_ALIGN(udev->l2_buf_size); |
@@ -948,7 +948,7 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages) | |||
948 | &udev->l2_buf_map, | 948 | &udev->l2_buf_map, |
949 | GFP_KERNEL | __GFP_COMP); | 949 | GFP_KERNEL | __GFP_COMP); |
950 | if (!udev->l2_buf) | 950 | if (!udev->l2_buf) |
951 | return -ENOMEM; | 951 | goto err_dma; |
952 | 952 | ||
953 | write_lock(&cnic_dev_lock); | 953 | write_lock(&cnic_dev_lock); |
954 | list_add(&udev->list, &cnic_udev_list); | 954 | list_add(&udev->list, &cnic_udev_list); |
@@ -959,6 +959,12 @@ static int cnic_alloc_uio_rings(struct cnic_dev *dev, int pages) | |||
959 | cp->udev = udev; | 959 | cp->udev = udev; |
960 | 960 | ||
961 | return 0; | 961 | return 0; |
962 | err_dma: | ||
963 | dma_free_coherent(&udev->pdev->dev, udev->l2_ring_size, | ||
964 | udev->l2_ring, udev->l2_ring_map); | ||
965 | err_udev: | ||
966 | kfree(udev); | ||
967 | return -ENOMEM; | ||
962 | } | 968 | } |
963 | 969 | ||
964 | static int cnic_init_uio(struct cnic_dev *dev) | 970 | static int cnic_init_uio(struct cnic_dev *dev) |
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 1f37ee6b2a26..d6cf502906cf 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c | |||
@@ -263,6 +263,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev, | |||
263 | 263 | ||
264 | static int ehea_set_flags(struct net_device *dev, u32 data) | 264 | static int ehea_set_flags(struct net_device *dev, u32 data) |
265 | { | 265 | { |
266 | /* Avoid changing the VLAN flags */ | ||
267 | if ((data & (ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN)) != | ||
268 | (ethtool_op_get_flags(dev) & (ETH_FLAG_RXVLAN | | ||
269 | ETH_FLAG_TXVLAN))){ | ||
270 | return -EINVAL; | ||
271 | } | ||
272 | |||
266 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO | 273 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO |
267 | | ETH_FLAG_TXVLAN | 274 | | ETH_FLAG_TXVLAN |
268 | | ETH_FLAG_RXVLAN); | 275 | | ETH_FLAG_RXVLAN); |
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 39659976a1ac..89294b43c4a9 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -1285,6 +1285,11 @@ ppp_push(struct ppp *ppp) | |||
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | #ifdef CONFIG_PPP_MULTILINK | 1287 | #ifdef CONFIG_PPP_MULTILINK |
1288 | static bool mp_protocol_compress __read_mostly = true; | ||
1289 | module_param(mp_protocol_compress, bool, S_IRUGO | S_IWUSR); | ||
1290 | MODULE_PARM_DESC(mp_protocol_compress, | ||
1291 | "compress protocol id in multilink fragments"); | ||
1292 | |||
1288 | /* | 1293 | /* |
1289 | * Divide a packet to be transmitted into fragments and | 1294 | * Divide a packet to be transmitted into fragments and |
1290 | * send them out the individual links. | 1295 | * send them out the individual links. |
@@ -1347,10 +1352,10 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1347 | if (nfree == 0 || nfree < navail / 2) | 1352 | if (nfree == 0 || nfree < navail / 2) |
1348 | return 0; /* can't take now, leave it in xmit_pending */ | 1353 | return 0; /* can't take now, leave it in xmit_pending */ |
1349 | 1354 | ||
1350 | /* Do protocol field compression (XXX this should be optional) */ | 1355 | /* Do protocol field compression */ |
1351 | p = skb->data; | 1356 | p = skb->data; |
1352 | len = skb->len; | 1357 | len = skb->len; |
1353 | if (*p == 0) { | 1358 | if (*p == 0 && mp_protocol_compress) { |
1354 | ++p; | 1359 | ++p; |
1355 | --len; | 1360 | --len; |
1356 | } | 1361 | } |
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 0a66fed52e8e..16c62659cdd9 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c | |||
@@ -412,7 +412,7 @@ static int skfp_driver_init(struct net_device *dev) | |||
412 | bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev, | 412 | bp->SharedMemAddr = pci_alloc_consistent(&bp->pdev, |
413 | bp->SharedMemSize, | 413 | bp->SharedMemSize, |
414 | &bp->SharedMemDMA); | 414 | &bp->SharedMemDMA); |
415 | if (!bp->SharedMemSize) { | 415 | if (!bp->SharedMemAddr) { |
416 | printk("could not allocate mem for "); | 416 | printk("could not allocate mem for "); |
417 | printk("hardware module: %ld byte\n", | 417 | printk("hardware module: %ld byte\n", |
418 | bp->SharedMemSize); | 418 | bp->SharedMemSize); |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 4adf12422787..a4f2bd52e546 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -148,7 +148,7 @@ static int full_duplex[MAX_UNITS] = {0, }; | |||
148 | * This SUCKS. | 148 | * This SUCKS. |
149 | * We need a much better method to determine if dma_addr_t is 64-bit. | 149 | * We need a much better method to determine if dma_addr_t is 64-bit. |
150 | */ | 150 | */ |
151 | #if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__alpha__) || defined(__mips64__) || (defined(__mips__) && defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) || (defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT)) | 151 | #if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__alpha__) || (defined(CONFIG_MIPS) && ((defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) || defined(CONFIG_64BIT))) || (defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT)) |
152 | /* 64-bit dma_addr_t */ | 152 | /* 64-bit dma_addr_t */ |
153 | #define ADDR_64BITS /* This chip uses 64 bit addresses. */ | 153 | #define ADDR_64BITS /* This chip uses 64 bit addresses. */ |
154 | #define netdrv_addr_t __le64 | 154 | #define netdrv_addr_t __le64 |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 30ccbb6d097a..6f97b7bbcbf1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12658,7 +12658,7 @@ static void __devinit tg3_read_vpd(struct tg3 *tp) | |||
12658 | cnt = pci_read_vpd(tp->pdev, pos, | 12658 | cnt = pci_read_vpd(tp->pdev, pos, |
12659 | TG3_NVM_VPD_LEN - pos, | 12659 | TG3_NVM_VPD_LEN - pos, |
12660 | &vpd_data[pos]); | 12660 | &vpd_data[pos]); |
12661 | if (cnt == -ETIMEDOUT || -EINTR) | 12661 | if (cnt == -ETIMEDOUT || cnt == -EINTR) |
12662 | cnt = 0; | 12662 | cnt = 0; |
12663 | else if (cnt < 0) | 12663 | else if (cnt < 0) |
12664 | goto out_not_found; | 12664 | goto out_not_found; |
diff --git a/drivers/platform/x86/intel_ips.c b/drivers/platform/x86/intel_ips.c index c44a5e8b8b82..f0b3ad13c273 100644 --- a/drivers/platform/x86/intel_ips.c +++ b/drivers/platform/x86/intel_ips.c | |||
@@ -75,6 +75,7 @@ | |||
75 | #include <drm/i915_drm.h> | 75 | #include <drm/i915_drm.h> |
76 | #include <asm/msr.h> | 76 | #include <asm/msr.h> |
77 | #include <asm/processor.h> | 77 | #include <asm/processor.h> |
78 | #include "intel_ips.h" | ||
78 | 79 | ||
79 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 | 80 | #define PCI_DEVICE_ID_INTEL_THERMAL_SENSOR 0x3b32 |
80 | 81 | ||
@@ -245,6 +246,7 @@ | |||
245 | #define thm_writel(off, val) writel((val), ips->regmap + (off)) | 246 | #define thm_writel(off, val) writel((val), ips->regmap + (off)) |
246 | 247 | ||
247 | static const int IPS_ADJUST_PERIOD = 5000; /* ms */ | 248 | static const int IPS_ADJUST_PERIOD = 5000; /* ms */ |
249 | static bool late_i915_load = false; | ||
248 | 250 | ||
249 | /* For initial average collection */ | 251 | /* For initial average collection */ |
250 | static const int IPS_SAMPLE_PERIOD = 200; /* ms */ | 252 | static const int IPS_SAMPLE_PERIOD = 200; /* ms */ |
@@ -339,6 +341,9 @@ struct ips_driver { | |||
339 | u64 orig_turbo_ratios; | 341 | u64 orig_turbo_ratios; |
340 | }; | 342 | }; |
341 | 343 | ||
344 | static bool | ||
345 | ips_gpu_turbo_enabled(struct ips_driver *ips); | ||
346 | |||
342 | /** | 347 | /** |
343 | * ips_cpu_busy - is CPU busy? | 348 | * ips_cpu_busy - is CPU busy? |
344 | * @ips: IPS driver struct | 349 | * @ips: IPS driver struct |
@@ -517,7 +522,7 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips) | |||
517 | */ | 522 | */ |
518 | static bool ips_gpu_busy(struct ips_driver *ips) | 523 | static bool ips_gpu_busy(struct ips_driver *ips) |
519 | { | 524 | { |
520 | if (!ips->gpu_turbo_enabled) | 525 | if (!ips_gpu_turbo_enabled(ips)) |
521 | return false; | 526 | return false; |
522 | 527 | ||
523 | return ips->gpu_busy(); | 528 | return ips->gpu_busy(); |
@@ -532,7 +537,7 @@ static bool ips_gpu_busy(struct ips_driver *ips) | |||
532 | */ | 537 | */ |
533 | static void ips_gpu_raise(struct ips_driver *ips) | 538 | static void ips_gpu_raise(struct ips_driver *ips) |
534 | { | 539 | { |
535 | if (!ips->gpu_turbo_enabled) | 540 | if (!ips_gpu_turbo_enabled(ips)) |
536 | return; | 541 | return; |
537 | 542 | ||
538 | if (!ips->gpu_raise()) | 543 | if (!ips->gpu_raise()) |
@@ -549,7 +554,7 @@ static void ips_gpu_raise(struct ips_driver *ips) | |||
549 | */ | 554 | */ |
550 | static void ips_gpu_lower(struct ips_driver *ips) | 555 | static void ips_gpu_lower(struct ips_driver *ips) |
551 | { | 556 | { |
552 | if (!ips->gpu_turbo_enabled) | 557 | if (!ips_gpu_turbo_enabled(ips)) |
553 | return; | 558 | return; |
554 | 559 | ||
555 | if (!ips->gpu_lower()) | 560 | if (!ips->gpu_lower()) |
@@ -1454,6 +1459,31 @@ out_err: | |||
1454 | return false; | 1459 | return false; |
1455 | } | 1460 | } |
1456 | 1461 | ||
1462 | static bool | ||
1463 | ips_gpu_turbo_enabled(struct ips_driver *ips) | ||
1464 | { | ||
1465 | if (!ips->gpu_busy && late_i915_load) { | ||
1466 | if (ips_get_i915_syms(ips)) { | ||
1467 | dev_info(&ips->dev->dev, | ||
1468 | "i915 driver attached, reenabling gpu turbo\n"); | ||
1469 | ips->gpu_turbo_enabled = !(thm_readl(THM_HTS) & HTS_GTD_DIS); | ||
1470 | } | ||
1471 | } | ||
1472 | |||
1473 | return ips->gpu_turbo_enabled; | ||
1474 | } | ||
1475 | |||
1476 | void | ||
1477 | ips_link_to_i915_driver() | ||
1478 | { | ||
1479 | /* We can't cleanly get at the various ips_driver structs from | ||
1480 | * this caller (the i915 driver), so just set a flag saying | ||
1481 | * that it's time to try getting the symbols again. | ||
1482 | */ | ||
1483 | late_i915_load = true; | ||
1484 | } | ||
1485 | EXPORT_SYMBOL_GPL(ips_link_to_i915_driver); | ||
1486 | |||
1457 | static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { | 1487 | static DEFINE_PCI_DEVICE_TABLE(ips_id_table) = { |
1458 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, | 1488 | { PCI_DEVICE(PCI_VENDOR_ID_INTEL, |
1459 | PCI_DEVICE_ID_INTEL_THERMAL_SENSOR), }, | 1489 | PCI_DEVICE_ID_INTEL_THERMAL_SENSOR), }, |
diff --git a/drivers/platform/x86/intel_ips.h b/drivers/platform/x86/intel_ips.h new file mode 100644 index 000000000000..73299beff5b3 --- /dev/null +++ b/drivers/platform/x86/intel_ips.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010 Intel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
16 | * | ||
17 | * The full GNU General Public License is included in this distribution in | ||
18 | * the file called "COPYING". | ||
19 | */ | ||
20 | |||
21 | void ips_link_to_i915_driver(void); | ||
diff --git a/drivers/spi/coldfire_qspi.c b/drivers/spi/coldfire_qspi.c index 052b3c7fa6a0..8856bcca9d29 100644 --- a/drivers/spi/coldfire_qspi.c +++ b/drivers/spi/coldfire_qspi.c | |||
@@ -317,7 +317,7 @@ static void mcfqspi_work(struct work_struct *work) | |||
317 | msg = container_of(mcfqspi->msgq.next, struct spi_message, | 317 | msg = container_of(mcfqspi->msgq.next, struct spi_message, |
318 | queue); | 318 | queue); |
319 | 319 | ||
320 | list_del_init(&mcfqspi->msgq); | 320 | list_del_init(&msg->queue); |
321 | spin_unlock_irqrestore(&mcfqspi->lock, flags); | 321 | spin_unlock_irqrestore(&mcfqspi->lock, flags); |
322 | 322 | ||
323 | spi = msg->spi; | 323 | spi = msg->spi; |
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 2a651e61bfbf..951a160fc27f 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c | |||
@@ -1305,10 +1305,49 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev) | |||
1305 | /* work with hotplug and coldplug */ | 1305 | /* work with hotplug and coldplug */ |
1306 | MODULE_ALIAS("platform:omap2_mcspi"); | 1306 | MODULE_ALIAS("platform:omap2_mcspi"); |
1307 | 1307 | ||
1308 | #ifdef CONFIG_SUSPEND | ||
1309 | /* | ||
1310 | * When SPI wake up from off-mode, CS is in activate state. If it was in | ||
1311 | * unactive state when driver was suspend, then force it to unactive state at | ||
1312 | * wake up. | ||
1313 | */ | ||
1314 | static int omap2_mcspi_resume(struct device *dev) | ||
1315 | { | ||
1316 | struct spi_master *master = dev_get_drvdata(dev); | ||
1317 | struct omap2_mcspi *mcspi = spi_master_get_devdata(master); | ||
1318 | struct omap2_mcspi_cs *cs; | ||
1319 | |||
1320 | omap2_mcspi_enable_clocks(mcspi); | ||
1321 | list_for_each_entry(cs, &omap2_mcspi_ctx[master->bus_num - 1].cs, | ||
1322 | node) { | ||
1323 | if ((cs->chconf0 & OMAP2_MCSPI_CHCONF_FORCE) == 0) { | ||
1324 | |||
1325 | /* | ||
1326 | * We need to toggle CS state for OMAP take this | ||
1327 | * change in account. | ||
1328 | */ | ||
1329 | MOD_REG_BIT(cs->chconf0, OMAP2_MCSPI_CHCONF_FORCE, 1); | ||
1330 | __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0); | ||
1331 | MOD_REG_BIT(cs->chconf0, OMAP2_MCSPI_CHCONF_FORCE, 0); | ||
1332 | __raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0); | ||
1333 | } | ||
1334 | } | ||
1335 | omap2_mcspi_disable_clocks(mcspi); | ||
1336 | return 0; | ||
1337 | } | ||
1338 | #else | ||
1339 | #define omap2_mcspi_resume NULL | ||
1340 | #endif | ||
1341 | |||
1342 | static const struct dev_pm_ops omap2_mcspi_pm_ops = { | ||
1343 | .resume = omap2_mcspi_resume, | ||
1344 | }; | ||
1345 | |||
1308 | static struct platform_driver omap2_mcspi_driver = { | 1346 | static struct platform_driver omap2_mcspi_driver = { |
1309 | .driver = { | 1347 | .driver = { |
1310 | .name = "omap2_mcspi", | 1348 | .name = "omap2_mcspi", |
1311 | .owner = THIS_MODULE, | 1349 | .owner = THIS_MODULE, |
1350 | .pm = &omap2_mcspi_pm_ops | ||
1312 | }, | 1351 | }, |
1313 | .remove = __exit_p(omap2_mcspi_remove), | 1352 | .remove = __exit_p(omap2_mcspi_remove), |
1314 | }; | 1353 | }; |
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 8c3c057aa847..d0e9e0207539 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/drivers/staging/zram/zram_drv.c | |||
@@ -435,12 +435,6 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio) | |||
435 | int ret = 0; | 435 | int ret = 0; |
436 | struct zram *zram = queue->queuedata; | 436 | struct zram *zram = queue->queuedata; |
437 | 437 | ||
438 | if (unlikely(!zram->init_done)) { | ||
439 | set_bit(BIO_UPTODATE, &bio->bi_flags); | ||
440 | bio_endio(bio, 0); | ||
441 | return 0; | ||
442 | } | ||
443 | |||
444 | if (!valid_io_request(zram, bio)) { | 438 | if (!valid_io_request(zram, bio)) { |
445 | zram_stat64_inc(zram, &zram->stats.invalid_io); | 439 | zram_stat64_inc(zram, &zram->stats.invalid_io); |
446 | bio_io_error(bio); | 440 | bio_io_error(bio); |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 44447f54942f..99ac70e32556 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -2206,8 +2206,11 @@ static int uea_boot(struct uea_softc *sc) | |||
2206 | goto err1; | 2206 | goto err1; |
2207 | } | 2207 | } |
2208 | 2208 | ||
2209 | sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm"); | 2209 | /* Create worker thread, but don't start it here. Start it after |
2210 | if (sc->kthread == ERR_PTR(-ENOMEM)) { | 2210 | * all usbatm generic initialization is done. |
2211 | */ | ||
2212 | sc->kthread = kthread_create(uea_kthread, sc, "ueagle-atm"); | ||
2213 | if (IS_ERR(sc->kthread)) { | ||
2211 | uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); | 2214 | uea_err(INS_TO_USBDEV(sc), "failed to create thread\n"); |
2212 | goto err2; | 2215 | goto err2; |
2213 | } | 2216 | } |
@@ -2624,6 +2627,7 @@ static struct usbatm_driver uea_usbatm_driver = { | |||
2624 | static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) | 2627 | static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) |
2625 | { | 2628 | { |
2626 | struct usb_device *usb = interface_to_usbdev(intf); | 2629 | struct usb_device *usb = interface_to_usbdev(intf); |
2630 | int ret; | ||
2627 | 2631 | ||
2628 | uea_enters(usb); | 2632 | uea_enters(usb); |
2629 | uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n", | 2633 | uea_info(usb, "ADSL device founded vid (%#X) pid (%#X) Rev (%#X): %s\n", |
@@ -2637,7 +2641,19 @@ static int uea_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
2637 | if (UEA_IS_PREFIRM(id)) | 2641 | if (UEA_IS_PREFIRM(id)) |
2638 | return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); | 2642 | return uea_load_firmware(usb, UEA_CHIP_VERSION(id)); |
2639 | 2643 | ||
2640 | return usbatm_usb_probe(intf, id, &uea_usbatm_driver); | 2644 | ret = usbatm_usb_probe(intf, id, &uea_usbatm_driver); |
2645 | if (ret == 0) { | ||
2646 | struct usbatm_data *usbatm = usb_get_intfdata(intf); | ||
2647 | struct uea_softc *sc = usbatm->driver_data; | ||
2648 | |||
2649 | /* Ensure carrier is initialized to off as early as possible */ | ||
2650 | UPDATE_ATM_SIGNAL(ATM_PHY_SIG_LOST); | ||
2651 | |||
2652 | /* Only start the worker thread when all init is done */ | ||
2653 | wake_up_process(sc->kthread); | ||
2654 | } | ||
2655 | |||
2656 | return ret; | ||
2641 | } | 2657 | } |
2642 | 2658 | ||
2643 | static void uea_disconnect(struct usb_interface *intf) | 2659 | static void uea_disconnect(struct usb_interface *intf) |