From: kernel test robot <lkp@intel.com>
To: Huacai Chen <chenhuacai@loongson.cn>,
Arnd Bergmann <arnd@arndb.de>,
Huacai Chen <chenhuacai@kernel.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Erik Kaneda <erik.kaneda@intel.com>
Cc: kbuild-all@lists.01.org, loongarch@lists.linux.dev,
linux-arch@vger.kernel.org, linux-acpi@vger.kernel.org,
Xuefeng Li <lixuefeng@loongson.cn>,
Jianmin Lv <lvjianmin@loongson.cn>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH 2/2] LoongArch: Add ACPI-based generic laptop driver
Date: Tue, 16 Aug 2022 02:40:06 +0800 [thread overview]
Message-ID: <202208160225.IH6Wo0jU-lkp@intel.com> (raw)
In-Reply-To: <20220815124803.3332991-2-chenhuacai@loongson.cn>
Hi Huacai,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on soc/for-next]
[also build test WARNING on linus/master v6.0-rc1 next-20220815]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Huacai-Chen/LoongArch-Add-CPU-HWMon-platform-driver/20220815-205142
base: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git for-next
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20220816/202208160225.IH6Wo0jU-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/a1d11c660bcd67e4483546b5b59b6cbe5c2a882f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Huacai-Chen/LoongArch-Add-CPU-HWMon-platform-driver/20220815-205142
git checkout a1d11c660bcd67e4483546b5b59b6cbe5c2a882f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/platform/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/platform/loongarch/generic-laptop.c:443:5: warning: no previous prototype for 'ec_get_brightness' [-Wmissing-prototypes]
443 | int ec_get_brightness(void)
| ^~~~~~~~~~~~~~~~~
>> drivers/platform/loongarch/generic-laptop.c:460:5: warning: no previous prototype for 'ec_set_brightness' [-Wmissing-prototypes]
460 | int ec_set_brightness(int level)
| ^~~~~~~~~~~~~~~~~
>> drivers/platform/loongarch/generic-laptop.c:475:5: warning: no previous prototype for 'ec_backlight_level' [-Wmissing-prototypes]
475 | int ec_backlight_level(u8 level)
| ^~~~~~~~~~~~~~~~~~
>> drivers/platform/loongarch/generic-laptop.c:546:5: warning: no previous prototype for 'turn_on_backlight' [-Wmissing-prototypes]
546 | int turn_on_backlight(void)
| ^~~~~~~~~~~~~~~~~
>> drivers/platform/loongarch/generic-laptop.c:562:5: warning: no previous prototype for 'turn_off_backlight' [-Wmissing-prototypes]
562 | int turn_off_backlight(void)
| ^~~~~~~~~~~~~~~~~~
vim +/ec_get_brightness +443 drivers/platform/loongarch/generic-laptop.c
442
> 443 int ec_get_brightness(void)
444 {
445 int status = 0;
446
447 if (!hkey_handle)
448 return -ENXIO;
449
450 if (!acpi_evalf(hkey_handle, &status, "ECBG", "d"))
451 return -EIO;
452
453 if (status < 0)
454 return status;
455
456 return status;
457 }
458 EXPORT_SYMBOL(ec_get_brightness);
459
> 460 int ec_set_brightness(int level)
461 {
462
463 int ret = 0;
464
465 if (!hkey_handle)
466 return -ENXIO;
467
468 if (!acpi_evalf(hkey_handle, NULL, "ECBS", "vd", level))
469 ret = -EIO;
470
471 return ret;
472 }
473 EXPORT_SYMBOL(ec_set_brightness);
474
> 475 int ec_backlight_level(u8 level)
476 {
477 int status = 0;
478
479 if (!hkey_handle)
480 return -ENXIO;
481
482 if (!acpi_evalf(hkey_handle, &status, "ECLL", "d"))
483 return -EIO;
484
485 if ((status < 0) || (level > status))
486 return status;
487
488 if (!acpi_evalf(hkey_handle, &status, "ECSL", "d"))
489 return -EIO;
490
491 if ((status < 0) || (level < status))
492 return status;
493
494 return level;
495 }
496 EXPORT_SYMBOL(ec_backlight_level);
497
498 static int loongson_laptop_backlight_update(struct backlight_device *bd)
499 {
500 int lvl = ec_backlight_level(bd->props.brightness);
501
502 if (lvl < 0)
503 return -EIO;
504 if (ec_set_brightness(lvl))
505 return -EIO;
506
507 return 0;
508 }
509
510 static int loongson_laptop_get_brightness(struct backlight_device *bd)
511 {
512 u8 level;
513
514 level = ec_get_brightness();
515 if (level < 0)
516 return -EIO;
517
518 return level;
519 }
520
521 static const struct backlight_ops backlight_laptop_ops = {
522 .update_status = loongson_laptop_backlight_update,
523 .get_brightness = loongson_laptop_get_brightness,
524 };
525
526 static int laptop_backlight_register(void)
527 {
528 int status = 0;
529 struct backlight_properties props;
530
531 memset(&props, 0, sizeof(props));
532 props.type = BACKLIGHT_PLATFORM;
533
534 if (!acpi_evalf(hkey_handle, &status, "ECLL", "d"))
535 return -EIO;
536
537 props.brightness = 1;
538 props.max_brightness = status;
539
540 backlight_device_register("loongson_laptop",
541 NULL, NULL, &backlight_laptop_ops, &props);
542
543 return 0;
544 }
545
> 546 int turn_on_backlight(void)
547 {
548 int status;
549 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
550 struct acpi_object_list args = { 1, &arg0 };
551
552 arg0.integer.value = 1;
553 status = acpi_evaluate_object(NULL, "\\BLSW", &args, NULL);
554 if (ACPI_FAILURE(status)) {
555 pr_info("Loongson lvds error: 0x%x\n", status);
556 return -ENODEV;
557 }
558
559 return 0;
560 }
561
> 562 int turn_off_backlight(void)
563 {
564 int status;
565 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
566 struct acpi_object_list args = { 1, &arg0 };
567
568 arg0.integer.value = 0;
569 status = acpi_evaluate_object(NULL, "\\BLSW", &args, NULL);
570 if (ACPI_FAILURE(status)) {
571 pr_info("Loongson lvds error: 0x%x\n", status);
572 return -ENODEV;
573 }
574
575 return 0;
576 }
577
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-08-15 19:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 12:48 [PATCH 1/2] LoongArch: Add CPU HWMon platform driver Huacai Chen
2022-08-15 12:48 ` [PATCH 2/2] LoongArch: Add ACPI-based generic laptop driver Huacai Chen
2022-08-15 18:40 ` kernel test robot [this message]
2022-08-15 19:11 ` Arnd Bergmann
2022-08-16 8:55 ` Huacai Chen
2022-08-16 9:05 ` Arnd Bergmann
2022-08-15 17:58 ` [PATCH 1/2] LoongArch: Add CPU HWMon platform driver kernel test robot
2022-08-16 6:59 ` Xi Ruoyao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202208160225.IH6Wo0jU-lkp@intel.com \
--to=lkp@intel.com \
--cc=arnd@arndb.de \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=erik.kaneda@intel.com \
--cc=jiaxun.yang@flygoat.com \
--cc=kbuild-all@lists.01.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=lvjianmin@loongson.cn \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox