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
dab2e294
Commit
dab2e294
authored
May 06, 2016
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back new device properties material for v4.7.
parents
0224a4a3
f4d05266
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
55 additions
and
83 deletions
+55
-83
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/raumfeld.c
+4
-8
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/board-paz00.c
+1
-5
drivers/base/platform.c
drivers/base/platform.c
+10
-9
drivers/base/property.c
drivers/base/property.c
+21
-13
drivers/mfd/intel-lpss-acpi.c
drivers/mfd/intel-lpss-acpi.c
+2
-10
drivers/mfd/intel-lpss-pci.c
drivers/mfd/intel-lpss-pci.c
+4
-16
drivers/mfd/intel-lpss.c
drivers/mfd/intel-lpss.c
+1
-1
drivers/mfd/intel-lpss.h
drivers/mfd/intel-lpss.h
+2
-2
drivers/mfd/mfd-core.c
drivers/mfd/mfd-core.c
+2
-2
include/linux/mfd/core.h
include/linux/mfd/core.h
+2
-2
include/linux/platform_device.h
include/linux/platform_device.h
+3
-3
include/linux/property.h
include/linux/property.h
+3
-12
No files found.
arch/arm/mach-pxa/raumfeld.c
View file @
dab2e294
...
@@ -385,10 +385,6 @@ static struct property_entry raumfeld_rotary_properties[] = {
...
@@ -385,10 +385,6 @@ static struct property_entry raumfeld_rotary_properties[] = {
{
},
{
},
};
};
static
struct
property_set
raumfeld_rotary_property_set
=
{
.
properties
=
raumfeld_rotary_properties
,
};
static
struct
platform_device
rotary_encoder_device
=
{
static
struct
platform_device
rotary_encoder_device
=
{
.
name
=
"rotary-encoder"
,
.
name
=
"rotary-encoder"
,
.
id
=
0
,
.
id
=
0
,
...
@@ -1063,8 +1059,8 @@ static void __init __maybe_unused raumfeld_controller_init(void)
...
@@ -1063,8 +1059,8 @@ static void __init __maybe_unused raumfeld_controller_init(void)
pxa3xx_mfp_config
(
ARRAY_AND_SIZE
(
raumfeld_controller_pin_config
));
pxa3xx_mfp_config
(
ARRAY_AND_SIZE
(
raumfeld_controller_pin_config
));
gpiod_add_lookup_table
(
&
raumfeld_rotary_gpios_table
);
gpiod_add_lookup_table
(
&
raumfeld_rotary_gpios_table
);
device_add_propert
y_set
(
&
rotary_encoder_device
.
dev
,
device_add_propert
ies
(
&
rotary_encoder_device
.
dev
,
&
raumfeld_rotary_property_set
);
raumfeld_rotary_properties
);
platform_device_register
(
&
rotary_encoder_device
);
platform_device_register
(
&
rotary_encoder_device
);
spi_register_board_info
(
ARRAY_AND_SIZE
(
controller_spi_devices
));
spi_register_board_info
(
ARRAY_AND_SIZE
(
controller_spi_devices
));
...
@@ -1103,8 +1099,8 @@ static void __init __maybe_unused raumfeld_speaker_init(void)
...
@@ -1103,8 +1099,8 @@ static void __init __maybe_unused raumfeld_speaker_init(void)
platform_device_register
(
&
smc91x_device
);
platform_device_register
(
&
smc91x_device
);
gpiod_add_lookup_table
(
&
raumfeld_rotary_gpios_table
);
gpiod_add_lookup_table
(
&
raumfeld_rotary_gpios_table
);
device_add_propert
y_set
(
&
rotary_encoder_device
.
dev
,
device_add_propert
ies
(
&
rotary_encoder_device
.
dev
,
&
raumfeld_rotary_property_set
);
raumfeld_rotary_properties
);
platform_device_register
(
&
rotary_encoder_device
);
platform_device_register
(
&
rotary_encoder_device
);
raumfeld_audio_init
();
raumfeld_audio_init
();
...
...
arch/arm/mach-tegra/board-paz00.c
View file @
dab2e294
...
@@ -29,10 +29,6 @@ static struct property_entry __initdata wifi_rfkill_prop[] = {
...
@@ -29,10 +29,6 @@ static struct property_entry __initdata wifi_rfkill_prop[] = {
{
},
{
},
};
};
static
struct
property_set
__initdata
wifi_rfkill_pset
=
{
.
properties
=
wifi_rfkill_prop
,
};
static
struct
platform_device
wifi_rfkill_device
=
{
static
struct
platform_device
wifi_rfkill_device
=
{
.
name
=
"rfkill_gpio"
,
.
name
=
"rfkill_gpio"
,
.
id
=
-
1
,
.
id
=
-
1
,
...
@@ -49,7 +45,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
...
@@ -49,7 +45,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
void
__init
tegra_paz00_wifikill_init
(
void
)
void
__init
tegra_paz00_wifikill_init
(
void
)
{
{
platform_device_add_properties
(
&
wifi_rfkill_device
,
&
wifi_rfkill_pset
);
platform_device_add_properties
(
&
wifi_rfkill_device
,
wifi_rfkill_prop
);
gpiod_add_lookup_table
(
&
wifi_gpio_lookup
);
gpiod_add_lookup_table
(
&
wifi_gpio_lookup
);
platform_device_register
(
&
wifi_rfkill_device
);
platform_device_register
(
&
wifi_rfkill_device
);
}
}
drivers/base/platform.c
View file @
dab2e294
...
@@ -322,16 +322,16 @@ EXPORT_SYMBOL_GPL(platform_device_add_data);
...
@@ -322,16 +322,16 @@ EXPORT_SYMBOL_GPL(platform_device_add_data);
/**
/**
* platform_device_add_properties - add built-in properties to a platform device
* platform_device_add_properties - add built-in properties to a platform device
* @pdev: platform device to add properties to
* @pdev: platform device to add properties to
* @p
set:
properties to add
* @p
roperties: null terminated array of
properties to add
*
*
* The function will take deep copy of
the properties in @pset and attach
* The function will take deep copy of
@properties and attach the copy to the
*
the copy to the platform device. The memory associated with properties
*
platform device. The memory associated with properties will be freed when the
*
will be freed when the
platform device is released.
* platform device is released.
*/
*/
int
platform_device_add_properties
(
struct
platform_device
*
pdev
,
int
platform_device_add_properties
(
struct
platform_device
*
pdev
,
const
struct
property_set
*
pset
)
struct
property_entry
*
properties
)
{
{
return
device_add_propert
y_set
(
&
pdev
->
dev
,
pset
);
return
device_add_propert
ies
(
&
pdev
->
dev
,
properties
);
}
}
EXPORT_SYMBOL_GPL
(
platform_device_add_properties
);
EXPORT_SYMBOL_GPL
(
platform_device_add_properties
);
...
@@ -447,7 +447,7 @@ void platform_device_del(struct platform_device *pdev)
...
@@ -447,7 +447,7 @@ void platform_device_del(struct platform_device *pdev)
release_resource
(
r
);
release_resource
(
r
);
}
}
device_remove_propert
y_set
(
&
pdev
->
dev
);
device_remove_propert
ies
(
&
pdev
->
dev
);
}
}
}
}
EXPORT_SYMBOL_GPL
(
platform_device_del
);
EXPORT_SYMBOL_GPL
(
platform_device_del
);
...
@@ -526,8 +526,9 @@ struct platform_device *platform_device_register_full(
...
@@ -526,8 +526,9 @@ struct platform_device *platform_device_register_full(
if
(
ret
)
if
(
ret
)
goto
err
;
goto
err
;
if
(
pdevinfo
->
pset
)
{
if
(
pdevinfo
->
properties
)
{
ret
=
platform_device_add_properties
(
pdev
,
pdevinfo
->
pset
);
ret
=
platform_device_add_properties
(
pdev
,
pdevinfo
->
properties
);
if
(
ret
)
if
(
ret
)
goto
err
;
goto
err
;
}
}
...
...
drivers/base/property.c
View file @
dab2e294
...
@@ -19,6 +19,11 @@
...
@@ -19,6 +19,11 @@
#include <linux/etherdevice.h>
#include <linux/etherdevice.h>
#include <linux/phy.h>
#include <linux/phy.h>
struct
property_set
{
struct
fwnode_handle
fwnode
;
struct
property_entry
*
properties
;
};
static
inline
bool
is_pset_node
(
struct
fwnode_handle
*
fwnode
)
static
inline
bool
is_pset_node
(
struct
fwnode_handle
*
fwnode
)
{
{
return
!
IS_ERR_OR_NULL
(
fwnode
)
&&
fwnode
->
type
==
FWNODE_PDATA
;
return
!
IS_ERR_OR_NULL
(
fwnode
)
&&
fwnode
->
type
==
FWNODE_PDATA
;
...
@@ -801,14 +806,14 @@ static struct property_set *pset_copy_set(const struct property_set *pset)
...
@@ -801,14 +806,14 @@ static struct property_set *pset_copy_set(const struct property_set *pset)
}
}
/**
/**
* device_remove_propert
y_set
- Remove properties from a device object.
* device_remove_propert
ies
- Remove properties from a device object.
* @dev: Device whose properties to remove.
* @dev: Device whose properties to remove.
*
*
* The function removes properties previously associated to the device
* The function removes properties previously associated to the device
* secondary firmware node with device_add_propert
y_set
(). Memory allocated
* secondary firmware node with device_add_propert
ies
(). Memory allocated
* to the properties will also be released.
* to the properties will also be released.
*/
*/
void
device_remove_propert
y_set
(
struct
device
*
dev
)
void
device_remove_propert
ies
(
struct
device
*
dev
)
{
{
struct
fwnode_handle
*
fwnode
;
struct
fwnode_handle
*
fwnode
;
...
@@ -831,24 +836,27 @@ void device_remove_property_set(struct device *dev)
...
@@ -831,24 +836,27 @@ void device_remove_property_set(struct device *dev)
}
}
}
}
}
}
EXPORT_SYMBOL_GPL
(
device_remove_propert
y_set
);
EXPORT_SYMBOL_GPL
(
device_remove_propert
ies
);
/**
/**
* device_add_propert
y_set
- Add a collection of properties to a device object.
* device_add_propert
ies
- Add a collection of properties to a device object.
* @dev: Device to add properties to.
* @dev: Device to add properties to.
* @p
set
: Collection of properties to add.
* @p
roperties
: Collection of properties to add.
*
*
* Associate a collection of device properties represented by @pset with @dev
* Associate a collection of device properties represented by @properties with
* as its secondary firmware node. The function takes a copy of @pset.
* @dev as its secondary firmware node. The function takes a copy of
* @properties.
*/
*/
int
device_add_propert
y_set
(
struct
device
*
dev
,
const
struct
property_set
*
pset
)
int
device_add_propert
ies
(
struct
device
*
dev
,
struct
property_entry
*
properties
)
{
{
struct
property_set
*
p
;
struct
property_set
*
p
,
pset
;
if
(
!
p
set
)
if
(
!
p
roperties
)
return
-
EINVAL
;
return
-
EINVAL
;
p
=
pset_copy_set
(
pset
);
pset
.
properties
=
properties
;
p
=
pset_copy_set
(
&
pset
);
if
(
IS_ERR
(
p
))
if
(
IS_ERR
(
p
))
return
PTR_ERR
(
p
);
return
PTR_ERR
(
p
);
...
@@ -856,7 +864,7 @@ int device_add_property_set(struct device *dev, const struct property_set *pset)
...
@@ -856,7 +864,7 @@ int device_add_property_set(struct device *dev, const struct property_set *pset)
set_secondary_fwnode
(
dev
,
&
p
->
fwnode
);
set_secondary_fwnode
(
dev
,
&
p
->
fwnode
);
return
0
;
return
0
;
}
}
EXPORT_SYMBOL_GPL
(
device_add_propert
y_set
);
EXPORT_SYMBOL_GPL
(
device_add_propert
ies
);
/**
/**
* device_get_next_child_node - Return the next child node handle for a device
* device_get_next_child_node - Return the next child node handle for a device
...
...
drivers/mfd/intel-lpss-acpi.c
View file @
dab2e294
...
@@ -31,13 +31,9 @@ static struct property_entry spt_i2c_properties[] = {
...
@@ -31,13 +31,9 @@ static struct property_entry spt_i2c_properties[] = {
{
},
{
},
};
};
static
struct
property_set
spt_i2c_pset
=
{
.
properties
=
spt_i2c_properties
,
};
static
const
struct
intel_lpss_platform_info
spt_i2c_info
=
{
static
const
struct
intel_lpss_platform_info
spt_i2c_info
=
{
.
clk_rate
=
120000000
,
.
clk_rate
=
120000000
,
.
p
set
=
&
spt_i2c_pset
,
.
p
roperties
=
spt_i2c_properties
,
};
};
static
const
struct
intel_lpss_platform_info
bxt_info
=
{
static
const
struct
intel_lpss_platform_info
bxt_info
=
{
...
@@ -51,13 +47,9 @@ static struct property_entry bxt_i2c_properties[] = {
...
@@ -51,13 +47,9 @@ static struct property_entry bxt_i2c_properties[] = {
{
},
{
},
};
};
static
struct
property_set
bxt_i2c_pset
=
{
.
properties
=
bxt_i2c_properties
,
};
static
const
struct
intel_lpss_platform_info
bxt_i2c_info
=
{
static
const
struct
intel_lpss_platform_info
bxt_i2c_info
=
{
.
clk_rate
=
133000000
,
.
clk_rate
=
133000000
,
.
p
set
=
&
bxt_i2c_pset
,
.
p
roperties
=
bxt_i2c_properties
,
};
};
static
const
struct
acpi_device_id
intel_lpss_acpi_ids
[]
=
{
static
const
struct
acpi_device_id
intel_lpss_acpi_ids
[]
=
{
...
...
drivers/mfd/intel-lpss-pci.c
View file @
dab2e294
...
@@ -71,13 +71,9 @@ static struct property_entry spt_i2c_properties[] = {
...
@@ -71,13 +71,9 @@ static struct property_entry spt_i2c_properties[] = {
{
},
{
},
};
};
static
struct
property_set
spt_i2c_pset
=
{
.
properties
=
spt_i2c_properties
,
};
static
const
struct
intel_lpss_platform_info
spt_i2c_info
=
{
static
const
struct
intel_lpss_platform_info
spt_i2c_info
=
{
.
clk_rate
=
120000000
,
.
clk_rate
=
120000000
,
.
p
set
=
&
spt_i2c_pset
,
.
p
roperties
=
spt_i2c_properties
,
};
};
static
struct
property_entry
uart_properties
[]
=
{
static
struct
property_entry
uart_properties
[]
=
{
...
@@ -87,14 +83,10 @@ static struct property_entry uart_properties[] = {
...
@@ -87,14 +83,10 @@ static struct property_entry uart_properties[] = {
{
},
{
},
};
};
static
struct
property_set
uart_pset
=
{
.
properties
=
uart_properties
,
};
static
const
struct
intel_lpss_platform_info
spt_uart_info
=
{
static
const
struct
intel_lpss_platform_info
spt_uart_info
=
{
.
clk_rate
=
120000000
,
.
clk_rate
=
120000000
,
.
clk_con_id
=
"baudclk"
,
.
clk_con_id
=
"baudclk"
,
.
p
set
=
&
uart_pset
,
.
p
roperties
=
uart_properties
,
};
};
static
const
struct
intel_lpss_platform_info
bxt_info
=
{
static
const
struct
intel_lpss_platform_info
bxt_info
=
{
...
@@ -104,7 +96,7 @@ static const struct intel_lpss_platform_info bxt_info = {
...
@@ -104,7 +96,7 @@ static const struct intel_lpss_platform_info bxt_info = {
static
const
struct
intel_lpss_platform_info
bxt_uart_info
=
{
static
const
struct
intel_lpss_platform_info
bxt_uart_info
=
{
.
clk_rate
=
100000000
,
.
clk_rate
=
100000000
,
.
clk_con_id
=
"baudclk"
,
.
clk_con_id
=
"baudclk"
,
.
p
set
=
&
uart_pset
,
.
p
roperties
=
uart_properties
,
};
};
static
struct
property_entry
bxt_i2c_properties
[]
=
{
static
struct
property_entry
bxt_i2c_properties
[]
=
{
...
@@ -114,13 +106,9 @@ static struct property_entry bxt_i2c_properties[] = {
...
@@ -114,13 +106,9 @@ static struct property_entry bxt_i2c_properties[] = {
{
},
{
},
};
};
static
struct
property_set
bxt_i2c_pset
=
{
.
properties
=
bxt_i2c_properties
,
};
static
const
struct
intel_lpss_platform_info
bxt_i2c_info
=
{
static
const
struct
intel_lpss_platform_info
bxt_i2c_info
=
{
.
clk_rate
=
133000000
,
.
clk_rate
=
133000000
,
.
p
set
=
&
bxt_i2c_pset
,
.
p
roperties
=
bxt_i2c_properties
,
};
};
static
const
struct
pci_device_id
intel_lpss_pci_ids
[]
=
{
static
const
struct
pci_device_id
intel_lpss_pci_ids
[]
=
{
...
...
drivers/mfd/intel-lpss.c
View file @
dab2e294
...
@@ -407,7 +407,7 @@ int intel_lpss_probe(struct device *dev,
...
@@ -407,7 +407,7 @@ int intel_lpss_probe(struct device *dev,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
lpss
->
cell
->
p
set
=
info
->
pset
;
lpss
->
cell
->
p
roperties
=
info
->
properties
;
intel_lpss_init_dev
(
lpss
);
intel_lpss_init_dev
(
lpss
);
...
...
drivers/mfd/intel-lpss.h
View file @
dab2e294
...
@@ -16,14 +16,14 @@
...
@@ -16,14 +16,14 @@
struct
device
;
struct
device
;
struct
resource
;
struct
resource
;
struct
property_
set
;
struct
property_
entry
;
struct
intel_lpss_platform_info
{
struct
intel_lpss_platform_info
{
struct
resource
*
mem
;
struct
resource
*
mem
;
int
irq
;
int
irq
;
unsigned
long
clk_rate
;
unsigned
long
clk_rate
;
const
char
*
clk_con_id
;
const
char
*
clk_con_id
;
struct
property_
set
*
pset
;
struct
property_
entry
*
properties
;
};
};
int
intel_lpss_probe
(
struct
device
*
dev
,
int
intel_lpss_probe
(
struct
device
*
dev
,
...
...
drivers/mfd/mfd-core.c
View file @
dab2e294
...
@@ -193,8 +193,8 @@ static int mfd_add_device(struct device *parent, int id,
...
@@ -193,8 +193,8 @@ static int mfd_add_device(struct device *parent, int id,
goto
fail_alias
;
goto
fail_alias
;
}
}
if
(
cell
->
p
set
)
{
if
(
cell
->
p
roperties
)
{
ret
=
platform_device_add_properties
(
pdev
,
cell
->
p
set
);
ret
=
platform_device_add_properties
(
pdev
,
cell
->
p
roperties
);
if
(
ret
)
if
(
ret
)
goto
fail_alias
;
goto
fail_alias
;
}
}
...
...
include/linux/mfd/core.h
View file @
dab2e294
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#include <linux/platform_device.h>
#include <linux/platform_device.h>
struct
irq_domain
;
struct
irq_domain
;
struct
property_
set
;
struct
property_
entry
;
/* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */
/* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */
struct
mfd_cell_acpi_match
{
struct
mfd_cell_acpi_match
{
...
@@ -47,7 +47,7 @@ struct mfd_cell {
...
@@ -47,7 +47,7 @@ struct mfd_cell {
size_t
pdata_size
;
size_t
pdata_size
;
/* device properties passed to the sub devices drivers */
/* device properties passed to the sub devices drivers */
const
struct
property_set
*
pset
;
struct
property_entry
*
properties
;
/*
/*
* Device Tree compatible string
* Device Tree compatible string
...
...
include/linux/platform_device.h
View file @
dab2e294
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#define PLATFORM_DEVID_AUTO (-2)
#define PLATFORM_DEVID_AUTO (-2)
struct
mfd_cell
;
struct
mfd_cell
;
struct
property_
set
;
struct
property_
entry
;
struct
platform_device
{
struct
platform_device
{
const
char
*
name
;
const
char
*
name
;
...
@@ -73,7 +73,7 @@ struct platform_device_info {
...
@@ -73,7 +73,7 @@ struct platform_device_info {
size_t
size_data
;
size_t
size_data
;
u64
dma_mask
;
u64
dma_mask
;
const
struct
property_set
*
pset
;
struct
property_entry
*
properties
;
};
};
extern
struct
platform_device
*
platform_device_register_full
(
extern
struct
platform_device
*
platform_device_register_full
(
const
struct
platform_device_info
*
pdevinfo
);
const
struct
platform_device_info
*
pdevinfo
);
...
@@ -172,7 +172,7 @@ extern int platform_device_add_resources(struct platform_device *pdev,
...
@@ -172,7 +172,7 @@ extern int platform_device_add_resources(struct platform_device *pdev,
extern
int
platform_device_add_data
(
struct
platform_device
*
pdev
,
extern
int
platform_device_add_data
(
struct
platform_device
*
pdev
,
const
void
*
data
,
size_t
size
);
const
void
*
data
,
size_t
size
);
extern
int
platform_device_add_properties
(
struct
platform_device
*
pdev
,
extern
int
platform_device_add_properties
(
struct
platform_device
*
pdev
,
const
struct
property_set
*
pset
);
struct
property_entry
*
properties
);
extern
int
platform_device_add
(
struct
platform_device
*
pdev
);
extern
int
platform_device_add
(
struct
platform_device
*
pdev
);
extern
void
platform_device_del
(
struct
platform_device
*
pdev
);
extern
void
platform_device_del
(
struct
platform_device
*
pdev
);
extern
void
platform_device_put
(
struct
platform_device
*
pdev
);
extern
void
platform_device_put
(
struct
platform_device
*
pdev
);
...
...
include/linux/property.h
View file @
dab2e294
...
@@ -238,18 +238,9 @@ struct property_entry {
...
@@ -238,18 +238,9 @@ struct property_entry {
.name = _name_, \
.name = _name_, \
}
}
/**
int
device_add_properties
(
struct
device
*
dev
,
* struct property_set - Collection of "built-in" device properties.
struct
property_entry
*
properties
);
* @fwnode: Handle to be pointed to by the fwnode field of struct device.
void
device_remove_properties
(
struct
device
*
dev
);
* @properties: Array of properties terminated with a null entry.
*/
struct
property_set
{
struct
fwnode_handle
fwnode
;
struct
property_entry
*
properties
;
};
int
device_add_property_set
(
struct
device
*
dev
,
const
struct
property_set
*
pset
);
void
device_remove_property_set
(
struct
device
*
dev
);
bool
device_dma_supported
(
struct
device
*
dev
);
bool
device_dma_supported
(
struct
device
*
dev
);
...
...
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