platform/core/system/peripheral-bus.git
7 years agoChange argument of gpio gdbus method 11/131111/2
Sungguk Na [Thu, 25 May 2017 10:39:20 +0000 (19:39 +0900)]
Change argument of gpio gdbus method

- The gpio methods will pass handle instead of device informations.
- Add gpio routines to handle exceptional case of client close

Change-Id: I000f59f658f8b8f7c2e439b9181a1437732b7936
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoFix to handle OUT_HIGH in gpio set direction 89/131089/1
Hyeongsik Min [Thu, 25 May 2017 10:09:51 +0000 (19:09 +0900)]
Fix to handle OUT_HIGH in gpio set direction

Change-Id: I3d76dafa2ef5c9aaee123ffc04e2a62a54b7c7fe
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoClean up handle free function 19/130619/4
Hyeongsik Min [Tue, 23 May 2017 06:22:05 +0000 (15:22 +0900)]
Clean up handle free function

Without traversing the list, this patch uses g_list_find() to get a link of
current handle.

Change-Id: I7ec38d61c09f6c6fd1c68c6f93f50759109c0fdb
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoRefactoring exception handling routines to remove duplication operations 61/130761/3
Sungguk Na [Wed, 24 May 2017 01:18:20 +0000 (10:18 +0900)]
Refactoring exception handling routines to remove duplication operations

Change-Id: Ib62e79d947b01acd0c24eca9001d85009be9cbc3
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoAdd routines to handle exceptional case of client close 42/130542/2
Sungguk Na [Tue, 23 May 2017 01:07:22 +0000 (10:07 +0900)]
Add routines to handle exceptional case of client close

Change-Id: I36011f303a9183a8583fca7a2158e0a2b8ccbb6e
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoSeperate files for util functions 33/130133/2
Hyeongsik Min [Fri, 19 May 2017 07:42:57 +0000 (16:42 +0900)]
Seperate files for util functions

Add peripheral_bus_util.c/.h and put util functions that can be used by
peripheral_bus and peripheral_bus_<interface>.

Change-Id: I6a2e643f322a3af01b0d52001d36802310d4fd4f
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoPut client_info into i2c_handle 82/130082/3
Hyeongsik Min [Fri, 19 May 2017 04:37:14 +0000 (13:37 +0900)]
Put client_info into i2c_handle

This patch put struct client_info in struct pb_data_h instead of pointer of it.

Change-Id: I2e971129337202895e730324a7baeab47fa73fda
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix possible fd leak in peripheral_bus_uart_open 68/129868/6
Hyeongsik Min [Thu, 18 May 2017 08:05:08 +0000 (17:05 +0900)]
Fix possible fd leak in peripheral_bus_uart_open

Change-Id: Ibed226e76e6070bc45a2623d04a7bffe3dc68aa0
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd pwm set_polarity & get_polarity functions 94/129894/2
jino.cho [Thu, 18 May 2017 08:31:20 +0000 (17:31 +0900)]
Add pwm set_polarity & get_polarity functions

Change-Id: I39edddd0446a490e2d2eecca249d3399a0584972
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoCheck validation of the pwm handle 93/129893/2
jino.cho [Thu, 18 May 2017 08:24:14 +0000 (17:24 +0900)]
Check validation of the pwm handle

This patch adds to check validation of the pwm handle and adds
access control based on the client's bus name.

Change-Id: If2cd9cd749de271e4098dac409a902811679128d
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd pwm get_enable functions 92/129892/1
jino.cho [Thu, 18 May 2017 07:59:09 +0000 (16:59 +0900)]
Add pwm get_enable functions

This patch adds get_enable functions to read current enable status.
The type of enable was changed to boolean.

Change-Id: Ida7f8437ad452f96bf29bc4a1a1d46b85b4eb50b
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoRearrange the order of pwm functions 91/129891/1
jino.cho [Thu, 18 May 2017 07:33:10 +0000 (16:33 +0900)]
Rearrange the order of pwm functions

Change-Id: Idc658f2c159d820add8d328073f4d297b6f46d86
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd structure to store pwm client context 39/129539/4
jino.cho [Wed, 17 May 2017 01:15:07 +0000 (10:15 +0900)]
Add structure to store pwm client context

This patch adds structure to store pwm client context and changes
argument name and type of pwm gdbus method.

Change-Id: Ibfc245dd86c5da0003ae2f827e7dfb32b2ebeb18
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd and rename pwm interface functions 20/129520/5
jino.cho [Tue, 16 May 2017 08:31:55 +0000 (17:31 +0900)]
Add and rename pwm interface functions

- add pwm_set_polarity() and pwm_get_polarity()
- rename pwm_set_enabled() to pwm_set_enable()
- rename pwm_get_enabled() to pwm_get_enable()
- modify descriptions
- fix log message level

Change-Id: I4520599bc86b6111f1e55c05e73714b1d5fac1e7
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoModify pwm interface functions 19/129519/2
jino.cho [Tue, 16 May 2017 08:27:42 +0000 (17:27 +0900)]
Modify pwm interface functions

 - Change log messages
 - Rename local variables

Change-Id: I57043e47652fdd84c5d98ac084ffc57db831f4cd
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoRearrange the order of pwm interface functions 18/129518/1
jino.cho [Tue, 16 May 2017 08:17:20 +0000 (17:17 +0900)]
Rearrange the order of pwm interface functions

Change-Id: I2eb373f5764b39eeda0d37718e794863e1dda649
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd uart functions 61/128961/5
jino.cho [Fri, 12 May 2017 05:30:16 +0000 (14:30 +0900)]
Add uart functions

This patch support uart device. And, it should work properly
if the patch for peripheral-io is applied together.

Change-Id: I9e5f85c98951a751331d18df42ba6d87168dcd64
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoChange parameter type of the parity to enum 60/128960/2
jino.cho [Fri, 12 May 2017 04:20:53 +0000 (13:20 +0900)]
Change parameter type of the parity to enum

This patch change parameters (Buadrate, Bytesize, Parity and Stopbits) type
to enum and data type to unsigned char.

Change-Id: Iec619a56fe0b7bdb55c8765beab8fc7b8fee0c5b
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAllocate data buffer for i2c read/write 15/128415/3
Hyeongsik Min [Tue, 9 May 2017 23:52:55 +0000 (08:52 +0900)]
Allocate data buffer for i2c read/write

Instead of using fixed size buffer, allocate data buffer per i2c
session.

Change-Id: I1157aabcdbfb2bf1385e78e60cce4b968006253d
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix gdbus name and path 06/128306/1
Hyeongsik Min [Mon, 8 May 2017 12:44:17 +0000 (21:44 +0900)]
Fix gdbus name and path

This change fixes macro name along with the change in peripheal-io.

Change-Id: Ifd6f03126e1dabd6488172268d557c8c1da93caa
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix static analysis issue 58/128258/2 accepted/tizen/unified/20170510.013102 submit/tizen/20170508.093623 tizen_4.0.m1_release
Hyeongsik Min [Mon, 8 May 2017 07:57:34 +0000 (16:57 +0900)]
Fix static analysis issue

- UNREACHABLE_CODE at peripheral_bus_gpio.c:254
- INTEGER_OVERFLOW in adc_get_device_name()
  This patch makes the function allocate buffer for the name of adc device
  node instead of just copying strings to buffer passed through argument.

Change-Id: If5d137a846ca5727b3d2cb00f4a2b6d313abf75f
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix build break on 64 bit architecture 57/128257/1
Hyeongsik Min [Mon, 8 May 2017 07:39:38 +0000 (16:39 +0900)]
Fix build break on 64 bit architecture

Change-Id: Ief79422f096a31447dc79068d1128594f4129e95
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoAdd structure to store i2c client context 27/128127/2 submit/tizen/20170508.033648
Hyeongsik Min [Sun, 7 May 2017 09:31:29 +0000 (18:31 +0900)]
Add structure to store i2c client context

- Add access control based on the client's bus name.
- Change argument name and type of i2c gdbus method.

Change-Id: I2d81181b41cc35ca34c71fefcf2beb8af0bc92ce
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix svace issue in gpio interface 78/128078/3
Hyeongsik Min [Fri, 5 May 2017 01:57:42 +0000 (10:57 +0900)]
Fix svace issue in gpio interface

- DEREF_AFTER_NULL.EX in peripheral_bus_gpio_open.
  Null pointer is dereferenced after peripherl_bus_gpio_data_new returns null.
- UNREACHABLE_CODE in peripheral_bus_gpio_register_irq().
  gpio->io_id will be zero if it failed and cannot be less than zero.

Change-Id: Ic780ba4362ef13273c3cb2f367ad13276ea429c5
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix svace issue in i2c interface 77/128077/2
Hyeongsik Min [Fri, 5 May 2017 01:30:05 +0000 (10:30 +0900)]
Fix svace issue in i2c interface

- Fix UNREACHABLE_CODE in i2c_open
- Add exception handling code in i2c_close
- Pass return value of ioctl in i2c_set_address

Change-Id: I5c8483948bb107034f116c47756231d7a09de57a
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoMake all warnings into errors 01/127901/1
Hyeongsik Min [Tue, 2 May 2017 07:47:17 +0000 (16:47 +0900)]
Make all warnings into errors

And removed unused variable in CMakeLists

Change-Id: I87ed0410f245b5a2391cf8f3c9fc96d669233777
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoPut i2c/pwm_skeleton variable to pb_data 00/127900/1
Hyeongsik Min [Mon, 1 May 2017 11:21:09 +0000 (20:21 +0900)]
Put i2c/pwm_skeleton variable to pb_data

Change-Id: I7f55e22e159e705cafc2a952b8877ea0d5b8b3b7
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoSupport gpio interrupt 41/127641/4
jino.cho [Tue, 18 Apr 2017 07:29:27 +0000 (16:29 +0900)]
Support gpio interrupt

The gpio interrupt should work properly if the patch for
peripheral-io is applied together.

Change-Id: I0bf71501b54728ad0ce83a623e084bf8227b3e9a
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoFix logic in gpio_write and gpio_get_direction 10/127210/2
Hyeongsik Min [Wed, 26 Apr 2017 11:31:03 +0000 (20:31 +0900)]
Fix logic in gpio_write and gpio_get_direction

- Return error if direction is input mode
- Update direction state along with input value

Change-Id: I360df5a6c986defaf25a71cf3a47785854b3c9a3
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoUpdate package version to 0.0.3 93/127093/1 accepted/tizen/unified/20170426.200825 submit/tizen/20170426.072552 submit/tizen/20170426.072600
Hyeongsik Min [Wed, 26 Apr 2017 07:12:15 +0000 (16:12 +0900)]
Update package version to 0.0.3

Change-Id: I599f04c285d7e142b9dfbb31efdc03f82e1ca8eb
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoRemove i2c_set_address() API 10/126810/3
Hyeongsik Min [Tue, 25 Apr 2017 05:53:38 +0000 (14:53 +0900)]
Remove i2c_set_address() API

i2c_open() will pass bus and address argument together.

Change-Id: Iedd94d1554bc17764f64b1d31ca6e8c10ad87111
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoPass pb_data to callbacks of gpio methods 46/127046/3
jino.cho [Wed, 26 Apr 2017 02:34:17 +0000 (11:34 +0900)]
Pass pb_data to callbacks of gpio methods

Previous commit missed adding pb_data to argument.
This commit fix crash issue due to the missing.

Change-Id: I75d3cffe6a09c72b6976d5581e22153866479f1b
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoAdd gpio instance managing 33/126933/4
jino.cho [Tue, 25 Apr 2017 09:30:29 +0000 (18:30 +0900)]
Add gpio instance managing

Change-Id: I3c9e273de2fa8c28c7f1bbcb48afe61dc5598af8
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoChange argument name in i2c interface 09/126809/1
Hyeongsik Min [Tue, 25 Apr 2017 05:51:14 +0000 (14:51 +0900)]
Change argument name in i2c interface

- Change file_hndl to fd
- Remove commented out codes in i2c.c
- Change log message format in i2c.c

Change-Id: If64e0fdd54f91eda232095693056044fb82b7502
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoFix gdbus interface prefix and typo 23/126523/2
Hyeongsik Min [Mon, 24 Apr 2017 04:09:35 +0000 (13:09 +0900)]
Fix gdbus interface prefix and typo

Removed 'system.' from interface name.

Change-Id: I864efa355360709cb31a77390b4cad039e00ef16
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoChange gdbus interface with gdbus-codegen 36/126436/6
Sungguk Na [Fri, 21 Apr 2017 10:47:27 +0000 (19:47 +0900)]
Change gdbus interface with gdbus-codegen

Change-Id: I568508456be8326ff95385a2839691ebd791f86b
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
7 years agoRemove exception handling in gpio_open() 55/126155/3
jino.cho [Thu, 20 Apr 2017 08:50:03 +0000 (17:50 +0900)]
Remove exception handling in gpio_open()

Calling the gpio_close as a exception handling code in gpio_open()
was removed.

Change-Id: I9fb886d051aabd12b5222e37916c04ac5c464f36
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoFix wrong log message in gpio_close 48/126148/2
jino.cho [Thu, 20 Apr 2017 08:23:26 +0000 (17:23 +0900)]
Fix wrong log message in gpio_close

Change-Id: Iec45696b851495fe2e95060c63ae0f6441dc92ab
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoRename peripheral_i2c_context_h to peripheral_i2c_h 32/126032/2
Hyeongsik Min [Wed, 19 Apr 2017 10:55:22 +0000 (19:55 +0900)]
Rename peripheral_i2c_context_h to peripheral_i2c_h

Change-Id: Id304caf9e1de0a07d90a8279e7aa03ebaf746234
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoMove global variables to periheral_bus_s structure 71/125671/4
jino.cho [Tue, 18 Apr 2017 09:37:40 +0000 (18:37 +0900)]
Move global variables to periheral_bus_s structure

This patch adds periheral_bus_s structure type to gather global
variables into it.

Change-Id: If90c0f09deca9ca81438441d37e8024878bf715c
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoRemove i2c_set_frequency interface 50/125650/1
Hyeongsik Min [Tue, 18 Apr 2017 07:57:44 +0000 (16:57 +0900)]
Remove i2c_set_frequency interface

As ioctl for frequency setting is not defined in kernel, remove the
function and related enum type.

Change-Id: I3031b01e65995029251b6f33a1285ecffe66d58f
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
7 years agoRearrange the order of gpio interface functions 30/125630/3
jino.cho [Tue, 18 Apr 2017 07:03:26 +0000 (16:03 +0900)]
Rearrange the order of gpio interface functions

Change-Id: I6259f6a387cab92d7fec91ff48b5db76e0441ff1
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoImport source codes from iotbus 47/125547/2
jino.cho [Tue, 18 Apr 2017 03:37:53 +0000 (12:37 +0900)]
Import source codes from iotbus

- Import server source codes from below
  https://github.com/tizen-artik/iotbus

- Fix coding style and Svace issues
- Fix build warnings and clean up codes
- Rename peripheral_server to peripheral_bus

Change-Id: Ic6918f28cc8055f6a4cacba4c94ec45247e9b959
Signed-off-by: jino.cho <jino.cho@samsung.com>
7 years agoInitial empty repository master
Tizen Infrastructure [Mon, 17 Apr 2017 04:12:45 +0000 (21:12 -0700)]
Initial empty repository