Skip to content

Commit 976600c

Browse files
committed
Merge tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver fixes from Ilpo Järvinen: - tablet-mode-switch events fix - kernel-doc warning fixes * tag 'platform-drivers-x86-v6.7-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: intel_ips: fix kernel-doc formatting platform/x86: thinkpad_acpi: fix kernel-doc warnings platform/x86: intel-vbtn: Fix missing tablet-mode-switch events
2 parents c740261 + 7bcd032 commit 976600c

3 files changed

Lines changed: 41 additions & 14 deletions

File tree

drivers/platform/x86/intel/vbtn.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ struct intel_vbtn_priv {
7373
bool wakeup_mode;
7474
};
7575

76-
static void detect_tablet_mode(struct platform_device *device)
76+
static void detect_tablet_mode(struct device *dev)
7777
{
78-
struct intel_vbtn_priv *priv = dev_get_drvdata(&device->dev);
79-
acpi_handle handle = ACPI_HANDLE(&device->dev);
78+
struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
79+
acpi_handle handle = ACPI_HANDLE(dev);
8080
unsigned long long vgbs;
8181
acpi_status status;
8282
int m;
@@ -89,6 +89,8 @@ static void detect_tablet_mode(struct platform_device *device)
8989
input_report_switch(priv->switches_dev, SW_TABLET_MODE, m);
9090
m = (vgbs & VGBS_DOCK_MODE_FLAG) ? 1 : 0;
9191
input_report_switch(priv->switches_dev, SW_DOCK, m);
92+
93+
input_sync(priv->switches_dev);
9294
}
9395

9496
/*
@@ -134,7 +136,7 @@ static int intel_vbtn_input_setup(struct platform_device *device)
134136
priv->switches_dev->id.bustype = BUS_HOST;
135137

136138
if (priv->has_switches) {
137-
detect_tablet_mode(device);
139+
detect_tablet_mode(&device->dev);
138140

139141
ret = input_register_device(priv->switches_dev);
140142
if (ret)
@@ -198,6 +200,9 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
198200
autorelease = val && (!ke_rel || ke_rel->type == KE_IGNORE);
199201

200202
sparse_keymap_report_event(input_dev, event, val, autorelease);
203+
204+
/* Some devices need this to report further events */
205+
acpi_evaluate_object(handle, "VBDL", NULL, NULL);
201206
}
202207

203208
/*
@@ -352,7 +357,13 @@ static void intel_vbtn_pm_complete(struct device *dev)
352357

353358
static int intel_vbtn_pm_resume(struct device *dev)
354359
{
360+
struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
361+
355362
intel_vbtn_pm_complete(dev);
363+
364+
if (priv->has_switches)
365+
detect_tablet_mode(dev);
366+
356367
return 0;
357368
}
358369

drivers/platform/x86/intel_ips.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ static void ips_disable_gpu_turbo(struct ips_driver *ips)
590590
* @ips: IPS driver struct
591591
*
592592
* Check whether the MCP is over its thermal or power budget.
593+
*
594+
* Returns: %true if the temp or power has exceeded its maximum, else %false
593595
*/
594596
static bool mcp_exceeded(struct ips_driver *ips)
595597
{
@@ -619,6 +621,8 @@ static bool mcp_exceeded(struct ips_driver *ips)
619621
* @cpu: CPU number to check
620622
*
621623
* Check a given CPU's average temp or power is over its limit.
624+
*
625+
* Returns: %true if the temp or power has exceeded its maximum, else %false
622626
*/
623627
static bool cpu_exceeded(struct ips_driver *ips, int cpu)
624628
{
@@ -645,6 +649,8 @@ static bool cpu_exceeded(struct ips_driver *ips, int cpu)
645649
* @ips: IPS driver struct
646650
*
647651
* Check the MCH temp & power against their maximums.
652+
*
653+
* Returns: %true if the temp or power has exceeded its maximum, else %false
648654
*/
649655
static bool mch_exceeded(struct ips_driver *ips)
650656
{
@@ -742,12 +748,13 @@ static void update_turbo_limits(struct ips_driver *ips)
742748
* - down (at TDP limit)
743749
* - adjust both CPU and GPU down if possible
744750
*
745-
cpu+ gpu+ cpu+gpu- cpu-gpu+ cpu-gpu-
746-
cpu < gpu < cpu+gpu+ cpu+ gpu+ nothing
747-
cpu < gpu >= cpu+gpu-(mcp<) cpu+gpu-(mcp<) gpu- gpu-
748-
cpu >= gpu < cpu-gpu+(mcp<) cpu- cpu-gpu+(mcp<) cpu-
749-
cpu >= gpu >= cpu-gpu- cpu-gpu- cpu-gpu- cpu-gpu-
751+
* |cpu+ gpu+ cpu+gpu- cpu-gpu+ cpu-gpu-
752+
* cpu < gpu < |cpu+gpu+ cpu+ gpu+ nothing
753+
* cpu < gpu >= |cpu+gpu-(mcp<) cpu+gpu-(mcp<) gpu- gpu-
754+
* cpu >= gpu < |cpu-gpu+(mcp<) cpu- cpu-gpu+(mcp<) cpu-
755+
* cpu >= gpu >=|cpu-gpu- cpu-gpu- cpu-gpu- cpu-gpu-
750756
*
757+
* Returns: %0
751758
*/
752759
static int ips_adjust(void *data)
753760
{
@@ -935,11 +942,13 @@ static void monitor_timeout(struct timer_list *t)
935942
* @data: ips driver structure
936943
*
937944
* This is the main function for the IPS driver. It monitors power and
938-
* tempurature in the MCP and adjusts CPU and GPU power clams accordingly.
945+
* temperature in the MCP and adjusts CPU and GPU power clamps accordingly.
939946
*
940-
* We keep a 5s moving average of power consumption and tempurature. Using
947+
* We keep a 5s moving average of power consumption and temperature. Using
941948
* that data, along with CPU vs GPU preference, we adjust the power clamps
942949
* up or down.
950+
*
951+
* Returns: %0 on success or -errno on error
943952
*/
944953
static int ips_monitor(void *data)
945954
{
@@ -1146,6 +1155,8 @@ static void dump_thermal_info(struct ips_driver *ips)
11461155
* Handle temperature limit trigger events, generally by lowering the clamps.
11471156
* If we're at a critical limit, we clamp back to the lowest possible value
11481157
* to prevent emergency shutdown.
1158+
*
1159+
* Returns: IRQ_NONE or IRQ_HANDLED
11491160
*/
11501161
static irqreturn_t ips_irq_handler(int irq, void *arg)
11511162
{
@@ -1293,9 +1304,12 @@ static void ips_debugfs_init(struct ips_driver *ips)
12931304

12941305
/**
12951306
* ips_detect_cpu - detect whether CPU supports IPS
1307+
* @ips: IPS driver struct
12961308
*
12971309
* Walk our list and see if we're on a supported CPU. If we find one,
12981310
* return the limits for it.
1311+
*
1312+
* Returns: the &ips_mcp_limits struct that matches the boot CPU or %NULL
12991313
*/
13001314
static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
13011315
{
@@ -1352,6 +1366,8 @@ static struct ips_mcp_limits *ips_detect_cpu(struct ips_driver *ips)
13521366
* monitor and control graphics turbo mode. If we can find them, we can
13531367
* enable graphics turbo, otherwise we must disable it to avoid exceeding
13541368
* thermal and power limits in the MCP.
1369+
*
1370+
* Returns: %true if the required symbols are found, else %false
13551371
*/
13561372
static bool ips_get_i915_syms(struct ips_driver *ips)
13571373
{

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ struct tpacpi_quirk {
512512
* Iterates over a quirks list until one is found that matches the
513513
* ThinkPad's vendor, BIOS and EC model.
514514
*
515-
* Returns 0 if nothing matches, otherwise returns the quirks field of
515+
* Returns: %0 if nothing matches, otherwise returns the quirks field of
516516
* the matching &struct tpacpi_quirk entry.
517517
*
518-
* The match criteria is: vendor, ec and bios much match.
518+
* The match criteria is: vendor, ec and bios must match.
519519
*/
520520
static unsigned long __init tpacpi_check_quirks(
521521
const struct tpacpi_quirk *qlist,
@@ -9303,7 +9303,7 @@ static struct tpacpi_battery_driver_data battery_info;
93039303

93049304
/* ACPI helpers/functions/probes */
93059305

9306-
/**
9306+
/*
93079307
* This evaluates a ACPI method call specific to the battery
93089308
* ACPI extension. The specifics are that an error is marked
93099309
* in the 32rd bit of the response, so we just check that here.

0 commit comments

Comments
 (0)