From: kernel test robot <lkp@intel.com>
To: Julius Zint <julius@zint.sh>, Lee Jones <lee@kernel.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, Helge Deller <deller@gmx.de>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, Julius Zint <julius@zint.sh>
Subject: Re: [PATCH 1/1] backlight: apple_bl_usb: Add Apple Studio Display support
Date: Sat, 1 Jul 2023 22:00:53 +0800 [thread overview]
Message-ID: <202307012107.OW4d1gBR-lkp@intel.com> (raw)
In-Reply-To: <20230701120806.11812-2-julius@zint.sh>
Hi Julius,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-backlight/for-backlight-next]
[also build test WARNING on lee-leds/for-leds-next drm-misc/drm-misc-next drm-tip/drm-tip linus/master v6.4 next-20230630]
[cannot apply to lee-backlight/for-backlight-fixes]
[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/Julius-Zint/backlight-apple_bl_usb-Add-Apple-Studio-Display-support/20230701-202142
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight.git for-backlight-next
patch link: https://lore.kernel.org/r/20230701120806.11812-2-julius%40zint.sh
patch subject: [PATCH 1/1] backlight: apple_bl_usb: Add Apple Studio Display support
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20230701/202307012107.OW4d1gBR-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230701/202307012107.OW4d1gBR-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307012107.OW4d1gBR-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/video/backlight/apple_bl_usb.c:27:6: warning: no previous prototype for 'init_ctrl_msg_data' [-Wmissing-prototypes]
27 | void init_ctrl_msg_data(struct brightness_ctrl_message_data *msg)
| ^~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:33:6: warning: no previous prototype for 'set_ctrl_message_brightness' [-Wmissing-prototypes]
33 | void set_ctrl_message_brightness(struct brightness_ctrl_message_data *msg,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:39:5: warning: no previous prototype for 'get_ctrl_message_brightness' [-Wmissing-prototypes]
39 | u16 get_ctrl_message_brightness(struct brightness_ctrl_message_data *msg)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:44:5: warning: no previous prototype for 'apple_bl_usb_usb_get_brightness' [-Wmissing-prototypes]
44 | int apple_bl_usb_usb_get_brightness(struct usb_interface *interface,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:79:5: warning: no previous prototype for 'apple_bl_usb_usb_set_brightness' [-Wmissing-prototypes]
79 | int apple_bl_usb_usb_set_brightness(struct usb_interface *interface,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:113:5: warning: no previous prototype for 'apple_bl_usb_check_fb' [-Wmissing-prototypes]
113 | int apple_bl_usb_check_fb(struct backlight_device *bd, struct fb_info *info)
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:119:5: warning: no previous prototype for 'apple_bl_usb_get_brightness' [-Wmissing-prototypes]
119 | int apple_bl_usb_get_brightness(struct backlight_device *bl)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/video/backlight/apple_bl_usb.c:135:5: warning: no previous prototype for 'apple_bl_usb_update_status' [-Wmissing-prototypes]
135 | int apple_bl_usb_update_status(struct backlight_device *bl)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/init_ctrl_msg_data +27 drivers/video/backlight/apple_bl_usb.c
26
> 27 void init_ctrl_msg_data(struct brightness_ctrl_message_data *msg)
28 {
29 memset(msg, 0, sizeof(struct brightness_ctrl_message_data));
30 msg->unknown_1 = 0x01;
31 }
32
> 33 void set_ctrl_message_brightness(struct brightness_ctrl_message_data *msg,
34 u16 brightness_value)
35 {
36 msg->brightness = cpu_to_le16(brightness_value + 400);
37 }
38
> 39 u16 get_ctrl_message_brightness(struct brightness_ctrl_message_data *msg)
40 {
41 return le16_to_cpu(msg->brightness) - 400;
42 }
43
> 44 int apple_bl_usb_usb_get_brightness(struct usb_interface *interface,
45 struct usb_device *usb_dev,
46 int *brightness)
47 {
48 int err;
49 u16 interface_nr;
50 int msg_data_size;
51 struct brightness_ctrl_message_data *msg_data;
52
53 msg_data_size = sizeof(struct brightness_ctrl_message_data);
54 msg_data = kzalloc(msg_data_size, GFP_KERNEL);
55 memset(msg_data, 0x00, msg_data_size);
56 interface_nr = interface->cur_altsetting->desc.bInterfaceNumber;
57
58 err = usb_control_msg(usb_dev,
59 usb_rcvctrlpipe(usb_dev, 0),
60 HID_GET_REPORT,
61 USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
62 /* wValue: HID-Report Type and Report ID */
63 HID_REPORT_TYPE_FEATURE | 0x01,
64 interface_nr /* wIndex */,
65 msg_data,
66 msg_data_size,
67 HZ);
68 if (err < 0) {
69 dev_err(&interface->dev,
70 "get: usb control message err: %d\n",
71 err);
72 }
73 *brightness = get_ctrl_message_brightness(msg_data);
74 kfree(msg_data);
75 dev_dbg(&interface->dev, "get brightness: %d\n", *brightness);
76 return 0;
77 }
78
> 79 int apple_bl_usb_usb_set_brightness(struct usb_interface *interface,
80 struct usb_device *usb_dev,
81 int brightness)
82 {
83 int err;
84 u16 interface_nr;
85 struct brightness_ctrl_message_data *msg_data;
86
87 msg_data = kzalloc(sizeof(struct brightness_ctrl_message_data), GFP_KERNEL);
88 interface_nr = interface->cur_altsetting->desc.bInterfaceNumber;
89 init_ctrl_msg_data(msg_data);
90 set_ctrl_message_brightness(msg_data, brightness);
91
92 err = usb_control_msg(usb_dev,
93 usb_sndctrlpipe(usb_dev, 0),
94 HID_SET_REPORT,
95 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
96 /* wValue: HID-Report Type and Report ID */
97 HID_REPORT_TYPE_FEATURE | 0x01,
98 interface_nr /* wIndex */,
99 msg_data,
100 sizeof(struct brightness_ctrl_message_data),
101 HZ);
102 kfree(msg_data);
103 if (err < 0) {
104 dev_err(&interface->dev,
105 "set: usb control message err: %d\n",
106 err);
107 return err;
108 }
109 dev_dbg(&interface->dev, "set brightness: %d\n", brightness);
110 return 0;
111 }
112
> 113 int apple_bl_usb_check_fb(struct backlight_device *bd, struct fb_info *info)
114 {
115 dev_info(&bd->dev, "check fb\n");
116 return 0;
117 }
118
> 119 int apple_bl_usb_get_brightness(struct backlight_device *bl)
120 {
121 int ret;
122 struct apple_bl_usb_data *data;
123 int hw_brightness;
124
125 data = bl_get_data(bl);
126 ret = apple_bl_usb_usb_get_brightness(data->usb_interface,
127 data->usb_dev,
128 &hw_brightness);
129 if (!ret)
130 ret = hw_brightness;
131
132 return ret;
133 }
134
> 135 int apple_bl_usb_update_status(struct backlight_device *bl)
136 {
137 int err;
138 struct apple_bl_usb_data *data;
139
140 data = bl_get_data(bl);
141 err = apple_bl_usb_usb_set_brightness(data->usb_interface,
142 data->usb_dev,
143 bl->props.brightness);
144 return err;
145 }
146
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
parent reply other threads:[~2023-07-01 14:01 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20230701120806.11812-2-julius@zint.sh>]
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=202307012107.OW4d1gBR-lkp@intel.com \
--to=lkp@intel.com \
--cc=daniel.thompson@linaro.org \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=jingoohan1@gmail.com \
--cc=julius@zint.sh \
--cc=lee@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).