platform/core/system/peripheral-bus.git
4 years agoFix a memleak 45/249345/1 tizen_4.0 submit/tizen_4.0/20201218.134343
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)

6 years agoMerge "privilege: initialize variables before using" into tizen_4.0 accepted/tizen_4.0_unified accepted/tizen/4.0/unified/20180803.172046 submit/tizen_4.0/20180724.082652
Karol Lewandowski [Fri, 13 Jul 2018 11:58:33 +0000 (11:58 +0000)]
Merge "privilege: initialize variables before using" into tizen_4.0

6 years agoprivilege: initialize variables before using 22/183922/1
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>
6 years agoChanged the i2c information of eagleye. 54/182454/1 accepted/tizen/4.0/unified/20180626.130832 submit/tizen_4.0/20180625.230553
wchang kim [Mon, 25 Jun 2018 08:25:15 +0000 (17:25 +0900)]
Changed the i2c information of eagleye.

Change-Id: Iee207ac47abd84e1a4ab85b49bf0b796c02ff606

6 years agoAdding a board of eagleye530s 58/182258/1 accepted/tizen/4.0/unified/20180625.141431 submit/tizen_4.0/20180624.222946
wchang kim [Thu, 21 Jun 2018 07:00:49 +0000 (16:00 +0900)]
Adding a board of eagleye530s

Change-Id: I4a894a34452c90f734f2fcca668f604359d36621

6 years agoFixed the file name. 57/182257/1
wchang kim [Thu, 21 Jun 2018 00:13:17 +0000 (09:13 +0900)]
Fixed the file name.

Change-Id: I3108fd13d832e73b33a6c89361bb90d59bffe887

7 years agoMerge branch 'tizen' into tizen_4.0 62/165662/1 accepted/tizen/4.0/unified/20180103.151734 submit/tizen_4.0/20180103.062259 tizen_4.0.IoT.p2_release
Segwon [Wed, 3 Jan 2018 06:10:48 +0000 (15:10 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen:
  pio: close fd when it is not negative number
  pio: assign null to handle if open is failed

Change-Id: I3587d3bd9fc7905ef7f675940952c7f31a40502c
Signed-off-by: Segwon <segwon.han@samsung.com>
7 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>
7 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>
7 years agoMerge branch 'tizen' into tizen_4.0 17/164717/1 accepted/tizen/4.0/unified/20171221.071008 submit/tizen_4.0/20171220.125806 submit/tizen_4.0/20171221.025151
Segwon [Wed, 20 Dec 2017 12:55:51 +0000 (21:55 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen: (46 commits)
  udev: change security label
  handle: do not management fd in handle
  gdbus: communicate via gdbus when close
  privilege: do not compare the return value of cynara_check() with the wrong value
  [5/5] fd passing: make fd list and send it to Lib
  gdbus: change function prefix "handle" to "peripheral_gdbus"
  handle: move duplicate header files to peripheral_handle_common.h
  handle: add fd values to handle and add interface function
  handle: change structs name in peripheral_handle.h
  handle: change the handle function name appropriately
  interface: move gpio_wait_for_udev() into peripheral_interface_gpio_open()
  etc: #ifndef string constants name change to file name
  [4/5] fd passing: can get fd from interface file
  interface: change ERROR_CHECK macro to IF_ERROR_RETURN
  util: move board, log, privilege file into util directory
  board: do not free a value obtained by a iniparser_getseckeys()
  handle: change file name "peripheral_bus.h" to "peripheral_handle.h"
  handle : change file name "peripheral_bus_util" to peripheral_handle_common"
  privilege: move peripheral_bus_check_privilege() to privilege_checker.h
  directory: change directory
  ...

Change-Id: I579e1a7e6aacab87e6230f1d8cddba715469b45d
Signed-off-by: Segwon <segwon.han@samsung.com>
7 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>
7 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>
7 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

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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

7 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

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agospec: remove unnecessary code about systemctl 25/160325/1 accepted/tizen/4.0/unified/20171115.173955 submit/tizen_4.0/20171115.102522
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>
7 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>
7 years agopio: check if the client has privilege 49/156349/1 accepted/tizen/4.0/unified/20171106.162929 submit/tizen_4.0/20171018.072455 submit/tizen_4.0/20171106.084903
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>
7 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>
7 years agopio: fix memory leak 49/155849/3 accepted/tizen/4.0/unified/20171017.212145 submit/tizen_4.0/20171016.114755 tizen_4.0.m2_release
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>
7 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>
7 years agoini: fixed to wrong ini file for rpi3 32/155632/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>
7 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>
7 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>
7 years agoi2c: try to call ioctl() to test i2c-stub when read()/write() is failed 24/155424/2 accepted/tizen/4.0/unified/20171013.121432 submit/tizen_4.0/20171013.100456 tizen_4.0.IoT.p1_release
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>
7 years agoboard: fixed to not be an unterminated array. 42/155042/1 accepted/tizen/4.0/unified/20171012.225804 submit/tizen_4.0/20171012.141856
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>
7 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>
7 years agoMerge "board: fixed allocated memory released via iniparser_getseckeys()" into tizen_4.0 accepted/tizen/4.0/unified/20171010.163327 submit/tizen_4.0/20171010.131911
Segwon [Tue, 10 Oct 2017 12:59:35 +0000 (12:59 +0000)]
Merge "board: fixed allocated memory released via iniparser_getseckeys()" into tizen_4.0

7 years agoMerge "board: increased the memory size because of unterminated string occurred....
Segwon [Tue, 10 Oct 2017 12:59:24 +0000 (12:59 +0000)]
Merge "board: increased the memory size because of unterminated string occurred." into tizen_4.0

7 years agoboard: fixed allocated memory released via iniparser_getseckeys() 73/154573/1
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>
7 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>
7 years agoboard: increased the memory size because of unterminated string occurred. 67/154567/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>
7 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>
7 years agoi2c: fixed that allocated memory is released when an error occurs. 62/154562/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>
7 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>
7 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>
7 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>
7 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>
7 years agobus: fixed a flow using a handle already freed. 53/154553/1
Segwon [Tue, 10 Oct 2017 10:35:16 +0000 (19:35 +0900)]
bus: fixed a flow using a handle already freed.

Change-Id: I524c0ce5db54baa44548f9b342b18d2106ef0ce2
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agoboard: meaningful return value is assigned to a variable like read() 51/154551/1
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: I96837735750752cd0a6715ec5bbbe66a932af0d5
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agospi: modified to the rx and tx buffers are not allocated when buffer size is zero. 49/154549/1
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: Iaf6de46674d3bcd57f9354c484dd5791458d937a
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agospi: fixed to invalid NULL check when tx_buf allocates. 48/154548/1
Segwon [Tue, 10 Oct 2017 08:53:32 +0000 (17:53 +0900)]
spi: fixed to invalid NULL check when tx_buf allocates.

Change-Id: Ic8fbf4c919c083adba2f0a9d7a7b6642b44edba1
Signed-off-by: Segwon <segwon.han@samsung.com>
7 years agoopen handle: open function flow was matched. 24/154424/2
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>
7 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>
7 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>
7 years agoMerge branch 'tizen' into tizen_4.0 51/152351/2 accepted/tizen/4.0/unified/20170926.171639 submit/tizen_4.0/20170926.023348
kibak.yoon [Tue, 26 Sep 2017 02:07:42 +0000 (11:07 +0900)]
Merge branch 'tizen' into tizen_4.0

* tizen:
  version up 0.1.0
  uart: fixed to return the -EAGAIN error type when read/write.
  uart: added flush logic before close.
  name: sync functions name with changed apis name.
  adc: the adc interface is not supported
  spi: fix bug by passing value instead of pointer as parameter
  util: added to the NULL check.
  spi: transfer the tx/rx data with the same structure variable
  board-config: add config file for Artik 520
  board-config: fix typo from "unkown" to "unknown"
  Improve logs for I2C communication
  Refactor logs messages in i2c/spi interface
  Print log messages in case of wrong write access
  Refactoring dbus interface functions
  Fix bug at spi open

Change-Id: I5adda6656374354909b0284fec182ea8de488e75
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
7 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>
7 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

7 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

7 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

7 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

7 years agospi: fix bug by passing value instead of pointer as parameter 92/149392/1 accepted/tizen/4.0/unified/20170912.184608 submit/tizen_4.0/20170912.074241
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>
7 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>
7 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

7 years agospi: transfer the tx/rx data with the same structure variable 22/148022/1 accepted/tizen/4.0/unified/20170907.200140 submit/tizen_4.0/20170907.084141
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>
(cherry picked from commit 2c2412ce0706788c57fc1ffc3c2bd8834fc17a71)

7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 years agoFix static analysis issue 12/138712/1
Hyeongsik Min [Thu, 13 Jul 2017 08:57:29 +0000 (17:57 +0900)]
Fix static analysis issue

Avoid possible overflow by casting before arithmetic operation

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