Merge ccffb475c1 ("USB: serial: option: match on interface class for Telit FN990B") into android16-6.12
Steps on the way to 6.12.20 Change-Id: I5101d087092fc3ceeae1bce2daa54d83324e1f2d Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -194,12 +194,19 @@ static void amu_fie_setup(const struct cpumask *cpus)
|
||||
int cpu;
|
||||
|
||||
/* We are already set since the last insmod of cpufreq driver */
|
||||
if (unlikely(cpumask_subset(cpus, amu_fie_cpus)))
|
||||
if (cpumask_available(amu_fie_cpus) &&
|
||||
unlikely(cpumask_subset(cpus, amu_fie_cpus)))
|
||||
return;
|
||||
|
||||
for_each_cpu(cpu, cpus) {
|
||||
for_each_cpu(cpu, cpus)
|
||||
if (!freq_counters_valid(cpu))
|
||||
return;
|
||||
|
||||
if (!cpumask_available(amu_fie_cpus) &&
|
||||
!zalloc_cpumask_var(&amu_fie_cpus, GFP_KERNEL)) {
|
||||
WARN_ONCE(1, "Failed to allocate FIE cpumask for CPUs[%*pbl]\n",
|
||||
cpumask_pr_args(cpus));
|
||||
return;
|
||||
}
|
||||
|
||||
cpumask_or(amu_fie_cpus, amu_fie_cpus, cpus);
|
||||
@@ -237,17 +244,8 @@ static struct notifier_block init_amu_fie_notifier = {
|
||||
|
||||
static int __init init_amu_fie(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!zalloc_cpumask_var(&amu_fie_cpus, GFP_KERNEL))
|
||||
return -ENOMEM;
|
||||
|
||||
ret = cpufreq_register_notifier(&init_amu_fie_notifier,
|
||||
return cpufreq_register_notifier(&init_amu_fie_notifier,
|
||||
CPUFREQ_POLICY_NOTIFIER);
|
||||
if (ret)
|
||||
free_cpumask_var(amu_fie_cpus);
|
||||
|
||||
return ret;
|
||||
}
|
||||
core_initcall(init_amu_fie);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
* Guest CRMD comes from separate GCSR_CRMD register
|
||||
*/
|
||||
ori t0, zero, CSR_PRMD_PIE
|
||||
csrxchg t0, t0, LOONGARCH_CSR_PRMD
|
||||
csrwr t0, LOONGARCH_CSR_PRMD
|
||||
|
||||
/* Set PVM bit to setup ertn to guest context */
|
||||
ori t0, zero, CSR_GSTAT_PVM
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2024 Loongson Technology Corporation Limited
|
||||
*/
|
||||
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/pagewalk.h>
|
||||
#include <linux/pgtable.h>
|
||||
#include <asm/set_memory.h>
|
||||
@@ -167,7 +168,7 @@ bool kernel_page_present(struct page *page)
|
||||
unsigned long addr = (unsigned long)page_address(page);
|
||||
|
||||
if (addr < vm_map_base)
|
||||
return true;
|
||||
return memblock_is_memory(__pa(addr));
|
||||
|
||||
pgd = pgd_offset_k(addr);
|
||||
if (pgd_none(pgdp_get(pgd)))
|
||||
|
||||
@@ -3949,6 +3949,85 @@ static inline bool intel_pmu_has_cap(struct perf_event *event, int idx)
|
||||
return test_bit(idx, (unsigned long *)&intel_cap->capabilities);
|
||||
}
|
||||
|
||||
static u64 intel_pmu_freq_start_period(struct perf_event *event)
|
||||
{
|
||||
int type = event->attr.type;
|
||||
u64 config, factor;
|
||||
s64 start;
|
||||
|
||||
/*
|
||||
* The 127 is the lowest possible recommended SAV (sample after value)
|
||||
* for a 4000 freq (default freq), according to the event list JSON file.
|
||||
* Also, assume the workload is idle 50% time.
|
||||
*/
|
||||
factor = 64 * 4000;
|
||||
if (type != PERF_TYPE_HARDWARE && type != PERF_TYPE_HW_CACHE)
|
||||
goto end;
|
||||
|
||||
/*
|
||||
* The estimation of the start period in the freq mode is
|
||||
* based on the below assumption.
|
||||
*
|
||||
* For a cycles or an instructions event, 1GHZ of the
|
||||
* underlying platform, 1 IPC. The workload is idle 50% time.
|
||||
* The start period = 1,000,000,000 * 1 / freq / 2.
|
||||
* = 500,000,000 / freq
|
||||
*
|
||||
* Usually, the branch-related events occur less than the
|
||||
* instructions event. According to the Intel event list JSON
|
||||
* file, the SAV (sample after value) of a branch-related event
|
||||
* is usually 1/4 of an instruction event.
|
||||
* The start period of branch-related events = 125,000,000 / freq.
|
||||
*
|
||||
* The cache-related events occurs even less. The SAV is usually
|
||||
* 1/20 of an instruction event.
|
||||
* The start period of cache-related events = 25,000,000 / freq.
|
||||
*/
|
||||
config = event->attr.config & PERF_HW_EVENT_MASK;
|
||||
if (type == PERF_TYPE_HARDWARE) {
|
||||
switch (config) {
|
||||
case PERF_COUNT_HW_CPU_CYCLES:
|
||||
case PERF_COUNT_HW_INSTRUCTIONS:
|
||||
case PERF_COUNT_HW_BUS_CYCLES:
|
||||
case PERF_COUNT_HW_STALLED_CYCLES_FRONTEND:
|
||||
case PERF_COUNT_HW_STALLED_CYCLES_BACKEND:
|
||||
case PERF_COUNT_HW_REF_CPU_CYCLES:
|
||||
factor = 500000000;
|
||||
break;
|
||||
case PERF_COUNT_HW_BRANCH_INSTRUCTIONS:
|
||||
case PERF_COUNT_HW_BRANCH_MISSES:
|
||||
factor = 125000000;
|
||||
break;
|
||||
case PERF_COUNT_HW_CACHE_REFERENCES:
|
||||
case PERF_COUNT_HW_CACHE_MISSES:
|
||||
factor = 25000000;
|
||||
break;
|
||||
default:
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == PERF_TYPE_HW_CACHE)
|
||||
factor = 25000000;
|
||||
end:
|
||||
/*
|
||||
* Usually, a prime or a number with less factors (close to prime)
|
||||
* is chosen as an SAV, which makes it less likely that the sampling
|
||||
* period synchronizes with some periodic event in the workload.
|
||||
* Minus 1 to make it at least avoiding values near power of twos
|
||||
* for the default freq.
|
||||
*/
|
||||
start = DIV_ROUND_UP_ULL(factor, event->attr.sample_freq) - 1;
|
||||
|
||||
if (start > x86_pmu.max_period)
|
||||
start = x86_pmu.max_period;
|
||||
|
||||
if (x86_pmu.limit_period)
|
||||
x86_pmu.limit_period(event, &start);
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
static int intel_pmu_hw_config(struct perf_event *event)
|
||||
{
|
||||
int ret = x86_pmu_hw_config(event);
|
||||
@@ -3960,6 +4039,12 @@ static int intel_pmu_hw_config(struct perf_event *event)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (event->attr.freq && event->attr.sample_freq) {
|
||||
event->hw.sample_period = intel_pmu_freq_start_period(event);
|
||||
event->hw.last_period = event->hw.sample_period;
|
||||
local64_set(&event->hw.period_left, event->hw.sample_period);
|
||||
}
|
||||
|
||||
if (event->attr.precise_ip) {
|
||||
if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -846,6 +846,7 @@ static const struct x86_cpu_id rapl_model_match[] __initconst = {
|
||||
X86_MATCH_VFM(INTEL_METEORLAKE_L, &model_skl),
|
||||
X86_MATCH_VFM(INTEL_ARROWLAKE_H, &model_skl),
|
||||
X86_MATCH_VFM(INTEL_ARROWLAKE, &model_skl),
|
||||
X86_MATCH_VFM(INTEL_ARROWLAKE_U, &model_skl),
|
||||
X86_MATCH_VFM(INTEL_LUNARLAKE_M, &model_skl),
|
||||
{},
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/*
|
||||
* Architecture specific OF callbacks.
|
||||
*/
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -313,6 +314,6 @@ void __init x86_flattree_get_config(void)
|
||||
if (initial_dtb)
|
||||
early_memunmap(dt, map_len);
|
||||
#endif
|
||||
if (of_have_populated_dt())
|
||||
if (acpi_disabled && of_have_populated_dt())
|
||||
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,10 @@
|
||||
#include <asm/posted_intr.h>
|
||||
#include <asm/irq_remapping.h>
|
||||
|
||||
#if defined(CONFIG_X86_LOCAL_APIC) || defined(CONFIG_X86_THERMAL_VECTOR)
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <asm/trace/irq_vectors.h>
|
||||
#endif
|
||||
|
||||
DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
|
||||
EXPORT_PER_CPU_SYMBOL(irq_stat);
|
||||
|
||||
@@ -7589,7 +7589,7 @@ static void kvm_mmu_start_lpage_recovery(struct once *once)
|
||||
kvm_nx_huge_page_recovery_worker_kill,
|
||||
kvm, "kvm-nx-lpage-recovery");
|
||||
|
||||
if (!nx_thread)
|
||||
if (IS_ERR(nx_thread))
|
||||
return;
|
||||
|
||||
vhost_task_start(nx_thread);
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ struct bio_slab {
|
||||
struct kmem_cache *slab;
|
||||
unsigned int slab_ref;
|
||||
unsigned int slab_size;
|
||||
char name[8];
|
||||
char name[12];
|
||||
};
|
||||
static DEFINE_MUTEX(bio_slab_lock);
|
||||
static DEFINE_XARRAY(bio_slabs);
|
||||
|
||||
@@ -776,7 +776,6 @@ nouveau_connector_force(struct drm_connector *connector)
|
||||
if (!nv_encoder) {
|
||||
NV_ERROR(drm, "can't find encoder to force %s on!\n",
|
||||
connector->name);
|
||||
connector->status = connector_status_disconnected;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -258,15 +258,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_changed(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -321,15 +322,16 @@ static void drm_test_check_broadcast_rgb_crtc_mode_not_changed(struct kunit *tes
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -384,18 +386,18 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -450,7 +452,6 @@ static void drm_test_check_broadcast_rgb_auto_cea_mode_vic_1(struct kunit *test)
|
||||
mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
|
||||
KUNIT_ASSERT_NOT_NULL(test, mode);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ret = light_up_connector(test, drm, crtc, conn, mode, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
@@ -496,18 +497,18 @@ static void drm_test_check_broadcast_rgb_full_cea_mode(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -564,7 +565,6 @@ static void drm_test_check_broadcast_rgb_full_cea_mode_vic_1(struct kunit *test)
|
||||
mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
|
||||
KUNIT_ASSERT_NOT_NULL(test, mode);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ret = light_up_connector(test, drm, crtc, conn, mode, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
@@ -612,18 +612,18 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
KUNIT_ASSERT_TRUE(test, conn->display_info.is_hdmi);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_NE(test, drm_match_cea_mode(preferred), 1);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -680,7 +680,6 @@ static void drm_test_check_broadcast_rgb_limited_cea_mode_vic_1(struct kunit *te
|
||||
mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
|
||||
KUNIT_ASSERT_NOT_NULL(test, mode);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ret = light_up_connector(test, drm, crtc, conn, mode, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
@@ -730,20 +729,20 @@ static void drm_test_check_output_bpc_crtc_mode_changed(struct kunit *test)
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
|
||||
ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz));
|
||||
KUNIT_ASSERT_GT(test, ret, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -804,20 +803,20 @@ static void drm_test_check_output_bpc_crtc_mode_not_changed(struct kunit *test)
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
|
||||
ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz));
|
||||
KUNIT_ASSERT_GT(test, ret, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -875,6 +874,8 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test)
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_dvi_1080p,
|
||||
@@ -884,14 +885,12 @@ static void drm_test_check_output_bpc_dvi(struct kunit *test)
|
||||
info = &conn->display_info;
|
||||
KUNIT_ASSERT_FALSE(test, info->is_hdmi);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -922,21 +921,21 @@ static void drm_test_check_tmds_char_rate_rgb_8bpc(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_max_200mhz,
|
||||
ARRAY_SIZE(test_edid_hdmi_1080p_rgb_max_200mhz));
|
||||
KUNIT_ASSERT_GT(test, ret, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -969,21 +968,21 @@ static void drm_test_check_tmds_char_rate_rgb_10bpc(struct kunit *test)
|
||||
10);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz,
|
||||
ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz));
|
||||
KUNIT_ASSERT_GT(test, ret, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1016,21 +1015,21 @@ static void drm_test_check_tmds_char_rate_rgb_12bpc(struct kunit *test)
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz,
|
||||
ARRAY_SIZE(test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz));
|
||||
KUNIT_ASSERT_GT(test, ret, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1067,15 +1066,16 @@ static void drm_test_check_hdmi_funcs_reject_rate(struct kunit *test)
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_ASSERT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1123,6 +1123,8 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test)
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
|
||||
@@ -1133,9 +1135,6 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test)
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
|
||||
@@ -1146,8 +1145,9 @@ static void drm_test_check_max_tmds_rate_bpc_fallback(struct kunit *test)
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1192,6 +1192,8 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test)
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
|
||||
@@ -1202,9 +1204,6 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test)
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK);
|
||||
@@ -1218,8 +1217,9 @@ static void drm_test_check_max_tmds_rate_format_fallback(struct kunit *test)
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1266,9 +1266,6 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test)
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1);
|
||||
KUNIT_ASSERT_NOT_NULL(test, mode);
|
||||
|
||||
@@ -1282,7 +1279,9 @@ static void drm_test_check_output_bpc_format_vic_1(struct kunit *test)
|
||||
rate = mode->clock * 1500;
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
crtc = priv->crtc;
|
||||
ret = light_up_connector(test, drm, crtc, conn, mode, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
@@ -1316,6 +1315,8 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz,
|
||||
@@ -1326,9 +1327,6 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
@@ -1347,8 +1345,9 @@ static void drm_test_check_output_bpc_format_driver_rgb_only(struct kunit *test)
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1383,6 +1382,8 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_max_200mhz,
|
||||
@@ -1393,9 +1394,6 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
@@ -1414,8 +1412,9 @@ static void drm_test_check_output_bpc_format_display_rgb_only(struct kunit *test
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1449,6 +1448,8 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
|
||||
8);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz,
|
||||
@@ -1459,9 +1460,6 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
@@ -1472,8 +1470,9 @@ static void drm_test_check_output_bpc_format_driver_8bpc_only(struct kunit *test
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
@@ -1509,6 +1508,8 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
|
||||
12);
|
||||
KUNIT_ASSERT_NOT_NULL(test, priv);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
conn = &priv->connector;
|
||||
ret = set_connector_edid(test, conn,
|
||||
test_edid_hdmi_1080p_rgb_max_340mhz,
|
||||
@@ -1519,9 +1520,6 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
|
||||
KUNIT_ASSERT_TRUE(test, info->is_hdmi);
|
||||
KUNIT_ASSERT_GT(test, info->max_tmds_clock, 0);
|
||||
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
preferred = find_preferred_mode(conn);
|
||||
KUNIT_ASSERT_NOT_NULL(test, preferred);
|
||||
|
||||
@@ -1532,8 +1530,9 @@ static void drm_test_check_output_bpc_format_display_8bpc_only(struct kunit *tes
|
||||
rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB);
|
||||
KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000);
|
||||
|
||||
drm = &priv->drm;
|
||||
crtc = priv->crtc;
|
||||
ctx = drm_kunit_helper_acquire_ctx_alloc(test);
|
||||
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx);
|
||||
|
||||
ret = light_up_connector(test, drm, crtc, conn, preferred, ctx);
|
||||
KUNIT_EXPECT_EQ(test, ret, 0);
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static u16 lerp_u16(u16 a, u16 b, s64 t)
|
||||
|
||||
s64 delta = drm_fixp_mul(b_fp - a_fp, t);
|
||||
|
||||
return drm_fixp2int(a_fp + delta);
|
||||
return drm_fixp2int_round(a_fp + delta);
|
||||
}
|
||||
|
||||
static s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value)
|
||||
|
||||
@@ -140,6 +140,7 @@ static const struct xpad_device {
|
||||
{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
|
||||
{ 0x044f, 0xd01e, "ThrustMaster, Inc. ESWAP X 2 ELDEN RING EDITION", 0, XTYPE_XBOXONE },
|
||||
{ 0x044f, 0x0f10, "Thrustmaster Modena GT Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x044f, 0xb326, "Thrustmaster Gamepad GP XID", 0, XTYPE_XBOX360 },
|
||||
{ 0x045e, 0x0202, "Microsoft X-Box pad v1 (US)", 0, XTYPE_XBOX },
|
||||
@@ -177,6 +178,7 @@ static const struct xpad_device {
|
||||
{ 0x06a3, 0x0200, "Saitek Racing Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x06a3, 0x0201, "Saitek Adrenalin", 0, XTYPE_XBOX },
|
||||
{ 0x06a3, 0xf51a, "Saitek P3600", 0, XTYPE_XBOX360 },
|
||||
{ 0x0738, 0x4503, "Mad Catz Racing Wheel", 0, XTYPE_XBOXONE },
|
||||
{ 0x0738, 0x4506, "Mad Catz 4506 Wireless Controller", 0, XTYPE_XBOX },
|
||||
{ 0x0738, 0x4516, "Mad Catz Control Pad", 0, XTYPE_XBOX },
|
||||
{ 0x0738, 0x4520, "Mad Catz Control Pad Pro", 0, XTYPE_XBOX },
|
||||
@@ -238,6 +240,7 @@ static const struct xpad_device {
|
||||
{ 0x0e6f, 0x0146, "Rock Candy Wired Controller for Xbox One", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0147, "PDP Marvel Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x015c, "PDP Xbox One Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x015d, "PDP Mirror's Edge Official Wired Controller for Xbox One", XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0161, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0162, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x0e6f, 0x0163, "PDP Xbox One Controller", 0, XTYPE_XBOXONE },
|
||||
@@ -276,12 +279,15 @@ static const struct xpad_device {
|
||||
{ 0x0f0d, 0x0078, "Hori Real Arcade Pro V Kai Xbox One", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
|
||||
{ 0x0f0d, 0x00c5, "Hori Fighting Commander ONE", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
|
||||
{ 0x0f0d, 0x00dc, "HORIPAD FPS for Nintendo Switch", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x0f0d, 0x0151, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE },
|
||||
{ 0x0f0d, 0x0152, "Hori Racing Wheel Overdrive for Xbox Series X", 0, XTYPE_XBOXONE },
|
||||
{ 0x0f30, 0x010b, "Philips Recoil", 0, XTYPE_XBOX },
|
||||
{ 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
|
||||
{ 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
|
||||
{ 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
|
||||
{ 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
|
||||
{ 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
|
||||
{ 0x10f5, 0x7005, "Turtle Beach Recon Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
|
||||
{ 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 },
|
||||
{ 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 },
|
||||
@@ -306,7 +312,7 @@ static const struct xpad_device {
|
||||
{ 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 },
|
||||
{ 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 },
|
||||
{ 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x1a86, 0xe310, "QH Electronics Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x1a86, 0xe310, "Legion Go S", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0130, "Ion Drum Rocker", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
@@ -343,6 +349,7 @@ static const struct xpad_device {
|
||||
{ 0x1bad, 0xfa01, "MadCatz GamePad", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
|
||||
{ 0x1ee9, 0x1590, "ZOTAC Gaming Zone", 0, XTYPE_XBOX360 },
|
||||
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
|
||||
{ 0x20d6, 0x281f, "PowerA Wired Controller For Xbox 360", 0, XTYPE_XBOX360 },
|
||||
@@ -366,6 +373,7 @@ static const struct xpad_device {
|
||||
{ 0x24c6, 0x5510, "Hori Fighting Commander ONE (Xbox 360/PC Mode)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x24c6, 0x551a, "PowerA FUSION Pro Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x24c6, 0x561a, "PowerA FUSION Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x24c6, 0x581a, "ThrustMaster XB1 Classic Controller", 0, XTYPE_XBOXONE },
|
||||
{ 0x24c6, 0x5b00, "ThrustMaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
|
||||
{ 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
|
||||
@@ -374,10 +382,15 @@ static const struct xpad_device {
|
||||
{ 0x2563, 0x058d, "OneXPlayer Gamepad", 0, XTYPE_XBOX360 },
|
||||
{ 0x294b, 0x3303, "Snakebyte GAMEPAD BASE X", 0, XTYPE_XBOXONE },
|
||||
{ 0x294b, 0x3404, "Snakebyte GAMEPAD RGB X", 0, XTYPE_XBOXONE },
|
||||
{ 0x2993, 0x2001, "TECNO Pocket Go", 0, XTYPE_XBOX360 },
|
||||
{ 0x2dc8, 0x2000, "8BitDo Pro 2 Wired Controller fox Xbox", 0, XTYPE_XBOXONE },
|
||||
{ 0x2dc8, 0x3106, "8BitDo Ultimate Wireless / Pro 2 Wired Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x2dc8, 0x3109, "8BitDo Ultimate Wireless Bluetooth", 0, XTYPE_XBOX360 },
|
||||
{ 0x2dc8, 0x310a, "8BitDo Ultimate 2C Wireless Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x2dc8, 0x6001, "8BitDo SN30 Pro", 0, XTYPE_XBOX360 },
|
||||
{ 0x2e24, 0x0652, "Hyperkin Duke X-Box One pad", 0, XTYPE_XBOXONE },
|
||||
{ 0x2e24, 0x1688, "Hyperkin X91 X-Box One pad", 0, XTYPE_XBOXONE },
|
||||
{ 0x2e95, 0x0504, "SCUF Gaming Controller", MAP_SELECT_BUTTON, XTYPE_XBOXONE },
|
||||
{ 0x31e3, 0x1100, "Wooting One", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
|
||||
@@ -385,11 +398,16 @@ static const struct xpad_device {
|
||||
{ 0x31e3, 0x1230, "Wooting Two HE (ARM)", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },
|
||||
{ 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },
|
||||
{ 0x3285, 0x0603, "Nacon Pro Compact controller for Xbox", 0, XTYPE_XBOXONE },
|
||||
{ 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
|
||||
{ 0x3285, 0x0614, "Nacon Pro Compact", 0, XTYPE_XBOXONE },
|
||||
{ 0x3285, 0x0646, "Nacon Pro Compact", 0, XTYPE_XBOXONE },
|
||||
{ 0x3285, 0x0662, "Nacon Revolution5 Pro", 0, XTYPE_XBOX360 },
|
||||
{ 0x3285, 0x0663, "Nacon Evol-X", 0, XTYPE_XBOXONE },
|
||||
{ 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 },
|
||||
{ 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE },
|
||||
{ 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x413d, 0x2104, "Black Shark Green Ghost Gamepad", 0, XTYPE_XBOX360 },
|
||||
{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
|
||||
{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
|
||||
};
|
||||
@@ -488,6 +506,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x03f0), /* HP HyperX Xbox 360 controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */
|
||||
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster Xbox 360 controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x044f), /* Thrustmaster Xbox One controllers */
|
||||
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft Xbox 360 controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft Xbox One controllers */
|
||||
XPAD_XBOX360_VENDOR(0x046d), /* Logitech Xbox 360-style controllers */
|
||||
@@ -519,8 +538,9 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
|
||||
XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */
|
||||
XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1a86), /* QH Electronics */
|
||||
XPAD_XBOX360_VENDOR(0x1a86), /* Nanjing Qinheng Microelectronics (WCH) */
|
||||
XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */
|
||||
XPAD_XBOX360_VENDOR(0x1ee9), /* ZOTAC Technology Limited */
|
||||
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2345), /* Machenike Controllers */
|
||||
@@ -528,17 +548,20 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2563), /* OneXPlayer Gamepad */
|
||||
XPAD_XBOX360_VENDOR(0x260d), /* Dareu H101 */
|
||||
XPAD_XBOXONE_VENDOR(0x294b), /* Snakebyte */
|
||||
XPAD_XBOXONE_VENDOR(0x294b), /* Snakebyte */
|
||||
XPAD_XBOX360_VENDOR(0x2993), /* TECNO Mobile */
|
||||
XPAD_XBOX360_VENDOR(0x2c22), /* Qanba Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller */
|
||||
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Pro 2 Wired Controller for Xbox */
|
||||
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke Xbox One pad */
|
||||
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2dc8), /* 8BitDo Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x2dc8), /* 8BitDo Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x2e95), /* SCUF Gaming Controller */
|
||||
XPAD_XBOX360_VENDOR(0x31e3), /* Wooting Keyboards */
|
||||
XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
|
||||
XPAD_XBOXONE_VENDOR(0x3285), /* Nacon Evol-X */
|
||||
XPAD_XBOX360_VENDOR(0x3537), /* GameSir Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x3537), /* GameSir Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x413d), /* Black Shark Green Ghost Controller */
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -691,7 +714,9 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
|
||||
XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
|
||||
XBOXONE_INIT_PKT(0x045e, 0x0b00, extra_input_packet_init),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_led_on),
|
||||
XBOXONE_INIT_PKT(0x20d6, 0xa01a, xboxone_pdp_led_on),
|
||||
XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_auth),
|
||||
XBOXONE_INIT_PKT(0x20d6, 0xa01a, xboxone_pdp_auth),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init),
|
||||
XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
|
||||
|
||||
@@ -100,11 +100,11 @@ enum iqs7222_reg_key_id {
|
||||
|
||||
enum iqs7222_reg_grp_id {
|
||||
IQS7222_REG_GRP_STAT,
|
||||
IQS7222_REG_GRP_FILT,
|
||||
IQS7222_REG_GRP_CYCLE,
|
||||
IQS7222_REG_GRP_GLBL,
|
||||
IQS7222_REG_GRP_BTN,
|
||||
IQS7222_REG_GRP_CHAN,
|
||||
IQS7222_REG_GRP_FILT,
|
||||
IQS7222_REG_GRP_SLDR,
|
||||
IQS7222_REG_GRP_TPAD,
|
||||
IQS7222_REG_GRP_GPIO,
|
||||
@@ -286,6 +286,7 @@ static const struct iqs7222_event_desc iqs7222_tp_events[] = {
|
||||
|
||||
struct iqs7222_reg_grp_desc {
|
||||
u16 base;
|
||||
u16 val_len;
|
||||
int num_row;
|
||||
int num_col;
|
||||
};
|
||||
@@ -342,6 +343,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAC00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -400,6 +402,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAC00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -454,6 +457,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xC400,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -496,6 +500,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xC400,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -543,6 +548,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAA00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -600,6 +606,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAA00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -656,6 +663,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAE00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -712,6 +720,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAE00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -768,6 +777,7 @@ static const struct iqs7222_dev_desc iqs7222_devs[] = {
|
||||
},
|
||||
[IQS7222_REG_GRP_FILT] = {
|
||||
.base = 0xAE00,
|
||||
.val_len = 3,
|
||||
.num_row = 1,
|
||||
.num_col = 2,
|
||||
},
|
||||
@@ -1604,7 +1614,7 @@ static int iqs7222_force_comms(struct iqs7222_private *iqs7222)
|
||||
}
|
||||
|
||||
static int iqs7222_read_burst(struct iqs7222_private *iqs7222,
|
||||
u16 reg, void *val, u16 num_val)
|
||||
u16 reg, void *val, u16 val_len)
|
||||
{
|
||||
u8 reg_buf[sizeof(__be16)];
|
||||
int ret, i;
|
||||
@@ -1619,7 +1629,7 @@ static int iqs7222_read_burst(struct iqs7222_private *iqs7222,
|
||||
{
|
||||
.addr = client->addr,
|
||||
.flags = I2C_M_RD,
|
||||
.len = num_val * sizeof(__le16),
|
||||
.len = val_len,
|
||||
.buf = (u8 *)val,
|
||||
},
|
||||
};
|
||||
@@ -1675,7 +1685,7 @@ static int iqs7222_read_word(struct iqs7222_private *iqs7222, u16 reg, u16 *val)
|
||||
__le16 val_buf;
|
||||
int error;
|
||||
|
||||
error = iqs7222_read_burst(iqs7222, reg, &val_buf, 1);
|
||||
error = iqs7222_read_burst(iqs7222, reg, &val_buf, sizeof(val_buf));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -1685,10 +1695,9 @@ static int iqs7222_read_word(struct iqs7222_private *iqs7222, u16 reg, u16 *val)
|
||||
}
|
||||
|
||||
static int iqs7222_write_burst(struct iqs7222_private *iqs7222,
|
||||
u16 reg, const void *val, u16 num_val)
|
||||
u16 reg, const void *val, u16 val_len)
|
||||
{
|
||||
int reg_len = reg > U8_MAX ? sizeof(reg) : sizeof(u8);
|
||||
int val_len = num_val * sizeof(__le16);
|
||||
int msg_len = reg_len + val_len;
|
||||
int ret, i;
|
||||
struct i2c_client *client = iqs7222->client;
|
||||
@@ -1747,7 +1756,7 @@ static int iqs7222_write_word(struct iqs7222_private *iqs7222, u16 reg, u16 val)
|
||||
{
|
||||
__le16 val_buf = cpu_to_le16(val);
|
||||
|
||||
return iqs7222_write_burst(iqs7222, reg, &val_buf, 1);
|
||||
return iqs7222_write_burst(iqs7222, reg, &val_buf, sizeof(val_buf));
|
||||
}
|
||||
|
||||
static int iqs7222_ati_trigger(struct iqs7222_private *iqs7222)
|
||||
@@ -1831,30 +1840,14 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
|
||||
|
||||
/*
|
||||
* Acknowledge reset before writing any registers in case the device
|
||||
* suffers a spurious reset during initialization. Because this step
|
||||
* may change the reserved fields of the second filter beta register,
|
||||
* its cache must be updated.
|
||||
*
|
||||
* Writing the second filter beta register, in turn, may clobber the
|
||||
* system status register. As such, the filter beta register pair is
|
||||
* written first to protect against this hazard.
|
||||
* suffers a spurious reset during initialization.
|
||||
*/
|
||||
if (dir == WRITE) {
|
||||
u16 reg = dev_desc->reg_grps[IQS7222_REG_GRP_FILT].base + 1;
|
||||
u16 filt_setup;
|
||||
|
||||
error = iqs7222_write_word(iqs7222, IQS7222_SYS_SETUP,
|
||||
iqs7222->sys_setup[0] |
|
||||
IQS7222_SYS_SETUP_ACK_RESET);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = iqs7222_read_word(iqs7222, reg, &filt_setup);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
iqs7222->filt_setup[1] &= GENMASK(7, 0);
|
||||
iqs7222->filt_setup[1] |= (filt_setup & ~GENMASK(7, 0));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1883,6 +1876,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
|
||||
int num_col = dev_desc->reg_grps[i].num_col;
|
||||
u16 reg = dev_desc->reg_grps[i].base;
|
||||
__le16 *val_buf;
|
||||
u16 val_len = dev_desc->reg_grps[i].val_len ? : num_col * sizeof(*val_buf);
|
||||
u16 *val;
|
||||
|
||||
if (!num_col)
|
||||
@@ -1900,7 +1894,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
|
||||
switch (dir) {
|
||||
case READ:
|
||||
error = iqs7222_read_burst(iqs7222, reg,
|
||||
val_buf, num_col);
|
||||
val_buf, val_len);
|
||||
for (k = 0; k < num_col; k++)
|
||||
val[k] = le16_to_cpu(val_buf[k]);
|
||||
break;
|
||||
@@ -1909,7 +1903,7 @@ static int iqs7222_dev_init(struct iqs7222_private *iqs7222, int dir)
|
||||
for (k = 0; k < num_col; k++)
|
||||
val_buf[k] = cpu_to_le16(val[k]);
|
||||
error = iqs7222_write_burst(iqs7222, reg,
|
||||
val_buf, num_col);
|
||||
val_buf, val_len);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1962,7 +1956,7 @@ static int iqs7222_dev_info(struct iqs7222_private *iqs7222)
|
||||
int error, i;
|
||||
|
||||
error = iqs7222_read_burst(iqs7222, IQS7222_PROD_NUM, dev_id,
|
||||
ARRAY_SIZE(dev_id));
|
||||
sizeof(dev_id));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
@@ -2917,7 +2911,7 @@ static int iqs7222_report(struct iqs7222_private *iqs7222)
|
||||
__le16 status[IQS7222_MAX_COLS_STAT];
|
||||
|
||||
error = iqs7222_read_burst(iqs7222, IQS7222_SYS_STATUS, status,
|
||||
num_stat);
|
||||
num_stat * sizeof(*status));
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
|
||||
@@ -1080,16 +1080,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/* Mivvy M310 */
|
||||
@@ -1159,9 +1157,7 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
},
|
||||
/*
|
||||
* A lot of modern Clevo barebones have touchpad and/or keyboard issues
|
||||
* after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
|
||||
* none of them have an external PS/2 port so this can safely be set for
|
||||
* all of them.
|
||||
* after suspend fixable with the forcenorestore quirk.
|
||||
* Clevo barebones come with board_vendor and/or system_vendor set to
|
||||
* either the very generic string "Notebook" and/or a different value
|
||||
* for each individual reseller. The only somewhat universal way to
|
||||
@@ -1171,29 +1167,25 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
@@ -1205,29 +1197,19 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
|
||||
* the keyboard very laggy for ~5 seconds after boot and
|
||||
* sometimes also after resume.
|
||||
* However both are required for the keyboard to not fail
|
||||
* completely sometimes after boot or resume.
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NHxxRZQ"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
/*
|
||||
* At least one modern Clevo barebone has the touchpad connected both
|
||||
@@ -1243,17 +1225,15 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
|
||||
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
|
||||
SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOAUX |
|
||||
SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
|
||||
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
|
||||
SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOAUX |
|
||||
SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
@@ -1265,8 +1245,13 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "P640RE"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
@@ -1277,16 +1262,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
@@ -1297,8 +1280,7 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
@@ -1309,8 +1291,7 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
@@ -1321,8 +1302,7 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
@@ -1333,22 +1313,43 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PB51RF"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PB71RD"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PC70DR"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "PCX0DX_GN20"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
/* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
|
||||
{
|
||||
@@ -1361,15 +1362,13 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
|
||||
},
|
||||
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
|
||||
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
|
||||
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
|
||||
},
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -1011,7 +1011,7 @@ static int ads7846_setup_pendown(struct spi_device *spi,
|
||||
if (pdata->get_pendown_state) {
|
||||
ts->get_pendown_state = pdata->get_pendown_state;
|
||||
} else {
|
||||
ts->gpio_pendown = gpiod_get(&spi->dev, "pendown", GPIOD_IN);
|
||||
ts->gpio_pendown = devm_gpiod_get(&spi->dev, "pendown", GPIOD_IN);
|
||||
if (IS_ERR(ts->gpio_pendown)) {
|
||||
dev_err(&spi->dev, "failed to request pendown GPIO\n");
|
||||
return PTR_ERR(ts->gpio_pendown);
|
||||
|
||||
@@ -165,7 +165,7 @@ struct goodix_berlin_core {
|
||||
struct device *dev;
|
||||
struct regmap *regmap;
|
||||
struct regulator *avdd;
|
||||
struct regulator *iovdd;
|
||||
struct regulator *vddio;
|
||||
struct gpio_desc *reset_gpio;
|
||||
struct touchscreen_properties props;
|
||||
struct goodix_berlin_fw_version fw_version;
|
||||
@@ -248,19 +248,19 @@ static int goodix_berlin_power_on(struct goodix_berlin_core *cd)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = regulator_enable(cd->iovdd);
|
||||
error = regulator_enable(cd->vddio);
|
||||
if (error) {
|
||||
dev_err(cd->dev, "Failed to enable iovdd: %d\n", error);
|
||||
dev_err(cd->dev, "Failed to enable vddio: %d\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Vendor waits 3ms for IOVDD to settle */
|
||||
/* Vendor waits 3ms for VDDIO to settle */
|
||||
usleep_range(3000, 3100);
|
||||
|
||||
error = regulator_enable(cd->avdd);
|
||||
if (error) {
|
||||
dev_err(cd->dev, "Failed to enable avdd: %d\n", error);
|
||||
goto err_iovdd_disable;
|
||||
goto err_vddio_disable;
|
||||
}
|
||||
|
||||
/* Vendor waits 15ms for IOVDD to settle */
|
||||
@@ -283,8 +283,8 @@ static int goodix_berlin_power_on(struct goodix_berlin_core *cd)
|
||||
err_dev_reset:
|
||||
gpiod_set_value_cansleep(cd->reset_gpio, 1);
|
||||
regulator_disable(cd->avdd);
|
||||
err_iovdd_disable:
|
||||
regulator_disable(cd->iovdd);
|
||||
err_vddio_disable:
|
||||
regulator_disable(cd->vddio);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ static void goodix_berlin_power_off(struct goodix_berlin_core *cd)
|
||||
{
|
||||
gpiod_set_value_cansleep(cd->reset_gpio, 1);
|
||||
regulator_disable(cd->avdd);
|
||||
regulator_disable(cd->iovdd);
|
||||
regulator_disable(cd->vddio);
|
||||
}
|
||||
|
||||
static int goodix_berlin_read_version(struct goodix_berlin_core *cd)
|
||||
@@ -744,10 +744,10 @@ int goodix_berlin_probe(struct device *dev, int irq, const struct input_id *id,
|
||||
return dev_err_probe(dev, PTR_ERR(cd->avdd),
|
||||
"Failed to request avdd regulator\n");
|
||||
|
||||
cd->iovdd = devm_regulator_get(dev, "iovdd");
|
||||
if (IS_ERR(cd->iovdd))
|
||||
return dev_err_probe(dev, PTR_ERR(cd->iovdd),
|
||||
"Failed to request iovdd regulator\n");
|
||||
cd->vddio = devm_regulator_get(dev, "vddio");
|
||||
if (IS_ERR(cd->vddio))
|
||||
return dev_err_probe(dev, PTR_ERR(cd->vddio),
|
||||
"Failed to request vddio regulator\n");
|
||||
|
||||
error = goodix_berlin_power_on(cd);
|
||||
if (error) {
|
||||
|
||||
@@ -220,7 +220,7 @@ static int mbim_rx_verify_nth16(struct mhi_mbim_context *mbim, struct sk_buff *s
|
||||
if (mbim->rx_seq + 1 != le16_to_cpu(nth16->wSequence) &&
|
||||
(mbim->rx_seq || le16_to_cpu(nth16->wSequence)) &&
|
||||
!(mbim->rx_seq == 0xffff && !le16_to_cpu(nth16->wSequence))) {
|
||||
net_err_ratelimited("sequence number glitch prev=%d curr=%d\n",
|
||||
net_dbg_ratelimited("sequence number glitch prev=%d curr=%d\n",
|
||||
mbim->rx_seq, le16_to_cpu(nth16->wSequence));
|
||||
}
|
||||
mbim->rx_seq = le16_to_cpu(nth16->wSequence);
|
||||
|
||||
@@ -1518,6 +1518,7 @@ static struct apple_nvme *apple_nvme_alloc(struct platform_device *pdev)
|
||||
|
||||
return anv;
|
||||
put_dev:
|
||||
apple_nvme_detach_genpd(anv);
|
||||
put_device(anv->dev);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
@@ -1551,6 +1552,7 @@ out_uninit_ctrl:
|
||||
nvme_uninit_ctrl(&anv->ctrl);
|
||||
out_put_ctrl:
|
||||
nvme_put_ctrl(&anv->ctrl);
|
||||
apple_nvme_detach_genpd(anv);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -562,8 +562,6 @@ bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
|
||||
switch (new_state) {
|
||||
case NVME_CTRL_LIVE:
|
||||
switch (old_state) {
|
||||
case NVME_CTRL_NEW:
|
||||
case NVME_CTRL_RESETTING:
|
||||
case NVME_CTRL_CONNECTING:
|
||||
changed = true;
|
||||
fallthrough;
|
||||
|
||||
@@ -3669,6 +3669,8 @@ static const struct pci_device_id nvme_id_table[] = {
|
||||
.driver_data = NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */
|
||||
.driver_data = NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_DEVICE(0x1dbe, 0x5216), /* Acer/INNOGRIT FA100/5216 NVMe SSD */
|
||||
.driver_data = NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */
|
||||
.driver_data = NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_DEVICE(0x1e49, 0x0021), /* ZHITAI TiPro5000 NVMe SSD */
|
||||
|
||||
+23
-10
@@ -996,6 +996,27 @@ out_err:
|
||||
nvmet_req_complete(&cmd->req, status);
|
||||
}
|
||||
|
||||
static bool nvmet_rdma_recv_not_live(struct nvmet_rdma_queue *queue,
|
||||
struct nvmet_rdma_rsp *rsp)
|
||||
{
|
||||
unsigned long flags;
|
||||
bool ret = true;
|
||||
|
||||
spin_lock_irqsave(&queue->state_lock, flags);
|
||||
/*
|
||||
* recheck queue state is not live to prevent a race condition
|
||||
* with RDMA_CM_EVENT_ESTABLISHED handler.
|
||||
*/
|
||||
if (queue->state == NVMET_RDMA_Q_LIVE)
|
||||
ret = false;
|
||||
else if (queue->state == NVMET_RDMA_Q_CONNECTING)
|
||||
list_add_tail(&rsp->wait_list, &queue->rsp_wait_list);
|
||||
else
|
||||
nvmet_rdma_put_rsp(rsp);
|
||||
spin_unlock_irqrestore(&queue->state_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
|
||||
{
|
||||
struct nvmet_rdma_cmd *cmd =
|
||||
@@ -1038,17 +1059,9 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc)
|
||||
rsp->n_rdma = 0;
|
||||
rsp->invalidate_rkey = 0;
|
||||
|
||||
if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) {
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&queue->state_lock, flags);
|
||||
if (queue->state == NVMET_RDMA_Q_CONNECTING)
|
||||
list_add_tail(&rsp->wait_list, &queue->rsp_wait_list);
|
||||
else
|
||||
nvmet_rdma_put_rsp(rsp);
|
||||
spin_unlock_irqrestore(&queue->state_lock, flags);
|
||||
if (unlikely(queue->state != NVMET_RDMA_Q_LIVE) &&
|
||||
nvmet_rdma_recv_not_live(queue, rsp))
|
||||
return;
|
||||
}
|
||||
|
||||
nvmet_rdma_handle_command(queue, rsp);
|
||||
}
|
||||
|
||||
@@ -423,6 +423,12 @@ static int phy_gmii_sel_init_ports(struct phy_gmii_sel_priv *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct regmap_config phy_gmii_sel_regmap_cfg = {
|
||||
.reg_bits = 32,
|
||||
.val_bits = 32,
|
||||
.reg_stride = 4,
|
||||
};
|
||||
|
||||
static int phy_gmii_sel_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
@@ -467,7 +473,14 @@ static int phy_gmii_sel_probe(struct platform_device *pdev)
|
||||
|
||||
priv->regmap = syscon_node_to_regmap(node->parent);
|
||||
if (IS_ERR(priv->regmap)) {
|
||||
priv->regmap = device_node_to_regmap(node);
|
||||
void __iomem *base;
|
||||
|
||||
base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(base))
|
||||
return dev_err_probe(dev, PTR_ERR(base),
|
||||
"failed to get base memory resource\n");
|
||||
|
||||
priv->regmap = regmap_init_mmio(dev, base, &phy_gmii_sel_regmap_cfg);
|
||||
if (IS_ERR(priv->regmap))
|
||||
return dev_err_probe(dev, PTR_ERR(priv->regmap),
|
||||
"Failed to get syscon\n");
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Author: Dan Scally <djrscally@gmail.com> */
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/array_size.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
@@ -55,7 +56,7 @@ static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *i
|
||||
|
||||
static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry,
|
||||
struct acpi_resource_gpio *agpio,
|
||||
const char *func, u32 polarity)
|
||||
const char *func, unsigned long gpio_flags)
|
||||
{
|
||||
char *path = agpio->resource_source.string_ptr;
|
||||
struct acpi_device *adev;
|
||||
@@ -70,14 +71,14 @@ static int skl_int3472_fill_gpiod_lookup(struct gpiod_lookup *table_entry,
|
||||
if (!adev)
|
||||
return -ENODEV;
|
||||
|
||||
*table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, polarity);
|
||||
*table_entry = GPIO_LOOKUP(acpi_dev_name(adev), agpio->pin_table[0], func, gpio_flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472,
|
||||
struct acpi_resource_gpio *agpio,
|
||||
const char *func, u32 polarity)
|
||||
const char *func, unsigned long gpio_flags)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -87,7 +88,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
|
||||
}
|
||||
|
||||
ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios],
|
||||
agpio, func, polarity);
|
||||
agpio, func, gpio_flags);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -100,7 +101,7 @@ static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int347
|
||||
static struct gpio_desc *
|
||||
skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
|
||||
struct acpi_resource_gpio *agpio,
|
||||
const char *func, u32 polarity)
|
||||
const char *func, unsigned long gpio_flags)
|
||||
{
|
||||
struct gpio_desc *desc;
|
||||
int ret;
|
||||
@@ -111,7 +112,7 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
lookup->dev_id = dev_name(int3472->dev);
|
||||
ret = skl_int3472_fill_gpiod_lookup(&lookup->table[0], agpio, func, polarity);
|
||||
ret = skl_int3472_fill_gpiod_lookup(&lookup->table[0], agpio, func, gpio_flags);
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
@@ -122,32 +123,76 @@ skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472,
|
||||
return desc;
|
||||
}
|
||||
|
||||
static void int3472_get_func_and_polarity(u8 type, const char **func, u32 *polarity)
|
||||
/**
|
||||
* struct int3472_gpio_map - Map GPIOs to whatever is expected by the
|
||||
* sensor driver (as in DT bindings)
|
||||
* @hid: The ACPI HID of the device without the instance number e.g. INT347E
|
||||
* @type_from: The GPIO type from ACPI ?SDT
|
||||
* @type_to: The assigned GPIO type, typically same as @type_from
|
||||
* @func: The function, e.g. "enable"
|
||||
* @polarity_low: GPIO_ACTIVE_LOW true if the @polarity_low is true,
|
||||
* GPIO_ACTIVE_HIGH otherwise
|
||||
*/
|
||||
struct int3472_gpio_map {
|
||||
const char *hid;
|
||||
u8 type_from;
|
||||
u8 type_to;
|
||||
bool polarity_low;
|
||||
const char *func;
|
||||
};
|
||||
|
||||
static const struct int3472_gpio_map int3472_gpio_map[] = {
|
||||
{ "INT347E", INT3472_GPIO_TYPE_RESET, INT3472_GPIO_TYPE_RESET, false, "enable" },
|
||||
};
|
||||
|
||||
static void int3472_get_func_and_polarity(struct acpi_device *adev, u8 *type,
|
||||
const char **func, unsigned long *gpio_flags)
|
||||
{
|
||||
switch (type) {
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(int3472_gpio_map); i++) {
|
||||
/*
|
||||
* Map the firmware-provided GPIO to whatever a driver expects
|
||||
* (as in DT bindings). First check if the type matches with the
|
||||
* GPIO map, then further check that the device _HID matches.
|
||||
*/
|
||||
if (*type != int3472_gpio_map[i].type_from)
|
||||
continue;
|
||||
|
||||
if (!acpi_dev_hid_uid_match(adev, int3472_gpio_map[i].hid, NULL))
|
||||
continue;
|
||||
|
||||
*type = int3472_gpio_map[i].type_to;
|
||||
*gpio_flags = int3472_gpio_map[i].polarity_low ?
|
||||
GPIO_ACTIVE_LOW : GPIO_ACTIVE_HIGH;
|
||||
*func = int3472_gpio_map[i].func;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (*type) {
|
||||
case INT3472_GPIO_TYPE_RESET:
|
||||
*func = "reset";
|
||||
*polarity = GPIO_ACTIVE_LOW;
|
||||
*gpio_flags = GPIO_ACTIVE_LOW;
|
||||
break;
|
||||
case INT3472_GPIO_TYPE_POWERDOWN:
|
||||
*func = "powerdown";
|
||||
*polarity = GPIO_ACTIVE_LOW;
|
||||
*gpio_flags = GPIO_ACTIVE_LOW;
|
||||
break;
|
||||
case INT3472_GPIO_TYPE_CLK_ENABLE:
|
||||
*func = "clk-enable";
|
||||
*polarity = GPIO_ACTIVE_HIGH;
|
||||
*gpio_flags = GPIO_ACTIVE_HIGH;
|
||||
break;
|
||||
case INT3472_GPIO_TYPE_PRIVACY_LED:
|
||||
*func = "privacy-led";
|
||||
*polarity = GPIO_ACTIVE_HIGH;
|
||||
*gpio_flags = GPIO_ACTIVE_HIGH;
|
||||
break;
|
||||
case INT3472_GPIO_TYPE_POWER_ENABLE:
|
||||
*func = "power-enable";
|
||||
*polarity = GPIO_ACTIVE_HIGH;
|
||||
*gpio_flags = GPIO_ACTIVE_HIGH;
|
||||
break;
|
||||
default:
|
||||
*func = "unknown";
|
||||
*polarity = GPIO_ACTIVE_HIGH;
|
||||
*gpio_flags = GPIO_ACTIVE_HIGH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -194,7 +239,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
|
||||
struct gpio_desc *gpio;
|
||||
const char *err_msg;
|
||||
const char *func;
|
||||
u32 polarity;
|
||||
unsigned long gpio_flags;
|
||||
int ret;
|
||||
|
||||
if (!acpi_gpio_get_io_resource(ares, &agpio))
|
||||
@@ -217,7 +262,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
|
||||
|
||||
type = FIELD_GET(INT3472_GPIO_DSM_TYPE, obj->integer.value);
|
||||
|
||||
int3472_get_func_and_polarity(type, &func, &polarity);
|
||||
int3472_get_func_and_polarity(int3472->sensor, &type, &func, &gpio_flags);
|
||||
|
||||
pin = FIELD_GET(INT3472_GPIO_DSM_PIN, obj->integer.value);
|
||||
if (pin != agpio->pin_table[0])
|
||||
@@ -227,16 +272,16 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
|
||||
|
||||
active_value = FIELD_GET(INT3472_GPIO_DSM_SENSOR_ON_VAL, obj->integer.value);
|
||||
if (!active_value)
|
||||
polarity ^= GPIO_ACTIVE_LOW;
|
||||
gpio_flags ^= GPIO_ACTIVE_LOW;
|
||||
|
||||
dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", func,
|
||||
agpio->resource_source.string_ptr, agpio->pin_table[0],
|
||||
str_high_low(polarity == GPIO_ACTIVE_HIGH));
|
||||
str_high_low(gpio_flags == GPIO_ACTIVE_HIGH));
|
||||
|
||||
switch (type) {
|
||||
case INT3472_GPIO_TYPE_RESET:
|
||||
case INT3472_GPIO_TYPE_POWERDOWN:
|
||||
ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, polarity);
|
||||
ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, gpio_flags);
|
||||
if (ret)
|
||||
err_msg = "Failed to map GPIO pin to sensor\n";
|
||||
|
||||
@@ -244,7 +289,7 @@ static int skl_int3472_handle_gpio_resources(struct acpi_resource *ares,
|
||||
case INT3472_GPIO_TYPE_CLK_ENABLE:
|
||||
case INT3472_GPIO_TYPE_PRIVACY_LED:
|
||||
case INT3472_GPIO_TYPE_POWER_ENABLE:
|
||||
gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, func, polarity);
|
||||
gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, func, gpio_flags);
|
||||
if (IS_ERR(gpio)) {
|
||||
ret = PTR_ERR(gpio);
|
||||
err_msg = "Failed to get GPIO\n";
|
||||
|
||||
@@ -7883,6 +7883,7 @@ static struct ibm_struct volume_driver_data = {
|
||||
|
||||
#define FAN_NS_CTRL_STATUS BIT(2) /* Bit which determines control is enabled or not */
|
||||
#define FAN_NS_CTRL BIT(4) /* Bit which determines control is by host or EC */
|
||||
#define FAN_CLOCK_TPM (22500*60) /* Ticks per minute for a 22.5 kHz clock */
|
||||
|
||||
enum { /* Fan control constants */
|
||||
fan_status_offset = 0x2f, /* EC register 0x2f */
|
||||
@@ -7938,6 +7939,7 @@ static int fan_watchdog_maxinterval;
|
||||
|
||||
static bool fan_with_ns_addr;
|
||||
static bool ecfw_with_fan_dec_rpm;
|
||||
static bool fan_speed_in_tpr;
|
||||
|
||||
static struct mutex fan_mutex;
|
||||
|
||||
@@ -8140,8 +8142,11 @@ static int fan_get_speed(unsigned int *speed)
|
||||
!acpi_ec_read(fan_rpm_offset + 1, &hi)))
|
||||
return -EIO;
|
||||
|
||||
if (likely(speed))
|
||||
if (likely(speed)) {
|
||||
*speed = (hi << 8) | lo;
|
||||
if (fan_speed_in_tpr && *speed != 0)
|
||||
*speed = FAN_CLOCK_TPM / *speed;
|
||||
}
|
||||
break;
|
||||
case TPACPI_FAN_RD_TPEC_NS:
|
||||
if (!acpi_ec_read(fan_rpm_status_ns, &lo))
|
||||
@@ -8174,8 +8179,11 @@ static int fan2_get_speed(unsigned int *speed)
|
||||
if (rc)
|
||||
return -EIO;
|
||||
|
||||
if (likely(speed))
|
||||
if (likely(speed)) {
|
||||
*speed = (hi << 8) | lo;
|
||||
if (fan_speed_in_tpr && *speed != 0)
|
||||
*speed = FAN_CLOCK_TPM / *speed;
|
||||
}
|
||||
break;
|
||||
|
||||
case TPACPI_FAN_RD_TPEC_NS:
|
||||
@@ -8786,6 +8794,7 @@ static const struct attribute_group fan_driver_attr_group = {
|
||||
#define TPACPI_FAN_NOFAN 0x0008 /* no fan available */
|
||||
#define TPACPI_FAN_NS 0x0010 /* For EC with non-Standard register addresses */
|
||||
#define TPACPI_FAN_DECRPM 0x0020 /* For ECFW's with RPM in register as decimal */
|
||||
#define TPACPI_FAN_TPR 0x0040 /* Fan speed is in Ticks Per Revolution */
|
||||
|
||||
static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
|
||||
TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
|
||||
@@ -8815,6 +8824,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
|
||||
TPACPI_Q_LNV3('R', '0', 'V', TPACPI_FAN_NS), /* 11e Gen5 KL-Y */
|
||||
TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */
|
||||
TPACPI_Q_LNV3('R', '0', 'Q', TPACPI_FAN_DECRPM),/* L480 */
|
||||
TPACPI_Q_LNV('8', 'F', TPACPI_FAN_TPR), /* ThinkPad x120e */
|
||||
};
|
||||
|
||||
static int __init fan_init(struct ibm_init_struct *iibm)
|
||||
@@ -8885,6 +8895,8 @@ static int __init fan_init(struct ibm_init_struct *iibm)
|
||||
|
||||
if (quirks & TPACPI_FAN_Q1)
|
||||
fan_quirk1_setup();
|
||||
if (quirks & TPACPI_FAN_TPR)
|
||||
fan_speed_in_tpr = true;
|
||||
/* Try and probe the 2nd fan */
|
||||
tp_features.second_fan = 1; /* needed for get_speed to work */
|
||||
res = fan2_get_speed(&speed);
|
||||
@@ -10318,6 +10330,10 @@ static struct ibm_struct proxsensor_driver_data = {
|
||||
#define DYTC_MODE_PSC_BALANCE 5 /* Default mode aka balanced */
|
||||
#define DYTC_MODE_PSC_PERFORM 7 /* High power mode aka performance */
|
||||
|
||||
#define DYTC_MODE_PSCV9_LOWPOWER 1 /* Low power mode */
|
||||
#define DYTC_MODE_PSCV9_BALANCE 3 /* Default mode aka balanced */
|
||||
#define DYTC_MODE_PSCV9_PERFORM 4 /* High power mode aka performance */
|
||||
|
||||
#define DYTC_ERR_MASK 0xF /* Bits 0-3 in cmd result are the error result */
|
||||
#define DYTC_ERR_SUCCESS 1 /* CMD completed successful */
|
||||
|
||||
@@ -10338,6 +10354,10 @@ static int dytc_capabilities;
|
||||
static bool dytc_mmc_get_available;
|
||||
static int profile_force;
|
||||
|
||||
static int platform_psc_profile_lowpower = DYTC_MODE_PSC_LOWPOWER;
|
||||
static int platform_psc_profile_balanced = DYTC_MODE_PSC_BALANCE;
|
||||
static int platform_psc_profile_performance = DYTC_MODE_PSC_PERFORM;
|
||||
|
||||
static int convert_dytc_to_profile(int funcmode, int dytcmode,
|
||||
enum platform_profile_option *profile)
|
||||
{
|
||||
@@ -10359,19 +10379,15 @@ static int convert_dytc_to_profile(int funcmode, int dytcmode,
|
||||
}
|
||||
return 0;
|
||||
case DYTC_FUNCTION_PSC:
|
||||
switch (dytcmode) {
|
||||
case DYTC_MODE_PSC_LOWPOWER:
|
||||
if (dytcmode == platform_psc_profile_lowpower)
|
||||
*profile = PLATFORM_PROFILE_LOW_POWER;
|
||||
break;
|
||||
case DYTC_MODE_PSC_BALANCE:
|
||||
else if (dytcmode == platform_psc_profile_balanced)
|
||||
*profile = PLATFORM_PROFILE_BALANCED;
|
||||
break;
|
||||
case DYTC_MODE_PSC_PERFORM:
|
||||
else if (dytcmode == platform_psc_profile_performance)
|
||||
*profile = PLATFORM_PROFILE_PERFORMANCE;
|
||||
break;
|
||||
default: /* Unknown mode */
|
||||
else
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
case DYTC_FUNCTION_AMT:
|
||||
/* For now return balanced. It's the closest we have to 'auto' */
|
||||
@@ -10392,19 +10408,19 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe
|
||||
if (dytc_capabilities & BIT(DYTC_FC_MMC))
|
||||
*perfmode = DYTC_MODE_MMC_LOWPOWER;
|
||||
else if (dytc_capabilities & BIT(DYTC_FC_PSC))
|
||||
*perfmode = DYTC_MODE_PSC_LOWPOWER;
|
||||
*perfmode = platform_psc_profile_lowpower;
|
||||
break;
|
||||
case PLATFORM_PROFILE_BALANCED:
|
||||
if (dytc_capabilities & BIT(DYTC_FC_MMC))
|
||||
*perfmode = DYTC_MODE_MMC_BALANCE;
|
||||
else if (dytc_capabilities & BIT(DYTC_FC_PSC))
|
||||
*perfmode = DYTC_MODE_PSC_BALANCE;
|
||||
*perfmode = platform_psc_profile_balanced;
|
||||
break;
|
||||
case PLATFORM_PROFILE_PERFORMANCE:
|
||||
if (dytc_capabilities & BIT(DYTC_FC_MMC))
|
||||
*perfmode = DYTC_MODE_MMC_PERFORM;
|
||||
else if (dytc_capabilities & BIT(DYTC_FC_PSC))
|
||||
*perfmode = DYTC_MODE_PSC_PERFORM;
|
||||
*perfmode = platform_psc_profile_performance;
|
||||
break;
|
||||
default: /* Unknown profile */
|
||||
return -EOPNOTSUPP;
|
||||
@@ -10593,6 +10609,7 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
|
||||
if (output & BIT(DYTC_QUERY_ENABLE_BIT))
|
||||
dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF;
|
||||
|
||||
dbg_printk(TPACPI_DBG_INIT, "DYTC version %d\n", dytc_version);
|
||||
/* Check DYTC is enabled and supports mode setting */
|
||||
if (dytc_version < 5)
|
||||
return -ENODEV;
|
||||
@@ -10631,6 +10648,11 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
|
||||
}
|
||||
} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) { /* PSC MODE */
|
||||
pr_debug("PSC is supported\n");
|
||||
if (dytc_version >= 9) { /* update profiles for DYTC 9 and up */
|
||||
platform_psc_profile_lowpower = DYTC_MODE_PSCV9_LOWPOWER;
|
||||
platform_psc_profile_balanced = DYTC_MODE_PSCV9_BALANCE;
|
||||
platform_psc_profile_performance = DYTC_MODE_PSCV9_PERFORM;
|
||||
}
|
||||
} else {
|
||||
dbg_printk(TPACPI_DBG_INIT, "No DYTC support available\n");
|
||||
return -ENODEV;
|
||||
|
||||
@@ -682,7 +682,8 @@ static int info_update(void)
|
||||
if (time_after(jiffies, chp_info_expires)) {
|
||||
/* Data is too old, update. */
|
||||
rc = sclp_chp_read_info(&chp_info);
|
||||
chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL ;
|
||||
if (!rc)
|
||||
chp_info_expires = jiffies + CHP_INFO_UPDATE_INTERVAL;
|
||||
}
|
||||
mutex_unlock(&info_lock);
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ struct time_in_idle {
|
||||
* @max_level: maximum cooling level. One less than total number of valid
|
||||
* cpufreq frequencies.
|
||||
* @em: Reference on the Energy Model of the device
|
||||
* @cdev: thermal_cooling_device pointer to keep track of the
|
||||
* registered cooling device.
|
||||
* @policy: cpufreq policy.
|
||||
* @cooling_ops: cpufreq callbacks to thermal cooling device ops
|
||||
* @idle_time: idle time stats
|
||||
|
||||
@@ -1079,6 +1079,20 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
/* GMC devices */
|
||||
{ USB_DEVICE(GMC_VID, GMC_Z216C_PID) },
|
||||
/* Altera USB Blaster 3 */
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6022_PID, 1) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6025_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6026_PID, 3) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_6029_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602A_PID, 3) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602C_PID, 1) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 1) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602D_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 1) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 2) },
|
||||
{ USB_DEVICE_INTERFACE_NUMBER(ALTERA_VID, ALTERA_UB3_602E_PID, 3) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -1612,3 +1612,16 @@
|
||||
*/
|
||||
#define GMC_VID 0x1cd7
|
||||
#define GMC_Z216C_PID 0x0217 /* GMC Z216C Adapter IR-USB */
|
||||
|
||||
/*
|
||||
* Altera USB Blaster 3 (http://www.altera.com).
|
||||
*/
|
||||
#define ALTERA_VID 0x09fb
|
||||
#define ALTERA_UB3_6022_PID 0x6022
|
||||
#define ALTERA_UB3_6025_PID 0x6025
|
||||
#define ALTERA_UB3_6026_PID 0x6026
|
||||
#define ALTERA_UB3_6029_PID 0x6029
|
||||
#define ALTERA_UB3_602A_PID 0x602a
|
||||
#define ALTERA_UB3_602C_PID 0x602c
|
||||
#define ALTERA_UB3_602D_PID 0x602d
|
||||
#define ALTERA_UB3_602E_PID 0x602e
|
||||
|
||||
+32
-16
@@ -1368,13 +1368,13 @@ static const struct usb_device_id option_ids[] = {
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990A (PCIe) */
|
||||
.driver_info = RSVD(0) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990 (rmnet) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1080, 0xff), /* Telit FE990A (rmnet) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990 (MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1081, 0xff), /* Telit FE990A (MBIM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1082, 0xff), /* Telit FE990 (RNDIS) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1082, 0xff), /* Telit FE990A (RNDIS) */
|
||||
.driver_info = NCTRL(2) | RSVD(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990 (ECM) */
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1083, 0xff), /* Telit FE990A (ECM) */
|
||||
.driver_info = NCTRL(0) | RSVD(1) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10a0, 0xff), /* Telit FN20C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(3) },
|
||||
@@ -1388,28 +1388,44 @@ static const struct usb_device_id option_ids[] = {
|
||||
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10aa, 0xff), /* Telit FN920C04 (MBIM) */
|
||||
.driver_info = NCTRL(3) | RSVD(4) | RSVD(5) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x30), /* Telit FE990B (rmnet) */
|
||||
.driver_info = NCTRL(5) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b0, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x30), /* Telit FE990B (MBIM) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b1, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x30), /* Telit FE990B (RNDIS) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b2, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x30), /* Telit FE990B (ECM) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10b3, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c0, 0xff), /* Telit FE910C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c4, 0xff), /* Telit FE910C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(3) },
|
||||
{ USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x10c8, 0xff), /* Telit FE910C04 (rmnet) */
|
||||
.driver_info = RSVD(0) | NCTRL(2) | RSVD(3) | RSVD(4) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x60) }, /* Telit FN990B (rmnet) */
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x40) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d0, 0x30),
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x30), /* Telit FN990B (rmnet) */
|
||||
.driver_info = NCTRL(5) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x60) }, /* Telit FN990B (MBIM) */
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x40) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d1, 0x30),
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d0, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x30), /* Telit FN990B (MBIM) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x60) }, /* Telit FN990B (RNDIS) */
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x40) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d2, 0x30),
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d1, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x30), /* Telit FN990B (RNDIS) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x60) }, /* Telit FN990B (ECM) */
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x40) },
|
||||
{ USB_DEVICE_INTERFACE_PROTOCOL(TELIT_VENDOR_ID, 0x10d3, 0x30),
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d2, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x30), /* Telit FN990B (ECM) */
|
||||
.driver_info = NCTRL(6) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x40) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x10d3, 0xff, 0xff, 0x60) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
|
||||
.driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
|
||||
{ USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
|
||||
|
||||
@@ -666,7 +666,7 @@ static struct vhost_worker *vhost_worker_create(struct vhost_dev *dev)
|
||||
|
||||
vtsk = vhost_task_create(vhost_run_work_list, vhost_worker_killed,
|
||||
worker, name);
|
||||
if (!vtsk)
|
||||
if (IS_ERR(vtsk))
|
||||
goto free_worker;
|
||||
|
||||
mutex_init(&worker->mutex);
|
||||
|
||||
@@ -113,7 +113,7 @@ static struct io_tlb_pool *xen_swiotlb_find_pool(struct device *dev,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
int xen_swiotlb_fixup(void *buf, unsigned long nslabs)
|
||||
int __init xen_swiotlb_fixup(void *buf, unsigned long nslabs)
|
||||
{
|
||||
int rc;
|
||||
unsigned int order = get_order(IO_TLB_SEGSIZE << IO_TLB_SHIFT);
|
||||
|
||||
+1
-1
@@ -1972,7 +1972,7 @@ static const char *fuse_get_link(struct dentry *dentry, struct inode *inode,
|
||||
#endif
|
||||
|
||||
if (fc->cache_symlinks)
|
||||
return page_get_link(dentry, inode, callback);
|
||||
return page_get_link_raw(dentry, inode, callback);
|
||||
|
||||
err = -ECHILD;
|
||||
if (!dentry)
|
||||
|
||||
+19
-5
@@ -5300,10 +5300,9 @@ const char *vfs_get_link(struct dentry *dentry, struct delayed_call *done)
|
||||
EXPORT_SYMBOL(vfs_get_link);
|
||||
|
||||
/* get the link contents into pagecache */
|
||||
const char *page_get_link(struct dentry *dentry, struct inode *inode,
|
||||
struct delayed_call *callback)
|
||||
static char *__page_get_link(struct dentry *dentry, struct inode *inode,
|
||||
struct delayed_call *callback)
|
||||
{
|
||||
char *kaddr;
|
||||
struct page *page;
|
||||
struct address_space *mapping = inode->i_mapping;
|
||||
|
||||
@@ -5322,8 +5321,23 @@ const char *page_get_link(struct dentry *dentry, struct inode *inode,
|
||||
}
|
||||
set_delayed_call(callback, page_put_link, page);
|
||||
BUG_ON(mapping_gfp_mask(mapping) & __GFP_HIGHMEM);
|
||||
kaddr = page_address(page);
|
||||
nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1);
|
||||
return page_address(page);
|
||||
}
|
||||
|
||||
const char *page_get_link_raw(struct dentry *dentry, struct inode *inode,
|
||||
struct delayed_call *callback)
|
||||
{
|
||||
return __page_get_link(dentry, inode, callback);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(page_get_link_raw);
|
||||
|
||||
const char *page_get_link(struct dentry *dentry, struct inode *inode,
|
||||
struct delayed_call *callback)
|
||||
{
|
||||
char *kaddr = __page_get_link(dentry, inode, callback);
|
||||
|
||||
if (!IS_ERR(kaddr))
|
||||
nd_terminate_link(kaddr, inode->i_size, PAGE_SIZE - 1);
|
||||
return kaddr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1193,6 +1193,19 @@ static int reparse_info_to_fattr(struct cifs_open_info_data *data,
|
||||
rc = server->ops->parse_reparse_point(cifs_sb,
|
||||
full_path,
|
||||
iov, data);
|
||||
/*
|
||||
* If the reparse point was not handled but it is the
|
||||
* name surrogate which points to directory, then treat
|
||||
* is as a new mount point. Name surrogate reparse point
|
||||
* represents another named entity in the system.
|
||||
*/
|
||||
if (rc == -EOPNOTSUPP &&
|
||||
IS_REPARSE_TAG_NAME_SURROGATE(data->reparse.tag) &&
|
||||
(le32_to_cpu(data->fi.Attributes) & ATTR_DIRECTORY)) {
|
||||
rc = 0;
|
||||
cifs_create_junction_fattr(fattr, sb);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -651,13 +651,17 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
|
||||
case IO_REPARSE_TAG_LX_FIFO:
|
||||
case IO_REPARSE_TAG_LX_CHR:
|
||||
case IO_REPARSE_TAG_LX_BLK:
|
||||
break;
|
||||
if (le16_to_cpu(buf->ReparseDataLength) != 0) {
|
||||
cifs_dbg(VFS, "srv returned malformed buffer for reparse point: 0x%08x\n",
|
||||
le32_to_cpu(buf->ReparseTag));
|
||||
return -EIO;
|
||||
}
|
||||
return 0;
|
||||
default:
|
||||
cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n",
|
||||
le32_to_cpu(buf->ReparseTag));
|
||||
break;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int smb2_parse_reparse_point(struct cifs_sb_info *cifs_sb,
|
||||
|
||||
@@ -159,6 +159,9 @@
|
||||
#define IO_REPARSE_TAG_LX_CHR 0x80000025
|
||||
#define IO_REPARSE_TAG_LX_BLK 0x80000026
|
||||
|
||||
/* If Name Surrogate Bit is set, the file or directory represents another named entity in the system. */
|
||||
#define IS_REPARSE_TAG_NAME_SURROGATE(tag) (!!((tag) & 0x20000000))
|
||||
|
||||
/* fsctl flags */
|
||||
/* If Flags is set to this value, the request is an FSCTL not ioctl request */
|
||||
#define SMB2_0_IOCTL_IS_FSCTL 0x00000001
|
||||
|
||||
@@ -3326,6 +3326,8 @@ extern const struct file_operations generic_ro_fops;
|
||||
|
||||
extern int readlink_copy(char __user *, int, const char *);
|
||||
extern int page_readlink(struct dentry *, char __user *, int);
|
||||
extern const char *page_get_link_raw(struct dentry *, struct inode *,
|
||||
struct delayed_call *);
|
||||
extern const char *page_get_link(struct dentry *, struct inode *,
|
||||
struct delayed_call *);
|
||||
extern void page_put_link(void *);
|
||||
|
||||
@@ -3133,6 +3133,7 @@
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_LNL_P 0xa828
|
||||
#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_BMG 0xe2f7
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_PTL_H 0xe328
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_PTL 0xe428
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_CML_R 0xf0c8
|
||||
#define PCI_DEVICE_ID_INTEL_HDA_RKL_S 0xf1c8
|
||||
|
||||
+18
-5
@@ -64,7 +64,7 @@ struct io_worker {
|
||||
|
||||
union {
|
||||
struct rcu_head rcu;
|
||||
struct work_struct work;
|
||||
struct delayed_work work;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -770,6 +770,18 @@ static inline bool io_should_retry_thread(struct io_worker *worker, long err)
|
||||
}
|
||||
}
|
||||
|
||||
static void queue_create_worker_retry(struct io_worker *worker)
|
||||
{
|
||||
/*
|
||||
* We only bother retrying because there's a chance that the
|
||||
* failure to create a worker is due to some temporary condition
|
||||
* in the forking task (e.g. outstanding signal); give the task
|
||||
* some time to clear that condition.
|
||||
*/
|
||||
schedule_delayed_work(&worker->work,
|
||||
msecs_to_jiffies(worker->init_retries * 5));
|
||||
}
|
||||
|
||||
static void create_worker_cont(struct callback_head *cb)
|
||||
{
|
||||
struct io_worker *worker;
|
||||
@@ -809,12 +821,13 @@ static void create_worker_cont(struct callback_head *cb)
|
||||
|
||||
/* re-create attempts grab a new worker ref, drop the existing one */
|
||||
io_worker_release(worker);
|
||||
schedule_work(&worker->work);
|
||||
queue_create_worker_retry(worker);
|
||||
}
|
||||
|
||||
static void io_workqueue_create(struct work_struct *work)
|
||||
{
|
||||
struct io_worker *worker = container_of(work, struct io_worker, work);
|
||||
struct io_worker *worker = container_of(work, struct io_worker,
|
||||
work.work);
|
||||
struct io_wq_acct *acct = io_wq_get_acct(worker);
|
||||
|
||||
if (!io_queue_worker_create(worker, acct, create_worker_cont))
|
||||
@@ -855,8 +868,8 @@ fail:
|
||||
kfree(worker);
|
||||
goto fail;
|
||||
} else {
|
||||
INIT_WORK(&worker->work, io_workqueue_create);
|
||||
schedule_work(&worker->work);
|
||||
INIT_DELAYED_WORK(&worker->work, io_workqueue_create);
|
||||
queue_create_worker_retry(worker);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
+2
-2
@@ -133,7 +133,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *),
|
||||
|
||||
vtsk = kzalloc(sizeof(*vtsk), GFP_KERNEL);
|
||||
if (!vtsk)
|
||||
return NULL;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
init_completion(&vtsk->exited);
|
||||
mutex_init(&vtsk->exit_mutex);
|
||||
vtsk->data = arg;
|
||||
@@ -145,7 +145,7 @@ struct vhost_task *vhost_task_create(bool (*fn)(void *),
|
||||
tsk = copy_process(NULL, 0, NUMA_NO_NODE, &args);
|
||||
if (IS_ERR(tsk)) {
|
||||
kfree(vtsk);
|
||||
return NULL;
|
||||
return ERR_PTR(PTR_ERR(tsk));
|
||||
}
|
||||
|
||||
vtsk->task = tsk;
|
||||
|
||||
@@ -949,6 +949,16 @@ static u8 l2cap_get_ident(struct l2cap_conn *conn)
|
||||
return id;
|
||||
}
|
||||
|
||||
static void l2cap_send_acl(struct l2cap_conn *conn, struct sk_buff *skb,
|
||||
u8 flags)
|
||||
{
|
||||
/* Check if the hcon still valid before attempting to send */
|
||||
if (hci_conn_valid(conn->hcon->hdev, conn->hcon))
|
||||
hci_send_acl(conn->hchan, skb, flags);
|
||||
else
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,
|
||||
void *data)
|
||||
{
|
||||
@@ -971,7 +981,7 @@ static void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len,
|
||||
bt_cb(skb)->force_active = BT_POWER_FORCE_ACTIVE_ON;
|
||||
skb->priority = HCI_PRIO_MAX;
|
||||
|
||||
hci_send_acl(conn->hchan, skb, flags);
|
||||
l2cap_send_acl(conn, skb, flags);
|
||||
}
|
||||
|
||||
static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
|
||||
@@ -1793,13 +1803,10 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
|
||||
|
||||
mutex_unlock(&conn->chan_lock);
|
||||
|
||||
hci_chan_del(conn->hchan);
|
||||
|
||||
if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
|
||||
cancel_delayed_work_sync(&conn->info_timer);
|
||||
|
||||
hcon->l2cap_data = NULL;
|
||||
conn->hchan = NULL;
|
||||
l2cap_conn_put(conn);
|
||||
}
|
||||
|
||||
@@ -1807,6 +1814,7 @@ static void l2cap_conn_free(struct kref *ref)
|
||||
{
|
||||
struct l2cap_conn *conn = container_of(ref, struct l2cap_conn, ref);
|
||||
|
||||
hci_chan_del(conn->hchan);
|
||||
hci_conn_put(conn->hcon);
|
||||
kfree(conn);
|
||||
}
|
||||
@@ -7471,14 +7479,33 @@ static void l2cap_recv_reset(struct l2cap_conn *conn)
|
||||
conn->rx_len = 0;
|
||||
}
|
||||
|
||||
static struct l2cap_conn *l2cap_conn_hold_unless_zero(struct l2cap_conn *c)
|
||||
{
|
||||
BT_DBG("conn %p orig refcnt %u", c, kref_read(&c->ref));
|
||||
|
||||
if (!kref_get_unless_zero(&c->ref))
|
||||
return NULL;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
||||
{
|
||||
struct l2cap_conn *conn = hcon->l2cap_data;
|
||||
struct l2cap_conn *conn;
|
||||
int len;
|
||||
|
||||
/* Lock hdev to access l2cap_data to avoid race with l2cap_conn_del */
|
||||
hci_dev_lock(hcon->hdev);
|
||||
|
||||
conn = hcon->l2cap_data;
|
||||
|
||||
if (!conn)
|
||||
conn = l2cap_conn_add(hcon);
|
||||
|
||||
conn = l2cap_conn_hold_unless_zero(conn);
|
||||
|
||||
hci_dev_unlock(hcon->hdev);
|
||||
|
||||
if (!conn)
|
||||
goto drop;
|
||||
|
||||
@@ -7570,6 +7597,8 @@ void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
|
||||
break;
|
||||
}
|
||||
|
||||
l2cap_conn_put(conn);
|
||||
|
||||
drop:
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
+1
-1
@@ -4619,7 +4619,7 @@ use_local_napi:
|
||||
* we have to raise NET_RX_SOFTIRQ.
|
||||
*/
|
||||
if (!sd->in_net_rx_action)
|
||||
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
|
||||
raise_softirq_irqoff(NET_RX_SOFTIRQ);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RPS
|
||||
|
||||
@@ -1194,6 +1194,8 @@ static inline void __mptcp_do_fallback(struct mptcp_sock *msk)
|
||||
pr_debug("TCP fallback already done (msk=%p)\n", msk);
|
||||
return;
|
||||
}
|
||||
if (WARN_ON_ONCE(!READ_ONCE(msk->allow_infinite_fallback)))
|
||||
return;
|
||||
set_bit(MPTCP_FALLBACK_DONE, &msk->flags);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -735,7 +735,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(
|
||||
* value SHOULD be the smallest TSN not acknowledged by the
|
||||
* receiver of the request plus 2^31.
|
||||
*/
|
||||
init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + (1 << 31);
|
||||
init_tsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + (1U << 31);
|
||||
sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL,
|
||||
init_tsn, GFP_ATOMIC);
|
||||
|
||||
|
||||
@@ -539,6 +539,11 @@ static const struct config_entry config_table[] = {
|
||||
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
|
||||
.device = PCI_DEVICE_ID_INTEL_HDA_PTL,
|
||||
},
|
||||
{
|
||||
.flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
|
||||
.device = PCI_DEVICE_ID_INTEL_HDA_PTL_H,
|
||||
},
|
||||
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
@@ -2508,6 +2508,8 @@ static const struct pci_device_id azx_ids[] = {
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_ARL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE) },
|
||||
/* Panther Lake */
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_PTL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) },
|
||||
/* Panther Lake-H */
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_PTL_H, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_LNL) },
|
||||
/* Apollolake (Broxton-P) */
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_APL, AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON) },
|
||||
/* Gemini-Lake */
|
||||
|
||||
@@ -11064,6 +11064,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1d72, 0x1945, "Redmi G", ALC256_FIXUP_ASUS_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1d72, 0x1947, "RedmiBook Air", ALC255_FIXUP_XIAOMI_HEADSET_MIC),
|
||||
SND_PCI_QUIRK(0x1f66, 0x0105, "Ayaneo Portable Game Player", ALC287_FIXUP_CS35L41_I2C_2),
|
||||
SND_PCI_QUIRK(0x2014, 0x800a, "Positivo ARN50", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
||||
SND_PCI_QUIRK(0x2782, 0x0214, "VAIO VJFE-CL", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
|
||||
SND_PCI_QUIRK(0x2782, 0x0228, "Infinix ZERO BOOK 13", ALC269VB_FIXUP_INFINIX_ZERO_BOOK_13),
|
||||
SND_PCI_QUIRK(0x2782, 0x0232, "CHUWI CoreBook XPro", ALC269VB_FIXUP_CHUWI_COREBOOK_XPRO),
|
||||
|
||||
@@ -967,7 +967,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case ARIZONA_OUT3L_ENA_SHIFT:
|
||||
case ARIZONA_OUT3R_ENA_SHIFT:
|
||||
priv->out_up_pending++;
|
||||
priv->out_up_delay += 17;
|
||||
priv->out_up_delay += 17000;
|
||||
break;
|
||||
case ARIZONA_OUT4L_ENA_SHIFT:
|
||||
case ARIZONA_OUT4R_ENA_SHIFT:
|
||||
@@ -977,7 +977,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case WM8997:
|
||||
break;
|
||||
default:
|
||||
priv->out_up_delay += 10;
|
||||
priv->out_up_delay += 10000;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -999,7 +999,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
if (!priv->out_up_pending && priv->out_up_delay) {
|
||||
dev_dbg(component->dev, "Power up delay: %d\n",
|
||||
priv->out_up_delay);
|
||||
msleep(priv->out_up_delay);
|
||||
fsleep(priv->out_up_delay);
|
||||
priv->out_up_delay = 0;
|
||||
}
|
||||
break;
|
||||
@@ -1017,7 +1017,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case ARIZONA_OUT3L_ENA_SHIFT:
|
||||
case ARIZONA_OUT3R_ENA_SHIFT:
|
||||
priv->out_down_pending++;
|
||||
priv->out_down_delay++;
|
||||
priv->out_down_delay += 1000;
|
||||
break;
|
||||
case ARIZONA_OUT4L_ENA_SHIFT:
|
||||
case ARIZONA_OUT4R_ENA_SHIFT:
|
||||
@@ -1028,10 +1028,10 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
break;
|
||||
case WM8998:
|
||||
case WM1814:
|
||||
priv->out_down_delay += 5;
|
||||
priv->out_down_delay += 5000;
|
||||
break;
|
||||
default:
|
||||
priv->out_down_delay++;
|
||||
priv->out_down_delay += 1000;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -1053,7 +1053,7 @@ int arizona_out_ev(struct snd_soc_dapm_widget *w,
|
||||
if (!priv->out_down_pending && priv->out_down_delay) {
|
||||
dev_dbg(component->dev, "Power down delay: %d\n",
|
||||
priv->out_down_delay);
|
||||
msleep(priv->out_down_delay);
|
||||
fsleep(priv->out_down_delay);
|
||||
priv->out_down_delay = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2322,10 +2322,10 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case CS42L92:
|
||||
case CS47L92:
|
||||
case CS47L93:
|
||||
out_up_delay = 6;
|
||||
out_up_delay = 6000;
|
||||
break;
|
||||
default:
|
||||
out_up_delay = 17;
|
||||
out_up_delay = 17000;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2356,7 +2356,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case MADERA_OUT3R_ENA_SHIFT:
|
||||
priv->out_up_pending--;
|
||||
if (!priv->out_up_pending) {
|
||||
msleep(priv->out_up_delay);
|
||||
fsleep(priv->out_up_delay);
|
||||
priv->out_up_delay = 0;
|
||||
}
|
||||
break;
|
||||
@@ -2375,7 +2375,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case MADERA_OUT3L_ENA_SHIFT:
|
||||
case MADERA_OUT3R_ENA_SHIFT:
|
||||
priv->out_down_pending++;
|
||||
priv->out_down_delay++;
|
||||
priv->out_down_delay += 1000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2392,7 +2392,7 @@ int madera_out_ev(struct snd_soc_dapm_widget *w,
|
||||
case MADERA_OUT3R_ENA_SHIFT:
|
||||
priv->out_down_pending--;
|
||||
if (!priv->out_down_pending) {
|
||||
msleep(priv->out_down_delay);
|
||||
fsleep(priv->out_down_delay);
|
||||
priv->out_down_delay = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -365,7 +365,7 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
{
|
||||
struct snd_soc_component *component = dai->component;
|
||||
struct tas2764_priv *tas2764 = snd_soc_component_get_drvdata(component);
|
||||
u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0;
|
||||
u8 tdm_rx_start_slot = 0, asi_cfg_0 = 0, asi_cfg_1 = 0, asi_cfg_4 = 0;
|
||||
int ret;
|
||||
|
||||
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
|
||||
@@ -374,12 +374,14 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
fallthrough;
|
||||
case SND_SOC_DAIFMT_NB_NF:
|
||||
asi_cfg_1 = TAS2764_TDM_CFG1_RX_RISING;
|
||||
asi_cfg_4 = TAS2764_TDM_CFG4_TX_FALLING;
|
||||
break;
|
||||
case SND_SOC_DAIFMT_IB_IF:
|
||||
asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START;
|
||||
fallthrough;
|
||||
case SND_SOC_DAIFMT_IB_NF:
|
||||
asi_cfg_1 = TAS2764_TDM_CFG1_RX_FALLING;
|
||||
asi_cfg_4 = TAS2764_TDM_CFG4_TX_RISING;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -389,6 +391,12 @@ static int tas2764_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = snd_soc_component_update_bits(component, TAS2764_TDM_CFG4,
|
||||
TAS2764_TDM_CFG4_TX_MASK,
|
||||
asi_cfg_4);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
|
||||
case SND_SOC_DAIFMT_I2S:
|
||||
asi_cfg_0 ^= TAS2764_TDM_CFG0_FRAME_START;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/* Power Control */
|
||||
#define TAS2764_PWR_CTRL TAS2764_REG(0X0, 0x02)
|
||||
#define TAS2764_PWR_CTRL_MASK GENMASK(1, 0)
|
||||
#define TAS2764_PWR_CTRL_MASK GENMASK(2, 0)
|
||||
#define TAS2764_PWR_CTRL_ACTIVE 0x0
|
||||
#define TAS2764_PWR_CTRL_MUTE BIT(0)
|
||||
#define TAS2764_PWR_CTRL_SHUTDOWN BIT(1)
|
||||
@@ -79,6 +79,12 @@
|
||||
#define TAS2764_TDM_CFG3_RXS_SHIFT 0x4
|
||||
#define TAS2764_TDM_CFG3_MASK GENMASK(3, 0)
|
||||
|
||||
/* TDM Configuration Reg4 */
|
||||
#define TAS2764_TDM_CFG4 TAS2764_REG(0X0, 0x0d)
|
||||
#define TAS2764_TDM_CFG4_TX_MASK BIT(0)
|
||||
#define TAS2764_TDM_CFG4_TX_RISING 0x0
|
||||
#define TAS2764_TDM_CFG4_TX_FALLING BIT(0)
|
||||
|
||||
/* TDM Configuration Reg5 */
|
||||
#define TAS2764_TDM_CFG5 TAS2764_REG(0X0, 0x0e)
|
||||
#define TAS2764_TDM_CFG5_VSNS_MASK BIT(6)
|
||||
|
||||
@@ -506,7 +506,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
|
||||
}
|
||||
|
||||
static DECLARE_TLV_DB_SCALE(tas2770_digital_tlv, 1100, 50, 0);
|
||||
static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -12750, 50, 0);
|
||||
static DECLARE_TLV_DB_SCALE(tas2770_playback_volume, -10050, 50, 0);
|
||||
|
||||
static const struct snd_kcontrol_new tas2770_snd_controls[] = {
|
||||
SOC_SINGLE_TLV("Speaker Playback Volume", TAS2770_PLAY_CFG_REG2,
|
||||
|
||||
@@ -302,7 +302,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w)
|
||||
} else {
|
||||
wseq = wm5110_no_dre_left_enable;
|
||||
nregs = ARRAY_SIZE(wm5110_no_dre_left_enable);
|
||||
priv->out_up_delay += 10;
|
||||
priv->out_up_delay += 10000;
|
||||
}
|
||||
break;
|
||||
case ARIZONA_OUT1R_ENA_SHIFT:
|
||||
@@ -312,7 +312,7 @@ static int wm5110_hp_pre_enable(struct snd_soc_dapm_widget *w)
|
||||
} else {
|
||||
wseq = wm5110_no_dre_right_enable;
|
||||
nregs = ARRAY_SIZE(wm5110_no_dre_right_enable);
|
||||
priv->out_up_delay += 10;
|
||||
priv->out_up_delay += 10000;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -338,7 +338,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w)
|
||||
snd_soc_component_update_bits(component,
|
||||
ARIZONA_SPARE_TRIGGERS,
|
||||
ARIZONA_WS_TRG1, 0);
|
||||
priv->out_down_delay += 27;
|
||||
priv->out_down_delay += 27000;
|
||||
}
|
||||
break;
|
||||
case ARIZONA_OUT1R_ENA_SHIFT:
|
||||
@@ -350,7 +350,7 @@ static int wm5110_hp_pre_disable(struct snd_soc_dapm_widget *w)
|
||||
snd_soc_component_update_bits(component,
|
||||
ARIZONA_SPARE_TRIGGERS,
|
||||
ARIZONA_WS_TRG2, 0);
|
||||
priv->out_down_delay += 27;
|
||||
priv->out_down_delay += 27000;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1097,6 +1097,7 @@ int graph_util_parse_dai(struct device *dev, struct device_node *ep,
|
||||
args.np = ep;
|
||||
dai = snd_soc_get_dai_via_args(&args);
|
||||
if (dai) {
|
||||
dlc->of_node = node;
|
||||
dlc->dai_name = snd_soc_dai_name_get(dai);
|
||||
dlc->dai_args = snd_soc_copy_dai_args(dev, &args);
|
||||
if (!dlc->dai_args)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <linux/soundwire/sdw.h>
|
||||
#include <linux/soundwire/sdw_type.h>
|
||||
#include <linux/soundwire/sdw_intel.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include "sof_sdw_common.h"
|
||||
#include "../../codecs/rt711.h"
|
||||
@@ -685,6 +686,23 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
|
||||
SND_PCI_QUIRK(0x1043, 0x1e13, "ASUS Zenbook S14", SOC_SDW_CODEC_MIC),
|
||||
{}
|
||||
};
|
||||
|
||||
static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
|
||||
{
|
||||
const struct snd_pci_quirk *quirk_entry;
|
||||
|
||||
quirk_entry = snd_pci_quirk_lookup_id(mach->mach_params.subsystem_vendor,
|
||||
mach->mach_params.subsystem_device,
|
||||
sof_sdw_ssid_quirk_table);
|
||||
|
||||
if (quirk_entry)
|
||||
sof_sdw_quirk = quirk_entry->value;
|
||||
}
|
||||
|
||||
static struct snd_soc_dai_link_component platform_component[] = {
|
||||
{
|
||||
/* name might be overridden during probe */
|
||||
@@ -1212,6 +1230,13 @@ static int mc_probe(struct platform_device *pdev)
|
||||
|
||||
snd_soc_card_set_drvdata(card, ctx);
|
||||
|
||||
if (mach->mach_params.subsystem_id_set) {
|
||||
snd_soc_card_set_pci_ssid(card,
|
||||
mach->mach_params.subsystem_vendor,
|
||||
mach->mach_params.subsystem_device);
|
||||
sof_sdw_check_ssid_quirk(mach);
|
||||
}
|
||||
|
||||
dmi_check_system(sof_sdw_quirk_table);
|
||||
|
||||
if (quirk_override != -1) {
|
||||
@@ -1227,12 +1252,6 @@ static int mc_probe(struct platform_device *pdev)
|
||||
for (i = 0; i < ctx->codec_info_list_count; i++)
|
||||
codec_info_list[i].amp_num = 0;
|
||||
|
||||
if (mach->mach_params.subsystem_id_set) {
|
||||
snd_soc_card_set_pci_ssid(card,
|
||||
mach->mach_params.subsystem_vendor,
|
||||
mach->mach_params.subsystem_device);
|
||||
}
|
||||
|
||||
ret = sof_card_dai_links_create(card);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@@ -297,7 +297,7 @@ static const struct snd_soc_acpi_adr_device rt1316_3_single_adr[] = {
|
||||
|
||||
static const struct snd_soc_acpi_adr_device rt1318_1_single_adr[] = {
|
||||
{
|
||||
.adr = 0x000130025D131801,
|
||||
.adr = 0x000130025D131801ull,
|
||||
.num_endpoints = 1,
|
||||
.endpoints = &single_endpoint,
|
||||
.name_prefix = "rt1318-1"
|
||||
|
||||
@@ -1758,20 +1758,6 @@ int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
struct rsnd_priv *priv = rsnd_io_to_priv(io);
|
||||
struct device *dev = rsnd_priv_to_dev(priv);
|
||||
|
||||
if (!runtime) {
|
||||
dev_warn(dev, "Can't update kctrl when idle\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg)
|
||||
{
|
||||
cfg->cfg.val = cfg->val;
|
||||
|
||||
@@ -742,7 +742,6 @@ struct rsnd_kctrl_cfg_s {
|
||||
#define rsnd_kctrl_vals(x) ((x).val) /* = (x).cfg.val[0] */
|
||||
|
||||
int rsnd_kctrl_accept_anytime(struct rsnd_dai_stream *io);
|
||||
int rsnd_kctrl_accept_runtime(struct rsnd_dai_stream *io);
|
||||
struct rsnd_kctrl_cfg *rsnd_kctrl_init_m(struct rsnd_kctrl_cfg_m *cfg);
|
||||
struct rsnd_kctrl_cfg *rsnd_kctrl_init_s(struct rsnd_kctrl_cfg_s *cfg);
|
||||
int rsnd_kctrl_new(struct rsnd_mod *mod,
|
||||
|
||||
+93
-23
@@ -35,6 +35,7 @@ struct rsnd_src {
|
||||
struct rsnd_mod *dma;
|
||||
struct rsnd_kctrl_cfg_s sen; /* sync convert enable */
|
||||
struct rsnd_kctrl_cfg_s sync; /* sync convert */
|
||||
u32 current_sync_rate;
|
||||
int irq;
|
||||
};
|
||||
|
||||
@@ -100,7 +101,7 @@ static u32 rsnd_src_convert_rate(struct rsnd_dai_stream *io,
|
||||
if (!rsnd_src_sync_is_enabled(mod))
|
||||
return rsnd_io_converted_rate(io);
|
||||
|
||||
convert_rate = src->sync.val;
|
||||
convert_rate = src->current_sync_rate;
|
||||
|
||||
if (!convert_rate)
|
||||
convert_rate = rsnd_io_converted_rate(io);
|
||||
@@ -201,13 +202,73 @@ static const u32 chan222222[] = {
|
||||
static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
|
||||
struct rsnd_mod *mod)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
|
||||
struct rsnd_src *src = rsnd_mod_to_src(mod);
|
||||
u32 fin, fout, new_rate;
|
||||
int inc, cnt, rate;
|
||||
u64 base, val;
|
||||
|
||||
if (!runtime)
|
||||
return;
|
||||
|
||||
if (!rsnd_src_sync_is_enabled(mod))
|
||||
return;
|
||||
|
||||
fin = rsnd_src_get_in_rate(priv, io);
|
||||
fout = rsnd_src_get_out_rate(priv, io);
|
||||
|
||||
new_rate = src->sync.val;
|
||||
|
||||
if (!new_rate)
|
||||
new_rate = fout;
|
||||
|
||||
/* Do nothing if no diff */
|
||||
if (new_rate == src->current_sync_rate)
|
||||
return;
|
||||
|
||||
/*
|
||||
* SRCm_IFSVR::INTIFS can change within 1%
|
||||
* see
|
||||
* SRCm_IFSVR::INTIFS Note
|
||||
*/
|
||||
inc = fout / 100;
|
||||
cnt = abs(new_rate - fout) / inc;
|
||||
if (fout > new_rate)
|
||||
inc *= -1;
|
||||
|
||||
/*
|
||||
* After start running SRC, we can update only SRC_IFSVR
|
||||
* for Synchronous Mode
|
||||
*/
|
||||
base = (u64)0x0400000 * fin;
|
||||
rate = fout;
|
||||
for (int i = 0; i < cnt; i++) {
|
||||
val = base;
|
||||
rate += inc;
|
||||
do_div(val, rate);
|
||||
|
||||
rsnd_mod_write(mod, SRC_IFSVR, val);
|
||||
}
|
||||
val = base;
|
||||
do_div(val, new_rate);
|
||||
|
||||
rsnd_mod_write(mod, SRC_IFSVR, val);
|
||||
|
||||
/* update current_sync_rate */
|
||||
src->current_sync_rate = new_rate;
|
||||
}
|
||||
|
||||
static void rsnd_src_init_convert_rate(struct rsnd_dai_stream *io,
|
||||
struct rsnd_mod *mod)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
|
||||
struct device *dev = rsnd_priv_to_dev(priv);
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
int is_play = rsnd_io_is_play(io);
|
||||
int use_src = 0;
|
||||
u32 fin, fout;
|
||||
u32 ifscr, fsrate, adinr;
|
||||
u32 ifscr, adinr;
|
||||
u32 cr, route;
|
||||
u32 i_busif, o_busif, tmp;
|
||||
const u32 *bsdsr_table;
|
||||
@@ -245,26 +306,15 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
|
||||
adinr = rsnd_get_adinr_bit(mod, io) | chan;
|
||||
|
||||
/*
|
||||
* SRC_IFSCR / SRC_IFSVR
|
||||
*/
|
||||
ifscr = 0;
|
||||
fsrate = 0;
|
||||
if (use_src) {
|
||||
u64 n;
|
||||
|
||||
ifscr = 1;
|
||||
n = (u64)0x0400000 * fin;
|
||||
do_div(n, fout);
|
||||
fsrate = n;
|
||||
}
|
||||
|
||||
/*
|
||||
* SRC_IFSCR
|
||||
* SRC_SRCCR / SRC_ROUTE_MODE0
|
||||
*/
|
||||
ifscr = 0;
|
||||
cr = 0x00011110;
|
||||
route = 0x0;
|
||||
if (use_src) {
|
||||
route = 0x1;
|
||||
ifscr = 0x1;
|
||||
|
||||
if (rsnd_src_sync_is_enabled(mod)) {
|
||||
cr |= 0x1;
|
||||
@@ -335,7 +385,6 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
|
||||
rsnd_mod_write(mod, SRC_SRCIR, 1); /* initialize */
|
||||
rsnd_mod_write(mod, SRC_ADINR, adinr);
|
||||
rsnd_mod_write(mod, SRC_IFSCR, ifscr);
|
||||
rsnd_mod_write(mod, SRC_IFSVR, fsrate);
|
||||
rsnd_mod_write(mod, SRC_SRCCR, cr);
|
||||
rsnd_mod_write(mod, SRC_BSDSR, bsdsr_table[idx]);
|
||||
rsnd_mod_write(mod, SRC_BSISR, bsisr_table[idx]);
|
||||
@@ -348,6 +397,9 @@ static void rsnd_src_set_convert_rate(struct rsnd_dai_stream *io,
|
||||
|
||||
rsnd_adg_set_src_timesel_gen2(mod, io, fin, fout);
|
||||
|
||||
/* update SRC_IFSVR */
|
||||
rsnd_src_set_convert_rate(io, mod);
|
||||
|
||||
return;
|
||||
|
||||
convert_rate_err:
|
||||
@@ -467,7 +519,8 @@ static int rsnd_src_init(struct rsnd_mod *mod,
|
||||
int ret;
|
||||
|
||||
/* reset sync convert_rate */
|
||||
src->sync.val = 0;
|
||||
src->sync.val =
|
||||
src->current_sync_rate = 0;
|
||||
|
||||
ret = rsnd_mod_power_on(mod);
|
||||
if (ret < 0)
|
||||
@@ -475,7 +528,7 @@ static int rsnd_src_init(struct rsnd_mod *mod,
|
||||
|
||||
rsnd_src_activation(mod);
|
||||
|
||||
rsnd_src_set_convert_rate(io, mod);
|
||||
rsnd_src_init_convert_rate(io, mod);
|
||||
|
||||
rsnd_src_status_clear(mod);
|
||||
|
||||
@@ -493,7 +546,8 @@ static int rsnd_src_quit(struct rsnd_mod *mod,
|
||||
rsnd_mod_power_off(mod);
|
||||
|
||||
/* reset sync convert_rate */
|
||||
src->sync.val = 0;
|
||||
src->sync.val =
|
||||
src->current_sync_rate = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -531,6 +585,22 @@ static irqreturn_t rsnd_src_interrupt(int irq, void *data)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static int rsnd_src_kctrl_accept_runtime(struct rsnd_dai_stream *io)
|
||||
{
|
||||
struct snd_pcm_runtime *runtime = rsnd_io_to_runtime(io);
|
||||
|
||||
if (!runtime) {
|
||||
struct rsnd_priv *priv = rsnd_io_to_priv(io);
|
||||
struct device *dev = rsnd_priv_to_dev(priv);
|
||||
|
||||
dev_warn(dev, "\"SRC Out Rate\" can use during running\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int rsnd_src_probe_(struct rsnd_mod *mod,
|
||||
struct rsnd_dai_stream *io,
|
||||
struct rsnd_priv *priv)
|
||||
@@ -585,7 +655,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod,
|
||||
"SRC Out Rate Switch" :
|
||||
"SRC In Rate Switch",
|
||||
rsnd_kctrl_accept_anytime,
|
||||
rsnd_src_set_convert_rate,
|
||||
rsnd_src_init_convert_rate,
|
||||
&src->sen, 1);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -594,7 +664,7 @@ static int rsnd_src_pcm_new(struct rsnd_mod *mod,
|
||||
rsnd_io_is_play(io) ?
|
||||
"SRC Out Rate" :
|
||||
"SRC In Rate",
|
||||
rsnd_kctrl_accept_runtime,
|
||||
rsnd_src_kctrl_accept_runtime,
|
||||
rsnd_src_set_convert_rate,
|
||||
&src->sync, 192000);
|
||||
|
||||
|
||||
@@ -336,7 +336,8 @@ static int rsnd_ssi_master_clk_start(struct rsnd_mod *mod,
|
||||
return 0;
|
||||
|
||||
rate_err:
|
||||
dev_err(dev, "unsupported clock rate\n");
|
||||
dev_err(dev, "unsupported clock rate (%d)\n", rate);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context)
|
||||
|
||||
if (sdev->first_boot && sdev->fw_state != SOF_FW_BOOT_COMPLETE) {
|
||||
acp_mailbox_read(sdev, sdev->dsp_box.offset, &status, sizeof(status));
|
||||
|
||||
if ((status & SOF_IPC_PANIC_MAGIC_MASK) == SOF_IPC_PANIC_MAGIC) {
|
||||
snd_sof_dsp_panic(sdev, sdev->dsp_box.offset + sizeof(status),
|
||||
true);
|
||||
@@ -188,13 +189,21 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context)
|
||||
|
||||
dsp_ack = snd_sof_dsp_read(sdev, ACP_DSP_BAR, ACP_SCRATCH_REG_0 + dsp_ack_write);
|
||||
if (dsp_ack) {
|
||||
spin_lock_irq(&sdev->ipc_lock);
|
||||
/* handle immediate reply from DSP core */
|
||||
acp_dsp_ipc_get_reply(sdev);
|
||||
snd_sof_ipc_reply(sdev, 0);
|
||||
/* set the done bit */
|
||||
acp_dsp_ipc_dsp_done(sdev);
|
||||
spin_unlock_irq(&sdev->ipc_lock);
|
||||
if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) {
|
||||
spin_lock_irq(&sdev->ipc_lock);
|
||||
|
||||
/* handle immediate reply from DSP core */
|
||||
acp_dsp_ipc_get_reply(sdev);
|
||||
snd_sof_ipc_reply(sdev, 0);
|
||||
/* set the done bit */
|
||||
acp_dsp_ipc_dsp_done(sdev);
|
||||
|
||||
spin_unlock_irq(&sdev->ipc_lock);
|
||||
} else {
|
||||
dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_BOOT_COMPLETE: %#x\n",
|
||||
dsp_ack);
|
||||
}
|
||||
|
||||
ipc_irq = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ MODULE_PARM_DESC(enable_fw_debug, "Enable Firmware debug");
|
||||
static struct acp_quirk_entry quirk_valve_galileo = {
|
||||
.signed_fw_image = true,
|
||||
.skip_iram_dram_size_mod = true,
|
||||
.post_fw_run_delay = true,
|
||||
};
|
||||
|
||||
const struct dmi_system_id acp_sof_quirk_table[] = {
|
||||
|
||||
@@ -220,6 +220,7 @@ struct sof_amd_acp_desc {
|
||||
struct acp_quirk_entry {
|
||||
bool signed_fw_image;
|
||||
bool skip_iram_dram_size_mod;
|
||||
bool post_fw_run_delay;
|
||||
};
|
||||
|
||||
/* Common device data struct for ACP devices */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* Hardware interface for Audio DSP on Vangogh platform
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
@@ -136,6 +137,20 @@ static struct snd_soc_dai_driver vangogh_sof_dai[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static int sof_vangogh_post_fw_run_delay(struct snd_sof_dev *sdev)
|
||||
{
|
||||
/*
|
||||
* Resuming from suspend in some cases my cause the DSP firmware
|
||||
* to enter an unrecoverable faulty state. Delaying a bit any host
|
||||
* to DSP transmission right after firmware boot completion seems
|
||||
* to resolve the issue.
|
||||
*/
|
||||
if (!sdev->first_boot)
|
||||
usleep_range(100, 150);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Vangogh ops */
|
||||
struct snd_sof_dsp_ops sof_vangogh_ops;
|
||||
EXPORT_SYMBOL_NS(sof_vangogh_ops, SND_SOC_SOF_AMD_COMMON);
|
||||
@@ -157,6 +172,9 @@ int sof_vangogh_ops_init(struct snd_sof_dev *sdev)
|
||||
|
||||
if (quirks->signed_fw_image)
|
||||
sof_vangogh_ops.load_firmware = acp_sof_load_signed_firmware;
|
||||
|
||||
if (quirks->post_fw_run_delay)
|
||||
sof_vangogh_ops.post_fw_run = sof_vangogh_post_fw_run_delay;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -454,6 +454,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(hda_codec_i915_exit, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
|
||||
|
||||
MODULE_SOFTDEP("pre: snd-hda-codec-hdmi");
|
||||
#endif
|
||||
|
||||
MODULE_LICENSE("Dual BSD/GPL");
|
||||
|
||||
@@ -1305,22 +1305,8 @@ struct snd_soc_acpi_mach *hda_machine_select(struct snd_sof_dev *sdev)
|
||||
/* report to machine driver if any DMICs are found */
|
||||
mach->mach_params.dmic_num = check_dmic_num(sdev);
|
||||
|
||||
if (sdw_mach_found) {
|
||||
/*
|
||||
* DMICs use up to 4 pins and are typically pin-muxed with SoundWire
|
||||
* link 2 and 3, or link 1 and 2, thus we only try to enable dmics
|
||||
* if all conditions are true:
|
||||
* a) 2 or fewer links are used by SoundWire
|
||||
* b) the NHLT table reports the presence of microphones
|
||||
*/
|
||||
if (hweight_long(mach->link_mask) <= 2)
|
||||
dmic_fixup = true;
|
||||
else
|
||||
mach->mach_params.dmic_num = 0;
|
||||
} else {
|
||||
if (mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER)
|
||||
dmic_fixup = true;
|
||||
}
|
||||
if (sdw_mach_found || mach->tplg_quirk_mask & SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER)
|
||||
dmic_fixup = true;
|
||||
|
||||
if (tplg_fixup &&
|
||||
dmic_fixup &&
|
||||
|
||||
@@ -50,6 +50,7 @@ static const struct sof_dev_desc ptl_desc = {
|
||||
/* PCI IDs */
|
||||
static const struct pci_device_id sof_pci_ids[] = {
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_PTL, &ptl_desc) }, /* PTL */
|
||||
{ PCI_DEVICE_DATA(INTEL, HDA_PTL_H, &ptl_desc) }, /* PTL-H */
|
||||
{ 0, }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, sof_pci_ids);
|
||||
|
||||
@@ -10,7 +10,7 @@ set -eu
|
||||
|
||||
STYLE_COMPONENT_ON="color=dodgerblue;style=bold"
|
||||
STYLE_COMPONENT_OFF="color=gray40;style=filled;fillcolor=gray90"
|
||||
STYLE_NODE_ON="shape=box,style=bold,color=green4"
|
||||
STYLE_NODE_ON="shape=box,style=bold,color=green4,fillcolor=white"
|
||||
STYLE_NODE_OFF="shape=box,style=filled,color=gray30,fillcolor=gray95"
|
||||
|
||||
# Print usage and exit
|
||||
|
||||
@@ -492,8 +492,8 @@ static void test_sockmap_skb_verdict_shutdown(void)
|
||||
if (!ASSERT_EQ(err, 1, "epoll_wait(fd)"))
|
||||
goto out_close;
|
||||
|
||||
n = recv(c1, &b, 1, SOCK_NONBLOCK);
|
||||
ASSERT_EQ(n, 0, "recv_timeout(fin)");
|
||||
n = recv(c1, &b, 1, MSG_DONTWAIT);
|
||||
ASSERT_EQ(n, 0, "recv(fin)");
|
||||
out_close:
|
||||
close(c1);
|
||||
close(p1);
|
||||
@@ -546,7 +546,7 @@ static void test_sockmap_skb_verdict_fionread(bool pass_prog)
|
||||
ASSERT_EQ(avail, expected, "ioctl(FIONREAD)");
|
||||
/* On DROP test there will be no data to read */
|
||||
if (pass_prog) {
|
||||
recvd = recv_timeout(c1, &buf, sizeof(buf), SOCK_NONBLOCK, IO_TIMEOUT_SEC);
|
||||
recvd = recv_timeout(c1, &buf, sizeof(buf), MSG_DONTWAIT, IO_TIMEOUT_SEC);
|
||||
ASSERT_EQ(recvd, sizeof(buf), "recv_timeout(c0)");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user