Skip to content

Commit aa3979b

Browse files
committed
Merge branch 'bits/002-backports' into asahi-wip
2 parents 49c6abf + d5cd8a3 commit aa3979b

5 files changed

Lines changed: 30 additions & 14 deletions

File tree

drivers/hid/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,6 @@ config HID_LED
597597

598598
config HID_LENOVO
599599
tristate "Lenovo / Thinkpad devices"
600-
depends on ACPI
601-
select ACPI_PLATFORM_PROFILE
602600
select NEW_LEDS
603601
select LEDS_CLASS
604602
help

drivers/hid/hid-lenovo.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#include <linux/leds.h>
3333
#include <linux/workqueue.h>
3434

35-
#include <linux/platform_profile.h>
36-
3735
#include "hid-ids.h"
3836

3937
/* Userspace expects F20 for mic-mute KEY_MICMUTE does not work */
@@ -734,7 +732,7 @@ static int lenovo_raw_event_TP_X12_tab(struct hid_device *hdev, u32 raw_data)
734732
report_key_event(input, KEY_RFKILL);
735733
return 1;
736734
}
737-
platform_profile_cycle();
735+
report_key_event(input, KEY_PERFORMANCE);
738736
return 1;
739737
case TP_X12_RAW_HOTKEY_FN_F10:
740738
/* TAB1 has PICKUP Phone and TAB2 use Snipping tool*/

drivers/nvmem/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,12 +1618,14 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell_entry *cell, void
16181618
*p = *b++ >> bit_offset;
16191619

16201620
/* setup rest of the bytes if any */
1621-
for (i = 1; i < cell->bytes; i++) {
1621+
for (i = 1; i < (cell->bytes - bytes_offset); i++) {
16221622
/* Get bits from next byte and shift them towards msb */
16231623
*p++ |= *b << (BITS_PER_BYTE - bit_offset);
16241624

16251625
*p = *b++ >> bit_offset;
16261626
}
1627+
/* point to end of the buffer unused bits will be cleared */
1628+
p = buf + cell->bytes - 1;
16271629
} else if (p != b) {
16281630
memmove(p, b, cell->bytes - bytes_offset);
16291631
p += cell->bytes - 1;

drivers/video/fbdev/simplefb.c

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct simplefb_par {
9393

9494
static void simplefb_clocks_destroy(struct simplefb_par *par);
9595
static void simplefb_regulators_destroy(struct simplefb_par *par);
96+
static void simplefb_detach_genpds(void *res);
9697

9798
/*
9899
* fb_ops.fb_destroy is called by the last put_fb_info() call at the end
@@ -105,6 +106,7 @@ static void simplefb_destroy(struct fb_info *info)
105106

106107
simplefb_regulators_destroy(info->par);
107108
simplefb_clocks_destroy(info->par);
109+
simplefb_detach_genpds(info->par);
108110
if (info->screen_base)
109111
iounmap(info->screen_base);
110112

@@ -454,13 +456,14 @@ static void simplefb_detach_genpds(void *res)
454456
if (!IS_ERR_OR_NULL(par->genpds[i]))
455457
dev_pm_domain_detach(par->genpds[i], true);
456458
}
459+
par->num_genpds = 0;
457460
}
458461

459462
static int simplefb_attach_genpds(struct simplefb_par *par,
460463
struct platform_device *pdev)
461464
{
462465
struct device *dev = &pdev->dev;
463-
unsigned int i;
466+
unsigned int i, num_genpds;
464467
int err;
465468

466469
err = of_count_phandle_with_args(dev->of_node, "power-domains",
@@ -474,26 +477,35 @@ static int simplefb_attach_genpds(struct simplefb_par *par,
474477
return err;
475478
}
476479

477-
par->num_genpds = err;
480+
num_genpds = err;
478481

479482
/*
480483
* Single power-domain devices are handled by the driver core, so
481484
* nothing to do here.
482485
*/
483-
if (par->num_genpds <= 1)
486+
if (num_genpds <= 1) {
487+
par->num_genpds = num_genpds;
484488
return 0;
489+
}
485490

486-
par->genpds = devm_kcalloc(dev, par->num_genpds, sizeof(*par->genpds),
491+
par->genpds = devm_kcalloc(dev, num_genpds, sizeof(*par->genpds),
487492
GFP_KERNEL);
488493
if (!par->genpds)
489494
return -ENOMEM;
490495

491-
par->genpd_links = devm_kcalloc(dev, par->num_genpds,
496+
par->genpd_links = devm_kcalloc(dev, num_genpds,
492497
sizeof(*par->genpd_links),
493498
GFP_KERNEL);
494499
if (!par->genpd_links)
495500
return -ENOMEM;
496501

502+
/*
503+
* Set par->num_genpds only after genpds and genpd_links are allocated
504+
* to exit early from simplefb_detach_genpds() without full
505+
* initialisation.
506+
*/
507+
par->num_genpds = num_genpds;
508+
497509
for (i = 0; i < par->num_genpds; i++) {
498510
par->genpds[i] = dev_pm_domain_attach_by_id(dev, i);
499511
if (IS_ERR(par->genpds[i])) {
@@ -515,9 +527,10 @@ static int simplefb_attach_genpds(struct simplefb_par *par,
515527
dev_warn(dev, "failed to link power-domain %u\n", i);
516528
}
517529

518-
return devm_add_action_or_reset(dev, simplefb_detach_genpds, par);
530+
return 0;
519531
}
520532
#else
533+
static void simplefb_detach_genpds(void *res) { }
521534
static int simplefb_attach_genpds(struct simplefb_par *par,
522535
struct platform_device *pdev)
523536
{
@@ -631,18 +644,20 @@ static int simplefb_probe(struct platform_device *pdev)
631644
ret = devm_aperture_acquire_for_platform_device(pdev, par->base, par->size);
632645
if (ret) {
633646
dev_err(&pdev->dev, "Unable to acquire aperture: %d\n", ret);
634-
goto error_regulators;
647+
goto error_genpds;
635648
}
636649
ret = register_framebuffer(info);
637650
if (ret < 0) {
638651
dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
639-
goto error_regulators;
652+
goto error_genpds;
640653
}
641654

642655
dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
643656

644657
return 0;
645658

659+
error_genpds:
660+
simplefb_detach_genpds(par);
646661
error_regulators:
647662
simplefb_regulators_destroy(par);
648663
error_clocks:

include/uapi/linux/input-event-codes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,9 @@
765765
#define KEY_KBD_LCD_MENU4 0x2bb
766766
#define KEY_KBD_LCD_MENU5 0x2bc
767767

768+
/* Performance Boost key (Alienware)/G-Mode key (Dell) */
769+
#define KEY_PERFORMANCE 0x2bd
770+
768771
#define BTN_TRIGGER_HAPPY 0x2c0
769772
#define BTN_TRIGGER_HAPPY1 0x2c0
770773
#define BTN_TRIGGER_HAPPY2 0x2c1

0 commit comments

Comments
 (0)