drivers/regmap: add exit function interface.
Signed-off-by: likun17 <likun17@xiaomi.com>
This commit is contained in:
parent
1661a66843
commit
7913b249ca
|
@ -377,6 +377,11 @@ void regmap_exit(FAR struct regmap_s *map)
|
|||
nxmutex_destroy(&map->mutex[0]);
|
||||
}
|
||||
|
||||
if (map->bus->exit != NULL)
|
||||
{
|
||||
map->bus->exit(map->bus);
|
||||
}
|
||||
|
||||
kmm_free(map->bus);
|
||||
kmm_free(map);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,10 @@ typedef CODE int (*write_t)(FAR struct regmap_bus_s *bus,
|
|||
FAR const void *data,
|
||||
unsigned int count);
|
||||
|
||||
/* Resources destroyed. */
|
||||
|
||||
typedef CODE void (*exit_t)(FAR struct regmap_bus_s *bus);
|
||||
|
||||
/* Description of a hardware bus for the register map infrastructure. */
|
||||
|
||||
struct regmap_bus_s
|
||||
|
@ -65,6 +69,7 @@ struct regmap_bus_s
|
|||
reg_write_t reg_write;
|
||||
read_t read;
|
||||
write_t write;
|
||||
exit_t exit;
|
||||
};
|
||||
|
||||
/* Configuration for the register map of a device.
|
||||
|
|
Loading…
Reference in New Issue