platform/core/system/peripheral-bus.git
3 years agoFix a memleak 42/249342/1 accepted/tizen_6.0_unified tizen_6.0 accepted/tizen/6.0/unified/20201222.015615 submit/tizen_6.0/20201218.134248
Michal Bloch [Mon, 7 Dec 2020 21:09:12 +0000 (22:09 +0100)]
Fix a memleak

Change-Id: I8387f40aa78f329b3c2f3293765e1f38ae0a6447
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
(cherry picked from commit 394f4ab4498610ac3b8112c7a5ba7b42edc60933)

3 years agoRelease 0.1.4 97/241197/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.113035 accepted/tizen/6.0/unified/hotfix/20201103.000911 accepted/tizen/unified/20200819.035959 submit/tizen/20200818.114746 submit/tizen_6.0/20201029.205105 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 tizen_6.0.m2_release
Konrad Kuchciak [Tue, 18 Aug 2020 11:45:19 +0000 (13:45 +0200)]
Release 0.1.4

Change-Id: I671a5c8ecde207a2a01ee2c49291ef9bd44b4b0a

3 years agouart: Add ttyAMA1 interface to rpi4 config 93/241193/3
Konrad Kuchciak [Tue, 18 Aug 2020 11:13:18 +0000 (13:13 +0200)]
uart: Add ttyAMA1 interface to rpi4 config

Change-Id: I200a0bed764d5fb65ae0c9aa499bb4389792adf2

3 years agoDo not pass internal pointers to clients 02/240702/4 accepted/tizen/unified/20200812.143927 submit/tizen/20200811.122142
Karol Lewandowski [Mon, 10 Aug 2020 14:02:32 +0000 (16:02 +0200)]
Do not pass internal pointers to clients

Before this commit peripheral-bus would pass pointers to
local structures to clients via dbus.  This scheme broke
on aarch64 as the pointers were converted to 32-bit uint
dbus type.

This commits introduces random-number based handle ids
that are mapped from/to internal pointers.

Change-Id: Id12156e251526b79f1b9207c85f6b618871e9d38

3 years agoFix svace issues 71/239571/4 accepted/tizen/unified/20200729.165620 submit/tizen/20200728.162511
Karol Lewandowski [Mon, 27 Jul 2020 23:11:36 +0000 (01:11 +0200)]
Fix svace issues

This commit fixes double close and strcmp with NULL, as reported by SVACE.

Change-Id: Ie9e104dc1f5d2c65d6ea568c73e909602990cc31

3 years agoChange user from root to system_fw 95/239295/1 submit/tizen/20200724.041835
Konrad Kuchciak [Thu, 23 Jul 2020 11:35:54 +0000 (13:35 +0200)]
Change user from root to system_fw

Change-Id: I3673231b597cfb8bde040ceedc14cd82f6951adf

3 years agoi2c: Change i2c test device number from 7 to 13 80/238380/1 accepted/tizen/unified/20200714.134948 submit/tizen/20200713.082604
Konrad Kuchciak [Mon, 13 Jul 2020 07:01:30 +0000 (09:01 +0200)]
i2c: Change i2c test device number from 7 to 13

This patch is related to kernel upgrade (v5.4) on rpi4, which
changes i2c-stub device number from 7 to 13.

Change-Id: Ie079539b5057f4af0afd6cb8ec389364b6a07b90

3 years agoRelease 0.1.1 94/238094/1 accepted/tizen/unified/20200709.164731 submit/tizen/20200708.101210
Konrad Kuchciak [Wed, 8 Jul 2020 10:05:10 +0000 (12:05 +0200)]
Release 0.1.1

Change-Id: I49107ed8e5c3355a6a70892379b58263af1c36d9

3 years agogpio: Setup udev monitor before exporting pin 93/238093/1
Konrad Kuchciak [Wed, 8 Jul 2020 09:23:55 +0000 (11:23 +0200)]
gpio: Setup udev monitor before exporting pin

This will get rid of race condition that may lead to
missing udev event after exporting gpio pin.
Udev event monitor is now created before export.

Change-Id: Ifbad613252243c24cb03ed1765d3d947d244f56a

3 years agoUse udev rules to make PWM nodes writable 18/237918/2
Konrad Kuchciak [Mon, 6 Jul 2020 11:40:19 +0000 (13:40 +0200)]
Use udev rules to make PWM nodes writable

Change-Id: Iad2bc5d9c43cb6b849f6308232b8ee2e995112ff

4 years agoi2c: Fix i2c stub device config for rpi4 28/224028/1 accepted/tizen/unified/20200217.213902 submit/tizen/20200214.101934 submit/tizen/20200217.095901
Konrad Kuchciak [Wed, 5 Feb 2020 16:43:15 +0000 (17:43 +0100)]
i2c: Fix i2c stub device config for rpi4

On RPi4 SMBus stub driver appears as /dev/i2c-7, not /dev/i2c-4.

Change-Id: I9137d5486e265ce82cde397cfb87de5d54a06079

4 years agoAdjust codebase for iniparser upgrade (4.x) 83/222083/4 accepted/tizen/unified/20200213.121620 submit/tizen/20200203.003549 submit/tizen/20200205.003954
Karol Lewandowski [Thu, 9 Jan 2020 11:04:09 +0000 (12:04 +0100)]
Adjust codebase for iniparser upgrade (4.x)

Change-Id: I242b62f5dade32085eafa050e208d52edcd40b7b

4 years agoFix gcc 9.x compilation issue 26/221526/1 accepted/tizen/unified/20200108.131445 submit/tizen/20200107.111920
Karol Lewandowski [Fri, 3 Jan 2020 09:39:17 +0000 (10:39 +0100)]
Fix gcc 9.x compilation issue

Change-Id: Ie1e45dc814630a3fd819c84d1953a9aa75f69e07

4 years agoAdding rpi4 board. 15/217415/1 accepted/tizen/unified/20191111.105613 submit/tizen/20191111.101125
wchang kim [Mon, 11 Nov 2019 09:57:14 +0000 (18:57 +0900)]
Adding rpi4 board.

Change-Id: Icc8bb7c0c4ff7eaf0481dfbb8dc0646e5bbd9aa3

5 years agopio: don't close fd if it's value is negative 99/199399/2 accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.021436 accepted/tizen/5.5/unified/mobile/hotfix/20201027.085723 accepted/tizen/5.5/unified/wearable/hotfix/20201027.112349 accepted/tizen/unified/20190214.154131 submit/tizen/20190213.063316 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 submit/tizen_5.5_wearable_hotfix/20201026.184304 tizen_5.5.m2_release
Konrad Kuchciak [Mon, 11 Feb 2019 07:09:35 +0000 (08:09 +0100)]
pio: don't close fd if it's value is negative

Additionaly return if fd open failed.

Change-Id: Ica183a00a265a499eb2e09a864062877ef8847fa
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agoadc: open node as O_RDONLY 93/188493/1 accepted/tizen/unified/20181031.153945 submit/tizen/20180907.001350 submit/tizen/20180924.110450 submit/tizen/20181010.111134 submit/tizen/20181022.095331 submit/vip/20181010.110708
Konrad Kuchciak [Wed, 5 Sep 2018 09:29:34 +0000 (11:29 +0200)]
adc: open node as O_RDONLY

Change-Id: Ic878259b294fdcc13e8bf66e44ab57db24588930
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agoRevert "udev: apply proper security label to files read by adc module" 92/188492/1
Konrad Kuchciak [Wed, 5 Sep 2018 09:28:07 +0000 (11:28 +0200)]
Revert "udev: apply proper security label to files read by adc module"

Change-Id: I98bd5939554a4173616f0d42dc202be05f4c11e7
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agoudev: apply proper security label to files read by adc module 34/188334/1 accepted/tizen_5.0_unified accepted/tizen/5.0/unified/20181102.020415 accepted/tizen/unified/20180904.180704 submit/tizen/20180904.130723 submit/tizen_5.0/20181101.000004
Konrad Kuchciak [Tue, 4 Sep 2018 04:56:47 +0000 (06:56 +0200)]
udev: apply proper security label to files read by adc module

Change-Id: I0a32f3fd5bf3096ab38ab88a97fc37eab965f6ca
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agoAdd support for the adc device 11/184511/4 accepted/tizen/unified/20180822.164540 submit/tizen/20180821.133358
Konrad Kuchciak [Wed, 18 Jul 2018 10:09:42 +0000 (12:09 +0200)]
Add support for the adc device

Change-Id: Iec76628712a5efc6a00c726b98ebaa6c2e5da966
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agoMerge "privilege: initialize variables before using" into tizen accepted/tizen/unified/20180725.152333 submit/tizen/20180724.071520 submit/tizen_4.0/20180724.072809
Karol Lewandowski [Fri, 13 Jul 2018 11:58:24 +0000 (11:58 +0000)]
Merge "privilege: initialize variables before using" into tizen

5 years agoprivilege: initialize variables before using 25/183825/2
Konrad Kuchciak [Wed, 11 Jul 2018 08:47:40 +0000 (10:47 +0200)]
privilege: initialize variables before using

This fixed issues reported by Coverity bot about not checking
values returned by cynara_creds_gdbus_get_client() and
cynara_creds_gdbus_get_user()

Change-Id: I65ae1c2160129d45bb159bc6fc79b622b38390f8
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
5 years agosystemd: Add file existence dependency on /proc/device-tree/model 65/182665/1 accepted/tizen/unified/20180702.062859 submit/tizen/20180629.045726
Wook Song [Wed, 27 Jun 2018 02:18:32 +0000 (11:18 +0900)]
systemd: Add file existence dependency on /proc/device-tree/model

Since this deamon requires to open /proc/device-tree/model to get the
board model information, the service sometimes failed to start on the
system which does not use device-tree. For example, the system on the
x86-64 architecture does not use device-tree so that this daemon would
fail to be activated on this system. In order to solve this issue, this
patch adds a ConditionPathExists dependency on /proc/device-tree/model
to the systemd unit configuration file.

Change-Id: Ibf1bdfbe3df76a878ff608464907c84351fe35d1
Signed-off-by: Wook Song <wook16.song@samsung.com>
5 years agoChanged the i2c information of eagleye. 53/182453/1 accepted/tizen/unified/20180626.064858 submit/tizen/20180625.230523
wchang kim [Mon, 25 Jun 2018 08:24:21 +0000 (17:24 +0900)]
Changed the i2c information of eagleye.

Change-Id: I1ba0089f4542f910e4b49067237944b2c458aca8

5 years agoAdding a board of eagleye530s 97/182197/2 accepted/tizen/unified/20180625.141542 submit/tizen/20180624.222751
wchang kim [Thu, 21 Jun 2018 07:00:49 +0000 (16:00 +0900)]
Adding a board of eagleye530s

Change-Id: I4a894a34452c90f734f2fcca668f604359d36621

5 years agoFixed the file name. 40/182140/3
wchang kim [Thu, 21 Jun 2018 00:13:17 +0000 (09:13 +0900)]
Fixed the file name.

Change-Id: I3108fd13d832e73b33a6c89361bb90d59bffe887

5 years agoAdd dbus.conf to allow dbus policy 94/182194/3 accepted/tizen/unified/20180621.141542 submit/tizen/20180621.110527
kibak.yoon [Thu, 21 Jun 2018 06:52:28 +0000 (15:52 +0900)]
Add dbus.conf to allow dbus policy

Change-Id: Ib2725ff537bf28fed90b3fc862704d2ba51b1f55
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRevert "Add dbus.conf to allow dbus policy"
kibak.yoon [Thu, 21 Jun 2018 06:57:43 +0000 (15:57 +0900)]
Revert "Add dbus.conf to allow dbus policy"

This reverts commit b54ae48c4c1a5501c3a544b6b1a65254738885a6.

5 years agoAdd dbus.conf to allow dbus policy
kibak.yoon [Thu, 21 Jun 2018 06:52:28 +0000 (15:52 +0900)]
Add dbus.conf to allow dbus policy

Change-Id: Ib2725ff537bf28fed90b3fc862704d2ba51b1f55
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agopio: close fd when it is not negative number 94/165594/1 accepted/tizen/unified/20180103.151845 submit/tizen/20180103.062104
kibak.yoon [Tue, 2 Jan 2018 10:09:04 +0000 (19:09 +0900)]
pio: close fd when it is not negative number

Change-Id: I8c6b2f497ce0c519f6dbdb29150edb313b274951
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agopio: assign null to handle if open is failed 93/165593/1
kibak.yoon [Tue, 2 Jan 2018 03:10:05 +0000 (12:10 +0900)]
pio: assign null to handle if open is failed

 - To prevent "use after free", NULL should assign to the handle.

Change-Id: I974442074cb778d3f2e9797bc291b9098f3017f5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoudev: change security label 48/164248/2 accepted/tizen/unified/20171221.071349 submit/tizen/20171220.125854 submit/tizen/20171221.025332
Segwon [Mon, 18 Dec 2017 07:58:17 +0000 (16:58 +0900)]
udev: change security label

 - when receiving fd to lib from daemon, the kernel blocks fd by security check.
 - change 90-gpio.rules name to 90-peripheral-io.rules

Change-Id: I5c75056e4d54fb667e6acdc7398f5f35ae9a3ff3
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: do not management fd in handle 41/163241/3
Segwon [Fri, 8 Dec 2017 05:59:35 +0000 (14:59 +0900)]
handle: do not management fd in handle

 - create a fd list in the interface files
 - Do not need to have fd until Lib request to close

Change-Id: I758edbf9f0d5007bb74926a37c5d8ba3e858936d
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoMerge "gdbus: communicate via gdbus when close" into tizen
Segwon [Thu, 7 Dec 2017 08:11:31 +0000 (08:11 +0000)]
Merge "gdbus: communicate via gdbus when close" into tizen

6 years agogdbus: communicate via gdbus when close 15/162915/2
Segwon [Wed, 6 Dec 2017 07:18:54 +0000 (16:18 +0900)]
gdbus: communicate via gdbus when close

 - in the past, when Lib was closed, gdbus disconnected and the daemon received a disconnection callback.
 - the problem is gdbus disconnection callback is called late
 - if App repeat open and close, daemon get the problem of handling open before close is processed.

Change-Id: If358b283389eebc5dfe97f6c182defef37acfce4
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoprivilege: do not compare the return value of cynara_check() with the wrong value 73/162673/1
Segwon [Tue, 5 Dec 2017 01:42:09 +0000 (10:42 +0900)]
privilege: do not compare the return value of cynara_check() with the wrong value

Change-Id: I8876914aef668d25d6f3e0e3f65910d37ad8ac74
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[5/5] fd passing: make fd list and send it to Lib 79/161479/3
Segwon [Thu, 23 Nov 2017 13:11:06 +0000 (22:11 +0900)]
[5/5] fd passing: make fd list and send it to Lib

Change-Id: Ie76575d1357035abbb32d7af1f9e61d6a5c32c39
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: change function prefix "handle" to "peripheral_gdbus" 24/161424/4
Segwon [Thu, 23 Nov 2017 09:21:44 +0000 (18:21 +0900)]
gdbus: change function prefix "handle" to "peripheral_gdbus"

Change-Id: I178b507d5437ffdbb756e3067418286c20edbbcf
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: move duplicate header files to peripheral_handle_common.h 22/161422/4
Segwon [Thu, 23 Nov 2017 09:16:35 +0000 (18:16 +0900)]
handle: move duplicate header files to peripheral_handle_common.h

Change-Id: Ie2fa4143030b743ee85f4a15ed89c77d826098d5
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: add fd values to handle and add interface function 21/161421/8
Segwon [Thu, 23 Nov 2017 09:06:47 +0000 (18:06 +0900)]
handle: add fd values to handle and add interface function

Change-Id: I910023125072b2b3660cbf8d0e5974afabda2a73
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoMerge "handle: change structs name in peripheral_handle.h" into tizen
Segwon [Fri, 24 Nov 2017 04:37:19 +0000 (04:37 +0000)]
Merge "handle: change structs name in peripheral_handle.h" into tizen

6 years agoMerge "handle: change the handle function name appropriately" into tizen
Segwon [Fri, 24 Nov 2017 04:37:13 +0000 (04:37 +0000)]
Merge "handle: change the handle function name appropriately" into tizen

6 years agoMerge "interface: move gpio_wait_for_udev() into peripheral_interface_gpio_open(...
Segwon [Fri, 24 Nov 2017 04:37:08 +0000 (04:37 +0000)]
Merge "interface: move gpio_wait_for_udev() into peripheral_interface_gpio_open()" into tizen

6 years agohandle: change structs name in peripheral_handle.h 44/161344/3
Segwon [Thu, 23 Nov 2017 02:46:58 +0000 (11:46 +0900)]
handle: change structs name in peripheral_handle.h

 - remove the unused handle and type
 - peripheral_bus_s -> peripheral_info_s
 - peripheral_bus_gpio_s -> peripheral_handle_gpio_s
 - peripheral_bus_i2c_s  -> peripheral_handle_i2c_s
 - peripheral_bus_pwm_s  -> peripheral_handle_pwm_s
 - peripheral_bus_uart_s -> peripheral_handle_uart_s
 - peripheral_bus_spi_s  -> peripheral_spi_s
 - peripheral_bus_data_s -> peripheral_handle_s

Change-Id: I6605071a201eb6e1b508c7d43ac37c27c1ece7fe
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: change the handle function name appropriately 38/161338/1
Segwon [Thu, 23 Nov 2017 02:07:23 +0000 (11:07 +0900)]
handle: change the handle function name appropriately

 - change prefix "bus" to "handle"

Change-Id: I0d3232c8483f7cd7ed3ffff1470517bbfda29b10
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: move gpio_wait_for_udev() into peripheral_interface_gpio_open() 32/161332/1
Segwon [Thu, 23 Nov 2017 01:30:37 +0000 (10:30 +0900)]
interface: move gpio_wait_for_udev() into peripheral_interface_gpio_open()

Change-Id: Iaf6ca8c0d9ed435b312cf750ab7bcb579159c5c8
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoetc: #ifndef string constants name change to file name 66/161066/4
Segwon [Tue, 21 Nov 2017 08:28:15 +0000 (17:28 +0900)]
etc: #ifndef string constants name change to file name

Change-Id: I86af8a90f9a76e7ee0e937fe2b5720ff5d3d4d1f
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[4/5] fd passing: can get fd from interface file 63/161063/5
Segwon [Tue, 21 Nov 2017 08:18:40 +0000 (17:18 +0900)]
[4/5] fd passing: can get fd from interface file

 - GPIO/PWM : open -> get fd -> close
 - I2C/UART/SPI : get fd(open) -> close

Change-Id: I117748c24eeef0c65d007114a5228e999ce6168a
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: change ERROR_CHECK macro to IF_ERROR_RETURN 59/161159/6
Segwon [Wed, 22 Nov 2017 02:42:58 +0000 (11:42 +0900)]
interface: change ERROR_CHECK macro to IF_ERROR_RETURN

 - input function parameter and run function before return

Change-Id: I119be474d5b96b5b40aa40956b76092c80667fd0
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoutil: move board, log, privilege file into util directory 17/161017/2
Segwon [Tue, 21 Nov 2017 05:45:33 +0000 (14:45 +0900)]
util: move board, log, privilege file into util directory

 - prefix match with "peripheral"

Change-Id: Iddb98ac81212712deeb3896c5c39fecf1df220e3
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoboard: do not free a value obtained by a iniparser_getseckeys() 36/161036/1
Segwon [Tue, 21 Nov 2017 06:44:41 +0000 (15:44 +0900)]
board: do not free a value obtained by a iniparser_getseckeys()

 - reference : http://ndevilla.free.fr/iniparser/html/iniparser_8h.html#afa12556355442c567c4b123446f3b309
   This function queries a dictionary and finds all keys in a given section.
   Each pointer in the returned char pointer-to-pointer is pointing to a string allocated in the dictionary
   do not free or modify them.
   This function returns NULL in case of error.

Change-Id: I62b1e0496aa4faabaf8cbfe11fa5ebfa9ebf33aa
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: change file name "peripheral_bus.h" to "peripheral_handle.h" 09/161009/4
Segwon [Tue, 21 Nov 2017 05:24:50 +0000 (14:24 +0900)]
handle: change file name "peripheral_bus.h" to "peripheral_handle.h"

Change-Id: I1d65506dd9601ece9b685ee388332d484da26c24
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle : change file name "peripheral_bus_util" to peripheral_handle_common" 01/161001/4
Segwon [Tue, 21 Nov 2017 05:08:00 +0000 (14:08 +0900)]
handle : change file name "peripheral_bus_util" to peripheral_handle_common"

 - remove unused function in this file
 - move into handle directory

Change-Id: Ie2bfdeab0def13a5c247b032b8ff448f659fe8b5
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoprivilege: move peripheral_bus_check_privilege() to privilege_checker.h 94/160994/3
Segwon [Tue, 21 Nov 2017 04:52:27 +0000 (13:52 +0900)]
privilege: move peripheral_bus_check_privilege() to privilege_checker.h

 - change name : peripheral_bus_check_privilege() -> peripheral_privilege_check()

Change-Id: I670e346d59ccd7fd8f51707c76268dc0a7c117fc
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agodirectory: change directory 70/160970/4
Segwon [Tue, 21 Nov 2017 02:41:43 +0000 (11:41 +0900)]
directory: change directory

 - remove daemon
 - add src/handle
 - add inc/handle
 - add src/gdbus
 - add inc/gdbus
 - add inc/interface

Change-Id: I925816afe27ec9804fb77a056706e72f65623442
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: close the fd before call CHECK_ERROR if it need to close fd 80/160980/3
Segwon [Tue, 21 Nov 2017 04:06:56 +0000 (13:06 +0900)]
interface: close the fd before call CHECK_ERROR if it need to close fd

Change-Id: I791e969c63da3c114f08ecdb3dbb303f9239dfb1
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: change file name prefix "peripheral_bus_gdbus" to "peripheral_gdbus" 68/160968/1
Segwon [Tue, 21 Nov 2017 02:33:51 +0000 (11:33 +0900)]
gdbus: change file name prefix "peripheral_bus_gdbus" to "peripheral_gdbus"

Change-Id: I155f9155a39745093e553eb2830a7b1198515469
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: change file name that generates the handle 62/160962/1
Segwon [Tue, 21 Nov 2017 01:54:34 +0000 (10:54 +0900)]
handle: change file name that generates the handle

 - change prefix "peripheral_bus" to "peripheral_handle"

Change-Id: I5860b15baf18138397b445472c05bd20873f6382
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agolog: change file name "peripheral_common.h" to "peripheral_log.h" 60/160960/1
Segwon [Tue, 21 Nov 2017 01:46:52 +0000 (10:46 +0900)]
log: change file name "peripheral_common.h" to "peripheral_log.h"

Change-Id: I4cbf8be541b34d592b95c47d2a9a975935b65a95
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: create file the "peripheral_inteface_common.h" 56/160956/2
Segwon [Tue, 21 Nov 2017 01:37:37 +0000 (10:37 +0900)]
interface: create file the "peripheral_inteface_common.h"

 - change the errno check to macro
 - move common included header files to peripheral_interface_common.h
 - move common constants to peripheral_interface_common.h

Change-Id: I1a4b6fea351a045b829fb122bcec9d80f1e3ac7d
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agointerface: add prefix "peripheral_interface" to interface file name 48/160948/1
Segwon [Tue, 21 Nov 2017 01:17:27 +0000 (10:17 +0900)]
interface: add prefix "peripheral_interface" to interface file name

Change-Id: I9217d313406d113f0e314609d01edd577e9940c9
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agohandle: remove unnecessary members in handle. 99/160899/1
Segwon [Mon, 20 Nov 2017 11:15:41 +0000 (20:15 +0900)]
handle: remove unnecessary members in handle.

Change-Id: If0ff8eae0df81f5bdd84997c69bb48ea9b121ff0
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[3/5] fd passing: remove unnecessary functions moved to Lib 97/160897/1
Segwon [Mon, 20 Nov 2017 11:04:56 +0000 (20:04 +0900)]
[3/5] fd passing: remove unnecessary functions moved to Lib

 - I/O patch: https://review.tizen.org/gerrit/#/c/159779/

Change-Id: Ie297b0400b48f1fb17e9a3500fb94a928c1bc2b0
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoprivilege: change the "peripheral_bus_check_privilege" function static to public. 60/160860/2
Segwon [Mon, 20 Nov 2017 09:02:55 +0000 (18:02 +0900)]
privilege: change the "peripheral_bus_check_privilege" function static to public.

 - Use the peripheral_bus_check_privilege() directly in the gdbus function rather than in the peripheral_bus_get_client_info().
 - The ids generated by peripheral_bus_get_client_info() will not be used.

Change-Id: I8ec7536f04c1db069b31c8ac973d727e12ba7f0e
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[2/5] fd passing: include fd list in gdbus open function 52/160852/1
Segwon [Mon, 20 Nov 2017 08:39:44 +0000 (17:39 +0900)]
[2/5] fd passing: include fd list in gdbus open function

Change-Id: I6a5b6c42940f4dd903bd0479fe1ed287923c5348
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years ago[1/5] fd passing: do not communicate with Lib from gdbus except for the open. 49/160849/1
Segwon [Mon, 20 Nov 2017 08:27:30 +0000 (17:27 +0900)]
[1/5] fd passing: do not communicate with Lib from gdbus except for the open.

Change-Id: Idf4dddf501f2c14c1a28d8a27d4354ac3ad9cd8d
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agogdbus: do not include peripheral_gdbus.h removed from Lib 68/160768/1
Segwon [Mon, 20 Nov 2017 05:06:23 +0000 (14:06 +0900)]
gdbus: do not include peripheral_gdbus.h removed from Lib

 - I/O patch : https://review.tizen.org/gerrit/#/c/160409/

Change-Id: Ifb921dcd9aaffc48b042f2e82e38d07fe1acc2ec
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agospec: remove unnecessary code about systemctl 24/160324/1 accepted/tizen/unified/20171115.174115 submit/tizen/20171115.102506
Segwon [Wed, 15 Nov 2017 10:21:13 +0000 (19:21 +0900)]
spec: remove unnecessary code about systemctl

Change-Id: I1890e58f71babdfc3384a5e7c065f9a37f870015
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agopio: check if the client has privilege 54/156254/2 accepted/tizen/unified/20171019.145459 submit/tizen/20171018.072430
kibak.yoon [Tue, 17 Oct 2017 16:21:09 +0000 (01:21 +0900)]
pio: check if the client has privilege

Change-Id: I6cdd412fe8f17001717e68e13eccbb60fc16fd70
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agopio: fix memory leak 48/155848/5 accepted/tizen/unified/20171017.071214 submit/tizen/20171016.114740
kibak.yoon [Mon, 16 Oct 2017 09:50:23 +0000 (18:50 +0900)]
pio: fix memory leak

- Overwriting key_list in key_list = iniparser_getseckeys(dict, section)
leaks the storage that key_list points to.

Change-Id: Ia1aefe750ff8addfd40c6372a2720e5515289a8e
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoini: fixed to wrong ini file for rpi3 30/155630/1
Segwon [Mon, 16 Oct 2017 01:38:49 +0000 (10:38 +0900)]
ini: fixed to wrong ini file for rpi3

   - missed the GPIO23 pin
   - wrong pin mapping with pin index

Change-Id: If1d76fe6ff050071bef07c6f51bdccb8ee7826a2
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoi2c: try to call ioctl() to test i2c-stub when read()/write() is failed 37/148037/5 accepted/tizen/unified/20171013.193401 submit/tizen/20171013.100446
kibak.yoon [Wed, 6 Sep 2017 10:29:56 +0000 (19:29 +0900)]
i2c: try to call ioctl() to test i2c-stub when read()/write() is failed

Change-Id: Idadb56f4da5b4ed17fef47ba316524462b0c50c5
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoboard: fixed to not be an unterminated array. 41/155041/1 submit/tizen/20171012.141835
Segwon [Thu, 12 Oct 2017 03:08:49 +0000 (12:08 +0900)]
board: fixed to not be an unterminated array.

Change-Id: If0c6aeb1a1d36392aff13f1a6564e625fbfc9cf0
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoboard: fixed allocated memory released via iniparser_getseckeys() 72/154572/1 accepted/tizen/unified/20171010.163344 submit/tizen/20171010.131453
Segwon [Tue, 10 Oct 2017 12:52:47 +0000 (21:52 +0900)]
board: fixed allocated memory released via iniparser_getseckeys()

Change-Id: I49542c1e79e83aa8ad278eca23d89c78a44cd55f
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoboard: increased the memory size because of unterminated string occurred. 64/154564/1
Segwon [Tue, 10 Oct 2017 12:25:12 +0000 (21:25 +0900)]
board: increased the memory size because of unterminated string occurred.

Change-Id: I5839e07b77eda7cab197248ba146bc9226573c5c
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoboard: meaningful return value is assigned to a variable like read() 96/154496/4
Segwon [Tue, 10 Oct 2017 10:02:24 +0000 (19:02 +0900)]
board: meaningful return value is assigned to a variable like read()

Change-Id: I07e1db5b35cc071b4d28f9aac4f685c714e8edb2
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agospi: modified to the rx and tx buffers are not allocated when buffer size is zero. 87/154487/4
Segwon [Tue, 10 Oct 2017 09:15:13 +0000 (18:15 +0900)]
spi: modified to the rx and tx buffers are not allocated when buffer size is zero.

Change-Id: Ibaca59a040935701078140ca04eeef5dc3fb5280
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agospi: fixed to invalid NULL check when tx_buf allocates. 72/154472/3
Segwon [Tue, 10 Oct 2017 08:53:32 +0000 (17:53 +0900)]
spi: fixed to invalid NULL check when tx_buf allocates.

Change-Id: Ieb4e22cf35d685895960b26d25cd803bc702d67a
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoopen handle: open function flow was matched. 23/154423/3
Segwon [Tue, 10 Oct 2017 07:26:13 +0000 (16:26 +0900)]
open handle: open function flow was matched.

 - added the NULL check when trying to allocate memory for i2c handle.
 - modified to return an OUT_OF_MEMORY when failed allocation from peripheral_bus_data_new().
 - open i2c, uart handle flow was matched with another open flow.
 - add log before return error.

Change-Id: Ibcee972e2bba39cc42b8bc53bd91efcb0526b0bf
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoi2c: fixed that allocated memory is released when an error occurs. 18/154518/1
Segwon [Tue, 10 Oct 2017 10:38:42 +0000 (19:38 +0900)]
i2c: fixed that allocated memory is released when an error occurs.

Change-Id: Ib2c6589ad52b3752297bf6579527b574dba3b3d6
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agobus: fixed a flow using a handle already freed. 13/154513/1
Segwon [Tue, 10 Oct 2017 10:35:16 +0000 (19:35 +0900)]
bus: fixed a flow using a handle already freed.

Change-Id: Ie3596fa2db1e607d15d0c3745a872a5d4c3f067d
Signed-off-by: Segwon <segwon.han@samsung.com>
6 years agoversion up 0.1.0 57/152357/1 accepted/tizen/unified/20170926.165628 submit/tizen/20170926.023501
kibak.yoon [Tue, 26 Sep 2017 02:07:08 +0000 (11:07 +0900)]
version up 0.1.0

Change-Id: I92d08b747a243c850df8027e5b35bbe1602384bd
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agouart: fixed to return the -EAGAIN error type when read/write. 09/151609/3
Segwon [Thu, 21 Sep 2017 08:45:48 +0000 (17:45 +0900)]
uart: fixed to return the -EAGAIN error type when read/write.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I726000397abcac13cfc571336823775c8df1e053

6 years agouart: added flush logic before close. 03/151603/1
Segwon [Thu, 21 Sep 2017 08:43:06 +0000 (17:43 +0900)]
uart: added flush logic before close.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I639ade4199c50518974b7a5f94c2752677d144b5

6 years agoname: sync functions name with changed apis name. 99/151599/1
Segwon [Thu, 21 Sep 2017 08:38:17 +0000 (17:38 +0900)]
name: sync functions name with changed apis name.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I093f4eb46c396d91de3caab7a97571f34dd0d79a

6 years agoadc: the adc interface is not supported 77/151577/2
Segwon [Thu, 21 Sep 2017 07:52:34 +0000 (16:52 +0900)]
adc: the adc interface is not supported

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Ief5428879d64020875d0fb4c281c1e82e5d9cb7a

6 years agospi: fix bug by passing value instead of pointer as parameter 90/149390/1 accepted/tizen/unified/20170912.191949 submit/tizen/20170912.074259
kibak.yoon [Tue, 12 Sep 2017 07:15:13 +0000 (16:15 +0900)]
spi: fix bug by passing value instead of pointer as parameter

Change-Id: Ifa2991a34ad1b9f150913cd45ca8719fe1760b62
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoutil: added to the NULL check. 25/148425/2
Segwon [Fri, 8 Sep 2017 02:07:25 +0000 (11:07 +0900)]
util: added to the NULL check.

 - SVACE : 279879, DEREF_OF_NULL.RET.PROC.STAT

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: I0ac9861b1afabc52ccd29c125f245414688d7c1c

6 years agospi: transfer the tx/rx data with the same structure variable 11/148011/1 accepted/tizen/unified/20170907.190204 submit/tizen/20170907.084231
kibak.yoon [Wed, 6 Sep 2017 08:12:02 +0000 (17:12 +0900)]
spi: transfer the tx/rx data with the same structure variable

- Tested with ADC(MCP3008)
- The name of spi_read_write() function will be changed to "spi_transfer()".

Change-Id: I6db7383854de46c5e45721fb9ec9da6ce4a51c8f
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoboard-config: add config file for Artik 520 29/146429/1 accepted/tizen/unified/20170901.025959 submit/tizen/20170830.124248
kibak.yoon [Mon, 28 Aug 2017 12:38:31 +0000 (21:38 +0900)]
board-config: add config file for Artik 520

- Artik 520 Pin Mapping
  https://developer.artik.io/documentation/developer-guide/gpio/gpio-mapping.html#artik-520-pin-mapping
- Artik 520 Datasheet
  https://developer.artik.io/documentation/downloads.html#ds

[TODO]
- more testing is needed for GPIO

Change-Id: I2e8ce87b03a410379841be820f918f02c42d8f20
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoboard-config: fix typo from "unkown" to "unknown" 28/146428/1
kibak.yoon [Mon, 28 Aug 2017 12:37:21 +0000 (21:37 +0900)]
board-config: fix typo from "unkown" to "unknown"

- the config file name is not matched because there is a typo("unkown").
  so it is failing to load the config file on the unknown device(e.g., artik520).
- Even if this patch is merged, the peripheral bus daemon will not boot properly.
  This is because there is no peripheral-io item in the config file...

Change-Id: I7e96467304ef8742c30205d51447ff76b35b1713
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
6 years agoImprove logs for I2C communication 95/141095/2
Hyeongsik Min [Fri, 28 Jul 2017 06:46:21 +0000 (15:46 +0900)]
Improve logs for I2C communication

- Show I2C slave address in hexadecimal.
- Add logs in peripheral_bus_i2c to provide information about the slave
  address of failed device.

Change-Id: Idc29f0cf6a52f67c849bd9dac064210203c1a192
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoRefactor logs messages in i2c/spi interface 77/141077/1
Hyeongsik Min [Fri, 28 Jul 2017 04:51:46 +0000 (13:51 +0900)]
Refactor logs messages in i2c/spi interface

- Print message if fd is invalid.
- Show fd number in error case.

Change-Id: If08d70d1a4465ecbb6a5cf29b77674c18debe5d0
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoPrint log messages in case of wrong write access 13/140113/1
Hyeongsik Min [Mon, 24 Jul 2017 02:15:12 +0000 (11:15 +0900)]
Print log messages in case of wrong write access

Writing value is not permitted when the pin is in input direction mode.
Just in case, this patch fixes error number and adds log message to let user
know the cause.

Change-Id: Ie40fabeba06b832eaa0585130af8702ba8fcb8b5
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoRefactoring dbus interface functions 79/139979/2
Sungguk Na [Fri, 21 Jul 2017 07:15:41 +0000 (16:15 +0900)]
Refactoring dbus interface functions

Change-Id: Ide717e39235e5b87583e93dfd05485efc59e9a3b
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
6 years agoFix bug at spi open 75/139875/1
Sungguk Na [Fri, 21 Jul 2017 02:05:55 +0000 (11:05 +0900)]
Fix bug at spi open

Change-Id: I3133d1eb66cc2f621f85ba9601dfcf34b02014d2
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
6 years agopackage version up to 0.0.6 99/139599/1 accepted/tizen/4.0/unified/20170816.012229 accepted/tizen/4.0/unified/20170829.015756 accepted/tizen/unified/20170720.062122 submit/tizen/20170719.114354 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.100004 submit/tizen_4.0/20170828.110004
jino.cho [Wed, 19 Jul 2017 11:42:01 +0000 (20:42 +0900)]
package version up to 0.0.6

Change-Id: Id491bcae11e34a686c65eb7b524532f4098ddf42
Signed-off-by: jino.cho <jino.cho@samsung.com>
6 years agoFix model name of RPI3 49/139549/3
Hyeongsik Min [Wed, 19 Jul 2017 08:07:38 +0000 (17:07 +0900)]
Fix model name of RPI3

As model name in dtb of RPI3 has been changed, there is a issue that
peripheral-bus failed to recognize the RPI3 board. This patch removes
"Rev 1.2" from lookup string for RPI3 to solve the issue.

Change-Id: If7e2c9b5f83a6bf29c743d19ae7eae3095761934
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoMove header files in daemon/ to include directory 92/138692/3
Hyeongsik Min [Thu, 13 Jul 2017 07:57:01 +0000 (16:57 +0900)]
Move header files in daemon/ to include directory

Change-Id: Id8b9aa2e16fc9b604988075613aa53318e13883e
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoRemove unnecessary condition check in uart.c 46/138946/1
Hyeongsik Min [Fri, 14 Jul 2017 09:36:49 +0000 (18:36 +0900)]
Remove unnecessary condition check in uart.c

bytesize is always greater than zero.

Change-Id: Iae6a882a8cb1fcaee215602ef7d8dccafa2af99d
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
6 years agoEnable support of several gpio pins for RPI3 07/138807/1 accepted/tizen/unified/20170717.021132 submit/tizen/20170714.030511
Hyeongsik Min [Fri, 14 Jul 2017 01:17:18 +0000 (10:17 +0900)]
Enable support of several gpio pins for RPI3

Change-Id: I98dbcc336e34fe22712e02177f4756c432652e09
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>