A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

code police, no functional changes

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14737 a1c6a512-1295-4272-9138-f99709370657

+60 -34
+6 -3
firmware/usbstack/core/config.c
··· 23 23 #include <string.h> 24 24 #include "usbstack/core.h" 25 25 26 - static int usb_descriptor_fillbuf(void* buf, unsigned buflen, struct usb_descriptor_header** src) 26 + static int usb_descriptor_fillbuf(void* buf, unsigned buflen, 27 + struct usb_descriptor_header** src) 27 28 { 28 29 uint8_t* dest = buf; 29 30 ··· 45 46 return dest - (uint8_t *)buf; 46 47 } 47 48 48 - int usb_stack_configdesc(const struct usb_config_descriptor* config, void* buf, unsigned length, struct usb_descriptor_header** desc) 49 + int usb_stack_configdesc(const struct usb_config_descriptor* config, void* buf, 50 + unsigned length, struct usb_descriptor_header** desc) 49 51 { 50 52 struct usb_config_descriptor* cp = buf; 51 53 int len; ··· 58 60 *cp = *config; 59 61 60 62 /* then interface/endpoint/class/vendor/... */ 61 - len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (uint8_t*)buf, length - USB_DT_CONFIG_SIZE, desc); 63 + len = usb_descriptor_fillbuf(USB_DT_CONFIG_SIZE + (uint8_t*)buf, 64 + length - USB_DT_CONFIG_SIZE, desc); 62 65 63 66 if (len < 0) { 64 67 return len;
+18 -13
firmware/usbstack/core/core.c
··· 99 99 * and if it has a device driver bind to it */ 100 100 logf("check for auto bind"); 101 101 if (usbcore.active_controller->type == DEVICE) { 102 - if (usbcore.active_controller->device_driver == NULL && usbcore.device_driver != NULL) { 102 + if (usbcore.active_controller->device_driver == NULL && 103 + usbcore.device_driver != NULL) { 103 104 /* bind driver */ 104 105 logf("binding..."); 105 106 bind_device_driver(usbcore.device_driver); ··· 130 131 void usb_stack_irq(void) 131 132 { 132 133 /* simply notify usb controller */ 133 - if (usbcore.active_controller != NULL && usbcore.active_controller->irq != NULL) { 134 + if (usbcore.active_controller != NULL && 135 + usbcore.active_controller->irq != NULL) { 134 136 usbcore.active_controller->irq(); 135 137 } 136 138 } ··· 190 192 * @param ctrl pointer to controller to unregister. 191 193 * @return 0 on success else a defined error code. 192 194 */ 193 - int usb_controller_unregister(struct usb_controller* ctrl) { 195 + int usb_controller_unregister(struct usb_controller* ctrl) 196 + { 194 197 195 198 if (ctrl == NULL) { 196 199 return EINVAL; ··· 226 229 struct usb_controller* new = NULL; 227 230 228 231 /* check if a controller of the wanted type is already loaded */ 229 - if (usbcore.active_controller != NULL && (int)usbcore.active_controller->type == type) { 232 + if (usbcore.active_controller != NULL && 233 + (int)usbcore.active_controller->type == type) { 230 234 logf("controller already set"); 231 235 return; 232 236 } ··· 263 267 usbcore.active_controller->init(); 264 268 } 265 269 266 - int usb_stack_get_mode(void) { 270 + int usb_stack_get_mode(void) 271 + { 267 272 return usbcore.mode; 268 273 } 269 274 ··· 296 301 return 0; 297 302 } 298 303 299 - int usb_device_driver_bind(const char* name) { 300 - 304 + int usb_device_driver_bind(const char* name) 305 + { 301 306 int i; 302 307 struct usb_device_driver *tmp = NULL; 303 308 struct usb_device_driver *driver = NULL; ··· 340 345 return 0; 341 346 } 342 347 343 - void usb_device_driver_unbind(void) { 344 - 348 + void usb_device_driver_unbind(void) 349 + { 345 350 logf("usb_device_driver_unbind"); 346 351 if (usbcore.active_controller->device_driver != NULL) { 347 352 usbcore.active_controller->device_driver->unbind(); ··· 351 356 usbcore.device_driver = NULL; 352 357 } 353 358 354 - static void update_driver_names(unsigned char* result) { 355 - 359 + static void update_driver_names(unsigned char* result) 360 + { 356 361 int i; 357 362 int pos = 0; 358 363 unsigned char terminator = ','; ··· 376 381 } 377 382 } 378 383 379 - static void bind_device_driver(struct usb_device_driver* driver) { 380 - 384 + static void bind_device_driver(struct usb_device_driver* driver) 385 + { 381 386 int ret = 0; 382 387 383 388 /* look if there is an old driver */
+4 -2
firmware/usbstack/core/epsetup.c
··· 151 151 switch (type) { 152 152 case USB_ENDPOINT_XFER_INT: 153 153 /* INT: limit 64 bytes full speed, 1024 high speed */ 154 - if ((usbcore.active_controller->speed != USB_SPEED_HIGH) && (max > 64)) { 154 + if ((usbcore.active_controller->speed != USB_SPEED_HIGH) && 155 + (max > 64)) { 155 156 return 0; 156 157 } 157 158 /* FALLTHROUGH */ 158 159 159 160 case USB_ENDPOINT_XFER_ISOC: 160 - if ((usbcore.active_controller->speed != USB_SPEED_HIGH) && (max > 1023)) { 161 + if ((usbcore.active_controller->speed != USB_SPEED_HIGH) && 162 + (max > 1023)) { 161 163 return 0; 162 164 } 163 165 break;
+14 -7
firmware/usbstack/drivers/device/usb_serial.c
··· 209 209 serial_debug_desc.bDebugInEndpoint = dev.in->ep_num; 210 210 serial_debug_desc.bDebugOutEndpoint = dev.out->ep_num; 211 211 212 - /* update hs descriptors as we asume that endpoints are the same for fs and hs */ 212 + /* update hs descriptors as we asume that endpoints 213 + are the same for fs and hs */ 213 214 serial_hs_in_desc.bEndpointAddress = serial_fs_in_desc.bEndpointAddress; 214 215 serial_hs_out_desc.bEndpointAddress = serial_fs_out_desc.bEndpointAddress; 215 216 ··· 242 243 switch (request->wValue >> 8) { 243 244 case USB_DT_DEVICE: 244 245 logf("usb serial: sending device desc"); 245 - ret = MIN(sizeof(struct usb_device_descriptor), request->wLength); 246 + ret = MIN(sizeof(struct usb_device_descriptor), 247 + request->wLength); 246 248 res.buf = &serial_device_desc; 247 249 break; 248 250 249 251 case USB_DT_DEVICE_QUALIFIER: 250 252 logf("usb serial: sending qualifier dec"); 251 - ret = MIN(sizeof(struct usb_qualifier_descriptor), request->wLength); 253 + ret = MIN(sizeof(struct usb_qualifier_descriptor), 254 + request->wLength); 252 255 res.buf = &serial_qualifier_desc; 253 256 break; 254 257 ··· 256 259 case USB_DT_CONFIG: 257 260 logf("usb serial: sending config desc"); 258 261 259 - ret = config_buf(buf, request->wValue >> 8, request->wValue & 0xff); 262 + ret = config_buf(buf, request->wValue >> 8, 263 + request->wValue & 0xff); 260 264 if (ret >= 0) { 261 265 logf("%d, vs %d", request->wLength, ret); 262 266 ret = MIN(request->wLength, (uint16_t)ret); ··· 266 270 267 271 case USB_DT_DEBUG: 268 272 logf("usb serial: sending debug desc"); 269 - ret = MIN(sizeof(struct usb_debug_descriptor), request->wLength); 273 + ret = MIN(sizeof(struct usb_debug_descriptor), 274 + request->wLength); 270 275 res.buf = &serial_debug_desc; 271 276 break; 272 277 273 278 case USB_DT_STRING: 274 279 logf("usb serial: sending string desc"); 275 - ret = usb_stack_get_string(strings, request->wValue & 0xff, buf); 280 + ret = usb_stack_get_string(strings, request->wValue & 0xff, 281 + buf); 276 282 ret = MIN(ret, request->wLength); 277 283 res.buf = buf; 278 284 break; ··· 324 330 /* TODO check index*/ 325 331 (void)index; 326 332 327 - len = usb_stack_configdesc(&serial_bulk_config_desc, buf, BUFFER_SIZE, dev.descriptors); 333 + len = usb_stack_configdesc(&serial_bulk_config_desc, buf, BUFFER_SIZE, 334 + dev.descriptors); 328 335 if (len < 0) { 329 336 return len; 330 337 }
+18 -9
firmware/usbstack/drivers/device/usb_storage.c
··· 207 207 /* update device decsriptor */ 208 208 storage_device_desc.bMaxPacketSize0 = ops->ep0->maxpacket; 209 209 210 - /* update hs descriptors as we asume that endpoints are the same for fs and hs */ 211 - storage_hs_bulk_in_desc.bEndpointAddress = storage_fs_bulk_in_desc.bEndpointAddress; 212 - storage_hs_bulk_out_desc.bEndpointAddress = storage_fs_bulk_out_desc.bEndpointAddress; 210 + /* update hs descriptors as we asume that endpoints 211 + are the same for fs and hs */ 212 + storage_hs_bulk_in_desc.bEndpointAddress = 213 + storage_fs_bulk_in_desc.bEndpointAddress; 214 + storage_hs_bulk_out_desc.bEndpointAddress = 215 + storage_fs_bulk_out_desc.bEndpointAddress; 213 216 214 217 return 0; 215 218 ··· 218 221 return -EOPNOTSUPP; 219 222 } 220 223 221 - void usb_storage_driver_unbind(void) { 224 + void usb_storage_driver_unbind(void) 225 + { 222 226 223 227 /* disable endpoints... */ 224 228 } ··· 240 244 switch (request->wValue >> 8) { 241 245 case USB_DT_DEVICE: 242 246 logf("usb storage: sending device desc"); 243 - ret = MIN(sizeof(struct usb_device_descriptor), request->wLength); 247 + ret = MIN(sizeof(struct usb_device_descriptor), 248 + request->wLength); 244 249 res.buf = &storage_device_desc; 245 250 break; 246 251 247 252 case USB_DT_DEVICE_QUALIFIER: 248 253 logf("usb storage: sending qualifier dec"); 249 - ret = MIN(sizeof(struct usb_qualifier_descriptor), request->wLength); 254 + ret = MIN(sizeof(struct usb_qualifier_descriptor), 255 + request->wLength); 250 256 res.buf = &storage_qualifier_desc; 251 257 break; 252 258 ··· 254 260 case USB_DT_CONFIG: 255 261 logf("usb storage: sending config desc"); 256 262 257 - ret = config_buf(buf, request->wValue >> 8, request->wValue & 0xff); 263 + ret = config_buf(buf, request->wValue >> 8, 264 + request->wValue & 0xff); 258 265 if (ret >= 0) { 259 266 logf("%d, vs %d", request->wLength, ret); 260 267 ret = MIN(request->wLength, (uint16_t)ret); ··· 264 271 265 272 case USB_DT_STRING: 266 273 logf("usb storage: sending string desc"); 267 - ret = usb_stack_get_string(strings, request->wValue & 0xff, buf); 274 + ret = usb_stack_get_string(strings, request->wValue & 0xff, 275 + buf); 268 276 ret = MIN(ret, request->wLength); 269 277 res.buf = buf; 270 278 break; ··· 336 344 337 345 (void)index; 338 346 339 - len = usb_stack_configdesc(&storage_config_desc, buf, BUFFER_SIZE, dev.descriptors); 347 + len = usb_stack_configdesc(&storage_config_desc, buf, BUFFER_SIZE, 348 + dev.descriptors); 340 349 logf("result %d", len); 341 350 if (len < 0) { 342 351 return len;