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
nexedi
linux
Commits
26757fbf
Commit
26757fbf
authored
Dec 13, 2017
by
Vinod Koul
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'topic/device_changes' into topic/qcom
parents
38680bc6
146b4dbb
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
53 additions
and
0 deletions
+53
-0
drivers/acpi/bus.c
drivers/acpi/bus.c
+18
-0
drivers/acpi/property.c
drivers/acpi/property.c
+8
-0
drivers/base/property.c
drivers/base/property.c
+7
-0
drivers/of/property.c
drivers/of/property.c
+8
-0
include/linux/acpi.h
include/linux/acpi.h
+6
-0
include/linux/fwnode.h
include/linux/fwnode.h
+4
-0
include/linux/property.h
include/linux/property.h
+2
-0
No files found.
drivers/acpi/bus.c
View file @
26757fbf
...
@@ -785,6 +785,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
...
@@ -785,6 +785,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
}
}
EXPORT_SYMBOL_GPL
(
acpi_match_device
);
EXPORT_SYMBOL_GPL
(
acpi_match_device
);
void
*
acpi_get_match_data
(
const
struct
device
*
dev
)
{
const
struct
acpi_device_id
*
match
;
if
(
!
dev
->
driver
)
return
NULL
;
if
(
!
dev
->
driver
->
acpi_match_table
)
return
NULL
;
match
=
acpi_match_device
(
dev
->
driver
->
acpi_match_table
,
dev
);
if
(
!
match
)
return
NULL
;
return
(
void
*
)
match
->
driver_data
;
}
EXPORT_SYMBOL_GPL
(
acpi_get_match_data
);
int
acpi_match_device_ids
(
struct
acpi_device
*
device
,
int
acpi_match_device_ids
(
struct
acpi_device
*
device
,
const
struct
acpi_device_id
*
ids
)
const
struct
acpi_device_id
*
ids
)
{
{
...
...
drivers/acpi/property.c
View file @
26757fbf
...
@@ -1271,9 +1271,17 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
...
@@ -1271,9 +1271,17 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
return
0
;
return
0
;
}
}
static
void
*
acpi_fwnode_device_get_match_data
(
const
struct
fwnode_handle
*
fwnode
,
const
struct
device
*
dev
)
{
return
acpi_get_match_data
(
dev
);
}
#define DECLARE_ACPI_FWNODE_OPS(ops) \
#define DECLARE_ACPI_FWNODE_OPS(ops) \
const struct fwnode_operations ops = { \
const struct fwnode_operations ops = { \
.device_is_available = acpi_fwnode_device_is_available, \
.device_is_available = acpi_fwnode_device_is_available, \
.device_get_match_data = acpi_fwnode_device_get_match_data, \
.property_present = acpi_fwnode_property_present, \
.property_present = acpi_fwnode_property_present, \
.property_read_int_array = \
.property_read_int_array = \
acpi_fwnode_property_read_int_array, \
acpi_fwnode_property_read_int_array, \
...
...
drivers/base/property.c
View file @
26757fbf
...
@@ -1340,3 +1340,10 @@ int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
...
@@ -1340,3 +1340,10 @@ int fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
return
fwnode_call_int_op
(
fwnode
,
graph_parse_endpoint
,
endpoint
);
return
fwnode_call_int_op
(
fwnode
,
graph_parse_endpoint
,
endpoint
);
}
}
EXPORT_SYMBOL
(
fwnode_graph_parse_endpoint
);
EXPORT_SYMBOL
(
fwnode_graph_parse_endpoint
);
void
*
device_get_match_data
(
struct
device
*
dev
)
{
return
fwnode_call_ptr_op
(
dev_fwnode
(
dev
),
device_get_match_data
,
dev
);
}
EXPORT_SYMBOL_GPL
(
device_get_match_data
);
drivers/of/property.c
View file @
26757fbf
...
@@ -981,10 +981,18 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
...
@@ -981,10 +981,18 @@ static int of_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
return
0
;
return
0
;
}
}
static
void
*
of_fwnode_device_get_match_data
(
const
struct
fwnode_handle
*
fwnode
,
const
struct
device
*
dev
)
{
return
(
void
*
)
of_device_get_match_data
(
dev
);
}
const
struct
fwnode_operations
of_fwnode_ops
=
{
const
struct
fwnode_operations
of_fwnode_ops
=
{
.
get
=
of_fwnode_get
,
.
get
=
of_fwnode_get
,
.
put
=
of_fwnode_put
,
.
put
=
of_fwnode_put
,
.
device_is_available
=
of_fwnode_device_is_available
,
.
device_is_available
=
of_fwnode_device_is_available
,
.
device_get_match_data
=
of_fwnode_device_get_match_data
,
.
property_present
=
of_fwnode_property_present
,
.
property_present
=
of_fwnode_property_present
,
.
property_read_int_array
=
of_fwnode_property_read_int_array
,
.
property_read_int_array
=
of_fwnode_property_read_int_array
,
.
property_read_string_array
=
of_fwnode_property_read_string_array
,
.
property_read_string_array
=
of_fwnode_property_read_string_array
,
...
...
include/linux/acpi.h
View file @
26757fbf
...
@@ -584,6 +584,7 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
...
@@ -584,6 +584,7 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
const
struct
acpi_device_id
*
acpi_match_device
(
const
struct
acpi_device_id
*
ids
,
const
struct
acpi_device_id
*
acpi_match_device
(
const
struct
acpi_device_id
*
ids
,
const
struct
device
*
dev
);
const
struct
device
*
dev
);
void
*
acpi_get_match_data
(
const
struct
device
*
dev
);
extern
bool
acpi_driver_match_device
(
struct
device
*
dev
,
extern
bool
acpi_driver_match_device
(
struct
device
*
dev
,
const
struct
device_driver
*
drv
);
const
struct
device_driver
*
drv
);
int
acpi_device_uevent_modalias
(
struct
device
*
,
struct
kobj_uevent_env
*
);
int
acpi_device_uevent_modalias
(
struct
device
*
,
struct
kobj_uevent_env
*
);
...
@@ -755,6 +756,11 @@ static inline const struct acpi_device_id *acpi_match_device(
...
@@ -755,6 +756,11 @@ static inline const struct acpi_device_id *acpi_match_device(
return
NULL
;
return
NULL
;
}
}
static
inline
void
*
acpi_get_match_data
(
const
struct
device
*
dev
)
{
return
NULL
;
}
static
inline
bool
acpi_driver_match_device
(
struct
device
*
dev
,
static
inline
bool
acpi_driver_match_device
(
struct
device
*
dev
,
const
struct
device_driver
*
drv
)
const
struct
device_driver
*
drv
)
{
{
...
...
include/linux/fwnode.h
View file @
26757fbf
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include <linux/types.h>
#include <linux/types.h>
struct
fwnode_operations
;
struct
fwnode_operations
;
struct
device
;
struct
fwnode_handle
{
struct
fwnode_handle
{
struct
fwnode_handle
*
secondary
;
struct
fwnode_handle
*
secondary
;
...
@@ -51,6 +52,7 @@ struct fwnode_reference_args {
...
@@ -51,6 +52,7 @@ struct fwnode_reference_args {
* struct fwnode_operations - Operations for fwnode interface
* struct fwnode_operations - Operations for fwnode interface
* @get: Get a reference to an fwnode.
* @get: Get a reference to an fwnode.
* @put: Put a reference to an fwnode.
* @put: Put a reference to an fwnode.
* @device_get_match_data: Return the device driver match data.
* @property_present: Return true if a property is present.
* @property_present: Return true if a property is present.
* @property_read_integer_array: Read an array of integer properties. Return
* @property_read_integer_array: Read an array of integer properties. Return
* zero on success, a negative error code
* zero on success, a negative error code
...
@@ -71,6 +73,8 @@ struct fwnode_operations {
...
@@ -71,6 +73,8 @@ struct fwnode_operations {
struct
fwnode_handle
*
(
*
get
)(
struct
fwnode_handle
*
fwnode
);
struct
fwnode_handle
*
(
*
get
)(
struct
fwnode_handle
*
fwnode
);
void
(
*
put
)(
struct
fwnode_handle
*
fwnode
);
void
(
*
put
)(
struct
fwnode_handle
*
fwnode
);
bool
(
*
device_is_available
)(
const
struct
fwnode_handle
*
fwnode
);
bool
(
*
device_is_available
)(
const
struct
fwnode_handle
*
fwnode
);
void
*
(
*
device_get_match_data
)(
const
struct
fwnode_handle
*
fwnode
,
const
struct
device
*
dev
);
bool
(
*
property_present
)(
const
struct
fwnode_handle
*
fwnode
,
bool
(
*
property_present
)(
const
struct
fwnode_handle
*
fwnode
,
const
char
*
propname
);
const
char
*
propname
);
int
(
*
property_read_int_array
)(
const
struct
fwnode_handle
*
fwnode
,
int
(
*
property_read_int_array
)(
const
struct
fwnode_handle
*
fwnode
,
...
...
include/linux/property.h
View file @
26757fbf
...
@@ -275,6 +275,8 @@ bool device_dma_supported(struct device *dev);
...
@@ -275,6 +275,8 @@ bool device_dma_supported(struct device *dev);
enum
dev_dma_attr
device_get_dma_attr
(
struct
device
*
dev
);
enum
dev_dma_attr
device_get_dma_attr
(
struct
device
*
dev
);
void
*
device_get_match_data
(
struct
device
*
dev
);
int
device_get_phy_mode
(
struct
device
*
dev
);
int
device_get_phy_mode
(
struct
device
*
dev
);
void
*
device_get_mac_address
(
struct
device
*
dev
,
char
*
addr
,
int
alen
);
void
*
device_get_mac_address
(
struct
device
*
dev
,
char
*
addr
,
int
alen
);
...
...
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