1.1 --- a/pkg/devices/backlight/src/spi-ili8960/backlight-spi-ili8960.cc Sat Jun 10 23:59:44 2023 +0200
1.2 +++ b/pkg/devices/backlight/src/spi-ili8960/backlight-spi-ili8960.cc Sun Jun 11 15:42:11 2023 +0200
1.3 @@ -5,7 +5,7 @@
1.4 * the Giantplus GPM940B0 panel datasheet also describes this controller
1.5 * interface.
1.6 *
1.7 - * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2020, 2023 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -26,6 +26,7 @@
1.13 #include <l4/re/env.h>
1.14
1.15 #include <ipc/server.h>
1.16 +
1.17 #include "backlight_object_server.h"
1.18 #include "spi_client.h"
1.19
1.20 @@ -33,7 +34,7 @@
1.21
1.22 /* Backlight device. */
1.23
1.24 -class server_BacklightObject : public BacklightObject
1.25 +class BacklightObject_server : public BacklightObject
1.26 {
1.27 SPI *_spi;
1.28 int _min = 55, _max = 90, _start = 70;
1.29 @@ -54,7 +55,7 @@
1.30 }
1.31
1.32 public:
1.33 - explicit server_BacklightObject(SPI *spi)
1.34 + explicit BacklightObject_server(SPI *spi)
1.35 : _spi(spi)
1.36 {
1.37 }
1.38 @@ -92,20 +93,20 @@
1.39 /* Obtain a reference to the SPI device. */
1.40
1.41 l4_cap_idx_t spi = l4re_env_get_cap("spi");
1.42 - if (!l4_is_valid_cap(spi)) return 1;
1.43 +
1.44 + if (!l4_is_valid_cap(spi))
1.45 + return 1;
1.46
1.47 client_SPI spi_obj(spi);
1.48
1.49 /* Initialise and register a new server object. */
1.50
1.51 - server_BacklightObject obj(&spi_obj);
1.52 - l4_cap_idx_t server;
1.53 + BacklightObject_server obj(&spi_obj);
1.54
1.55 - if (ipc_server_bind("backlight", (l4_umword_t) &obj, &server)) return 1;
1.56 + /* Bind and start the IPC server loop. */
1.57
1.58 - /* Enter the IPC server loop. */
1.59 + if (ipc_server_loop_for(BacklightObject, &obj, "backlight"))
1.60 + return 1;
1.61
1.62 - ipc_server_loop(BacklightObject_expected_items, &obj,
1.63 - (ipc_server_handler_type) handle_BacklightObject);
1.64 return 0;
1.65 }