summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungjae Cho <y0.cho@samsung.com>2022-03-03 14:45:06 +0900
committerYoungjae Cho <y0.cho@samsung.com>2022-03-04 10:03:10 +0900
commit409f9deaa170fcbd51f689c16edd9f5451e8df38 (patch)
tree3e9724c09a1a185128bedcb7ef5dd8d4fe4e03d3
parentb1eafb39444ad70b5c5b08b14229cb6e1b2a03d5 (diff)
downloaddevice-rpi-409f9deaa170fcbd51f689c16edd9f5451e8df38.tar.gz
device-rpi-409f9deaa170fcbd51f689c16edd9f5451e8df38.tar.bz2
device-rpi-409f9deaa170fcbd51f689c16edd9f5451e8df38.zip
It creates two libraries that are exactly same except for brightness nodepath. Each library is packaged into corresponding rpi3/rpi4 rpm. Change-Id: I3c6498211d3e75eb7541ee1595aa25df070ab051 Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
-rw-r--r--hw/display/CMakeLists.txt14
-rw-r--r--hw/display/display.c6
-rw-r--r--packaging/hal-backend-device-rpi.spec18
3 files changed, 33 insertions, 5 deletions
diff --git a/hw/display/CMakeLists.txt b/hw/display/CMakeLists.txt
index 8d73dd5..5fa6a8e 100644
--- a/hw/display/CMakeLists.txt
+++ b/hw/display/CMakeLists.txt
@@ -13,6 +13,14 @@ ENDFOREACH(flag)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-ADD_LIBRARY(${PROJECT_NAME} MODULE display.c)
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-device-display_pkgs_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
+SET(HAL_BACKEND_DEVICE_DISPLAY_RPI3 ${PROJECT_NAME}.rpi3)
+ADD_LIBRARY(${HAL_BACKEND_DEVICE_DISPLAY_RPI3} MODULE display.c)
+TARGET_COMPILE_DEFINITIONS(${HAL_BACKEND_DEVICE_DISPLAY_RPI3} PUBLIC RPI3)
+TARGET_LINK_LIBRARIES(${HAL_BACKEND_DEVICE_DISPLAY_RPI3} ${hal-backend-device-display_pkgs_LDFLAGS})
+INSTALL(TARGETS ${HAL_BACKEND_DEVICE_DISPLAY_RPI3} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
+
+SET(HAL_BACKEND_DEVICE_DISPLAY_RPI4 ${PROJECT_NAME}.rpi4)
+ADD_LIBRARY(${HAL_BACKEND_DEVICE_DISPLAY_RPI4} MODULE display.c)
+TARGET_COMPILE_DEFINITIONS(${HAL_BACKEND_DEVICE_DISPLAY_RPI4} PUBLIC RPI4)
+TARGET_LINK_LIBRARIES(${HAL_BACKEND_DEVICE_DISPLAY_RPI4} ${hal-backend-device-display_pkgs_LDFLAGS})
+INSTALL(TARGETS ${HAL_BACKEND_DEVICE_DISPLAY_RPI4} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)
diff --git a/hw/display/display.c b/hw/display/display.c
index d7f3f7a..f397446 100644
--- a/hw/display/display.c
+++ b/hw/display/display.c
@@ -29,8 +29,12 @@
#include </hal/include/device/hal-backend-common.h>
-#ifndef BACKLIGHT_PATH
+#if defined(RPI3)
#define BACKLIGHT_PATH "/sys/class/backlight/rpi_backlight"
+
+#elif defined(RPI4)
+#define BACKLIGHT_PATH "/sys/class/backlight/10-0045"
+
#endif
static int display_get_max_brightness(int *val)
diff --git a/packaging/hal-backend-device-rpi.spec b/packaging/hal-backend-device-rpi.spec
index a6e2fde..799d1d9 100644
--- a/packaging/hal-backend-device-rpi.spec
+++ b/packaging/hal-backend-device-rpi.spec
@@ -71,14 +71,28 @@ mv rpi3/gpio.ini .
rmdir rpi3
popd
+pushd %{_hal_libdir}
+ln -sf libhal-backend-device-display.rpi3.so libhal-backend-device-display.so
+popd
+
%post -n hal-backend-device-rpi4
pushd %{_hal_sysconfdir}/peripheral-io
mv rpi4/gpio.ini .
rmdir rpi4
popd
+pushd %{_hal_libdir}
+ln -sf libhal-backend-device-display.rpi4.so libhal-backend-device-display.so
+popd
+
%files
-%{_hal_libdir}/*.so*
+%{_hal_libdir}/libhal-backend-device-board.so
+%{_hal_libdir}/libhal-backend-device-haptic.so
+%{_hal_libdir}/libhal-backend-device-led.so
+%{_hal_libdir}/libhal-backend-device-memory.so
+%{_hal_libdir}/libhal-backend-device-thermal.so
+%{_hal_libdir}/libhal-backend-device-touchscreen.so
+%{_hal_libdir}/libhal-backend-device-usb-gadget.so
%{_hal_sysconfdir}/reboot/register_storage
%{_hal_sysconfdir}/peripheral-io/*.ini
%manifest %{name}.manifest
@@ -87,7 +101,9 @@ popd
%files -n hal-backend-device-rpi3
%dir %{_hal_sysconfdir}/peripheral-io/rpi3
%{_hal_sysconfdir}/peripheral-io/rpi3/gpio.ini
+%{_hal_libdir}/libhal-backend-device-display.rpi3.so
%files -n hal-backend-device-rpi4
%dir %{_hal_sysconfdir}/peripheral-io/rpi4
%{_hal_sysconfdir}/peripheral-io/rpi4/gpio.ini
+%{_hal_libdir}/libhal-backend-device-display.rpi4.so