Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
38593426
Commit
38593426
authored
Jul 25, 2016
by
Thierry Reding
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-4.8/mfd' into for-4.8/drivers
parents
017bb04e
2b66bd69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
drivers/platform/chrome/cros_ec_proto.c
drivers/platform/chrome/cros_ec_proto.c
+17
-0
include/linux/mfd/cros_ec.h
include/linux/mfd/cros_ec.h
+15
-0
include/linux/mfd/cros_ec_commands.h
include/linux/mfd/cros_ec_commands.h
+31
-0
No files found.
drivers/platform/chrome/cros_ec_proto.c
View file @
38593426
...
@@ -380,3 +380,20 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
...
@@ -380,3 +380,20 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev,
return
ret
;
return
ret
;
}
}
EXPORT_SYMBOL
(
cros_ec_cmd_xfer
);
EXPORT_SYMBOL
(
cros_ec_cmd_xfer
);
int
cros_ec_cmd_xfer_status
(
struct
cros_ec_device
*
ec_dev
,
struct
cros_ec_command
*
msg
)
{
int
ret
;
ret
=
cros_ec_cmd_xfer
(
ec_dev
,
msg
);
if
(
ret
<
0
)
{
dev_err
(
ec_dev
->
dev
,
"Command xfer error (err:%d)
\n
"
,
ret
);
}
else
if
(
msg
->
result
!=
EC_RES_SUCCESS
)
{
dev_dbg
(
ec_dev
->
dev
,
"Command result (err: %d)
\n
"
,
msg
->
result
);
return
-
EPROTO
;
}
return
ret
;
}
EXPORT_SYMBOL
(
cros_ec_cmd_xfer_status
);
include/linux/mfd/cros_ec.h
View file @
38593426
...
@@ -225,6 +225,21 @@ int cros_ec_check_result(struct cros_ec_device *ec_dev,
...
@@ -225,6 +225,21 @@ int cros_ec_check_result(struct cros_ec_device *ec_dev,
int
cros_ec_cmd_xfer
(
struct
cros_ec_device
*
ec_dev
,
int
cros_ec_cmd_xfer
(
struct
cros_ec_device
*
ec_dev
,
struct
cros_ec_command
*
msg
);
struct
cros_ec_command
*
msg
);
/**
* cros_ec_cmd_xfer_status - Send a command to the ChromeOS EC
*
* This function is identical to cros_ec_cmd_xfer, except it returns success
* status only if both the command was transmitted successfully and the EC
* replied with success status. It's not necessary to check msg->result when
* using this function.
*
* @ec_dev: EC device
* @msg: Message to write
* @return: Num. of bytes transferred on success, <0 on failure
*/
int
cros_ec_cmd_xfer_status
(
struct
cros_ec_device
*
ec_dev
,
struct
cros_ec_command
*
msg
);
/**
/**
* cros_ec_remove - Remove a ChromeOS EC
* cros_ec_remove - Remove a ChromeOS EC
*
*
...
...
include/linux/mfd/cros_ec_commands.h
View file @
38593426
...
@@ -949,6 +949,37 @@ struct ec_params_pwm_set_fan_duty {
...
@@ -949,6 +949,37 @@ struct ec_params_pwm_set_fan_duty {
uint32_t
percent
;
uint32_t
percent
;
}
__packed
;
}
__packed
;
#define EC_CMD_PWM_SET_DUTY 0x25
/* 16 bit duty cycle, 0xffff = 100% */
#define EC_PWM_MAX_DUTY 0xffff
enum
ec_pwm_type
{
/* All types, indexed by board-specific enum pwm_channel */
EC_PWM_TYPE_GENERIC
=
0
,
/* Keyboard backlight */
EC_PWM_TYPE_KB_LIGHT
,
/* Display backlight */
EC_PWM_TYPE_DISPLAY_LIGHT
,
EC_PWM_TYPE_COUNT
,
};
struct
ec_params_pwm_set_duty
{
uint16_t
duty
;
/* Duty cycle, EC_PWM_MAX_DUTY = 100% */
uint8_t
pwm_type
;
/* ec_pwm_type */
uint8_t
index
;
/* Type-specific index, or 0 if unique */
}
__packed
;
#define EC_CMD_PWM_GET_DUTY 0x26
struct
ec_params_pwm_get_duty
{
uint8_t
pwm_type
;
/* ec_pwm_type */
uint8_t
index
;
/* Type-specific index, or 0 if unique */
}
__packed
;
struct
ec_response_pwm_get_duty
{
uint16_t
duty
;
/* Duty cycle, EC_PWM_MAX_DUTY = 100% */
}
__packed
;
/*****************************************************************************/
/*****************************************************************************/
/*
/*
* Lightbar commands. This looks worse than it is. Since we only use one HOST
* Lightbar commands. This looks worse than it is. Since we only use one HOST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment