forked from Minki/linux
Merge branch 'ib-pinctrl-unreg-mappings' into devel
This commit is contained in:
commit
d77552d93c
@ -201,7 +201,7 @@ static unsigned long pin_highz_conf[] = {
|
||||
};
|
||||
|
||||
/* Pin control settings */
|
||||
static struct pinctrl_map __initdata u300_pinmux_map[] = {
|
||||
static const struct pinctrl_map u300_pinmux_map[] = {
|
||||
/* anonymous maps for chip power and EMIFs */
|
||||
PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"),
|
||||
PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif0"),
|
||||
|
@ -1376,8 +1376,15 @@ void devm_pinctrl_put(struct pinctrl *p)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(devm_pinctrl_put);
|
||||
|
||||
int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
|
||||
bool dup)
|
||||
/**
|
||||
* pinctrl_register_mappings() - register a set of pin controller mappings
|
||||
* @maps: the pincontrol mappings table to register. Note the pinctrl-core
|
||||
* keeps a reference to the passed in maps, so they should _not_ be
|
||||
* marked with __initdata.
|
||||
* @num_maps: the number of maps in the mapping table
|
||||
*/
|
||||
int pinctrl_register_mappings(const struct pinctrl_map *maps,
|
||||
unsigned num_maps)
|
||||
{
|
||||
int i, ret;
|
||||
struct pinctrl_maps *maps_node;
|
||||
@ -1430,17 +1437,8 @@ int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
|
||||
if (!maps_node)
|
||||
return -ENOMEM;
|
||||
|
||||
maps_node->maps = maps;
|
||||
maps_node->num_maps = num_maps;
|
||||
if (dup) {
|
||||
maps_node->maps = kmemdup(maps, sizeof(*maps) * num_maps,
|
||||
GFP_KERNEL);
|
||||
if (!maps_node->maps) {
|
||||
kfree(maps_node);
|
||||
return -ENOMEM;
|
||||
}
|
||||
} else {
|
||||
maps_node->maps = maps;
|
||||
}
|
||||
|
||||
mutex_lock(&pinctrl_maps_mutex);
|
||||
list_add_tail(&maps_node->node, &pinctrl_maps);
|
||||
@ -1448,22 +1446,14 @@ int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pinctrl_register_mappings() - register a set of pin controller mappings
|
||||
* @maps: the pincontrol mappings table to register. This should probably be
|
||||
* marked with __initdata so it can be discarded after boot. This
|
||||
* function will perform a shallow copy for the mapping entries.
|
||||
* @num_maps: the number of maps in the mapping table
|
||||
*/
|
||||
int pinctrl_register_mappings(const struct pinctrl_map *maps,
|
||||
unsigned num_maps)
|
||||
{
|
||||
return pinctrl_register_map(maps, num_maps, true);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_register_mappings);
|
||||
|
||||
void pinctrl_unregister_map(const struct pinctrl_map *map)
|
||||
/**
|
||||
* pinctrl_unregister_mappings() - unregister a set of pin controller mappings
|
||||
* @maps: the pincontrol mappings table passed to pinctrl_register_mappings()
|
||||
* when registering the mappings.
|
||||
*/
|
||||
void pinctrl_unregister_mappings(const struct pinctrl_map *map)
|
||||
{
|
||||
struct pinctrl_maps *maps_node;
|
||||
|
||||
@ -1478,6 +1468,7 @@ void pinctrl_unregister_map(const struct pinctrl_map *map)
|
||||
}
|
||||
mutex_unlock(&pinctrl_maps_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pinctrl_unregister_mappings);
|
||||
|
||||
/**
|
||||
* pinctrl_force_sleep() - turn a given controller device into sleep state
|
||||
|
@ -236,10 +236,6 @@ extern struct pinctrl_gpio_range *
|
||||
pinctrl_find_gpio_range_from_pin_nolock(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin);
|
||||
|
||||
int pinctrl_register_map(const struct pinctrl_map *maps, unsigned num_maps,
|
||||
bool dup);
|
||||
void pinctrl_unregister_map(const struct pinctrl_map *map);
|
||||
|
||||
extern int pinctrl_force_sleep(struct pinctrl_dev *pctldev);
|
||||
extern int pinctrl_force_default(struct pinctrl_dev *pctldev);
|
||||
|
||||
|
@ -51,7 +51,7 @@ void pinctrl_dt_free_maps(struct pinctrl *p)
|
||||
struct pinctrl_dt_map *dt_map, *n1;
|
||||
|
||||
list_for_each_entry_safe(dt_map, n1, &p->dt_maps, node) {
|
||||
pinctrl_unregister_map(dt_map->map);
|
||||
pinctrl_unregister_mappings(dt_map->map);
|
||||
list_del(&dt_map->node);
|
||||
dt_free_map(dt_map->pctldev, dt_map->map,
|
||||
dt_map->num_maps);
|
||||
@ -92,7 +92,7 @@ static int dt_remember_or_free_map(struct pinctrl *p, const char *statename,
|
||||
dt_map->num_maps = num_maps;
|
||||
list_add_tail(&dt_map->node, &p->dt_maps);
|
||||
|
||||
return pinctrl_register_map(map, num_maps, false);
|
||||
return pinctrl_register_mappings(map, num_maps);
|
||||
|
||||
err_free_map:
|
||||
dt_free_map(pctldev, map, num_maps);
|
||||
|
@ -153,6 +153,7 @@ struct pinctrl_map {
|
||||
|
||||
extern int pinctrl_register_mappings(const struct pinctrl_map *map,
|
||||
unsigned num_maps);
|
||||
extern void pinctrl_unregister_mappings(const struct pinctrl_map *map);
|
||||
extern void pinctrl_provide_dummies(void);
|
||||
#else
|
||||
|
||||
@ -162,6 +163,10 @@ static inline int pinctrl_register_mappings(const struct pinctrl_map *map,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pinctrl_unregister_mappings(const struct pinctrl_map *map)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void pinctrl_provide_dummies(void)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user