gpio fixes for v5.18-rc3
- fix the set/get_multiple() callbacks in gpio-sim - use correct format characters in gpiolib-acpi - use an unsigned type for pins in gpiolib-acpi -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmJbI2UACgkQEacuoBRx 13Iu1hAAmPpHwe64eECqWdCR0b6L/XZg4gihDaXa4EObL91gBNQL/SR+CnhCGmjm 8PJwoKSUIHyUGI9qQ83Na4jtDrcNV+9H2EgdgA7PHMDX6P5kS6NuaxzvJ7UPi+xB tBVFgqGwx25JAE71/22bmH3CDWTdPDXm9FSTPItQiOXweBBzJKNGQegJYzo3Z1M7 3jLwkvU0LUI7YvjZHRG8vSp2MV3PGWUsDnaBOQ+ajhBQLnEgTudQSsh9Z2e/zZVR MJ26FG5pkzbJ+fY4ern9S84PR/IDcPPMcjO63VHO8AY0gR78aNNBuOj7TTOdsbk6 Rs+z9LPFsNsJBNxqD6iWXMKK35ox6jThqja31w3v9C41uf1sfMFidaUqrBX+k6uN d8oX2VcvsXVtnh9KqKsAijpQQxkZbrfkfh/O4xy/IOZv/r6WHUUtzae/DelfmNhu eM+dVfaPywxQ+HSiqWjklgz6vKzAxNEJJbklFpbwfyJPeWucpD5HGhyWftI4QzsP 1kx0HxcQ20sE5Euiw8yqcR0ZaBc+Sdu7TU8kt2NbMxpBDf58Rs6bd19MsD/p9+Ge JF09kNTh3iWTbtpcK7yww1TccbuzvKUVImsUWWnjLIk8e3Ar0XP3LGWCs0WgqYEf z39CQJ8iVN2/xOtsm0WLUDnce6FATqc2O75sLB3qkf1TaMYQj/s= =Yt3p -----END PGP SIGNATURE----- Merge tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "A single fix for gpio-sim and two patches for GPIO ACPI pulled from Andy: - fix the set/get_multiple() callbacks in gpio-sim - use correct format characters in gpiolib-acpi - use an unsigned type for pins in gpiolib-acpi" * tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: fix setting and getting multiple lines gpiolib: acpi: Convert type for pin to be unsigned gpiolib: acpi: use correct format characters
This commit is contained in:
commit
de6e933668
@ -134,7 +134,7 @@ static int gpio_sim_get_multiple(struct gpio_chip *gc,
|
||||
struct gpio_sim_chip *chip = gpiochip_get_data(gc);
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
bitmap_copy(bits, chip->value_map, gc->ngpio);
|
||||
bitmap_replace(bits, bits, chip->value_map, mask, gc->ngpio);
|
||||
mutex_unlock(&chip->lock);
|
||||
|
||||
return 0;
|
||||
@ -146,7 +146,7 @@ static void gpio_sim_set_multiple(struct gpio_chip *gc,
|
||||
struct gpio_sim_chip *chip = gpiochip_get_data(gc);
|
||||
|
||||
mutex_lock(&chip->lock);
|
||||
bitmap_copy(chip->value_map, bits, gc->ngpio);
|
||||
bitmap_replace(chip->value_map, chip->value_map, bits, mask, gc->ngpio);
|
||||
mutex_unlock(&chip->lock);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ static int acpi_gpiochip_find(struct gpio_chip *gc, void *data)
|
||||
* controller does not have GPIO chip registered at the moment. This is to
|
||||
* support probe deferral.
|
||||
*/
|
||||
static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
|
||||
static struct gpio_desc *acpi_get_gpiod(char *path, unsigned int pin)
|
||||
{
|
||||
struct gpio_chip *chip;
|
||||
acpi_handle handle;
|
||||
@ -136,7 +136,7 @@ static struct gpio_desc *acpi_get_gpiod(char *path, int pin)
|
||||
* as it is intended for use outside of the GPIO layer (in a similar fashion to
|
||||
* gpiod_get_index() for example) it also holds a reference to the GPIO device.
|
||||
*/
|
||||
struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label)
|
||||
struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char *label)
|
||||
{
|
||||
struct gpio_desc *gpio;
|
||||
int ret;
|
||||
@ -317,11 +317,12 @@ static struct gpio_desc *acpi_request_own_gpiod(struct gpio_chip *chip,
|
||||
return desc;
|
||||
}
|
||||
|
||||
static bool acpi_gpio_in_ignore_list(const char *controller_in, int pin_in)
|
||||
static bool acpi_gpio_in_ignore_list(const char *controller_in, unsigned int pin_in)
|
||||
{
|
||||
const char *controller, *pin_str;
|
||||
int len, pin;
|
||||
unsigned int pin;
|
||||
char *endp;
|
||||
int len;
|
||||
|
||||
controller = ignore_wake;
|
||||
while (controller) {
|
||||
@ -354,13 +355,13 @@ err:
|
||||
static bool acpi_gpio_irq_is_wake(struct device *parent,
|
||||
struct acpi_resource_gpio *agpio)
|
||||
{
|
||||
int pin = agpio->pin_table[0];
|
||||
unsigned int pin = agpio->pin_table[0];
|
||||
|
||||
if (agpio->wake_capable != ACPI_WAKE_CAPABLE)
|
||||
return false;
|
||||
|
||||
if (acpi_gpio_in_ignore_list(dev_name(parent), pin)) {
|
||||
dev_info(parent, "Ignoring wakeup on pin %d\n", pin);
|
||||
dev_info(parent, "Ignoring wakeup on pin %u\n", pin);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -378,7 +379,8 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
|
||||
struct acpi_gpio_event *event;
|
||||
irq_handler_t handler = NULL;
|
||||
struct gpio_desc *desc;
|
||||
int ret, pin, irq;
|
||||
unsigned int pin;
|
||||
int ret, irq;
|
||||
|
||||
if (!acpi_gpio_get_irq_resource(ares, &agpio))
|
||||
return AE_OK;
|
||||
@ -387,8 +389,8 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
|
||||
pin = agpio->pin_table[0];
|
||||
|
||||
if (pin <= 255) {
|
||||
char ev_name[5];
|
||||
sprintf(ev_name, "_%c%02hhX",
|
||||
char ev_name[8];
|
||||
sprintf(ev_name, "_%c%02X",
|
||||
agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
|
||||
pin);
|
||||
if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
|
||||
@ -1098,7 +1100,7 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address,
|
||||
|
||||
length = min_t(u16, agpio->pin_table_length, pin_index + bits);
|
||||
for (i = pin_index; i < length; ++i) {
|
||||
int pin = agpio->pin_table[i];
|
||||
unsigned int pin = agpio->pin_table[i];
|
||||
struct acpi_gpio_connection *conn;
|
||||
struct gpio_desc *desc;
|
||||
bool found;
|
||||
|
@ -688,7 +688,7 @@ void acpi_dev_remove_driver_gpios(struct acpi_device *adev);
|
||||
int devm_acpi_dev_add_driver_gpios(struct device *dev,
|
||||
const struct acpi_gpio_mapping *gpios);
|
||||
|
||||
struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label);
|
||||
struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin, char *label);
|
||||
|
||||
#else /* CONFIG_GPIOLIB && CONFIG_ACPI */
|
||||
|
||||
@ -705,6 +705,12 @@ static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static inline struct gpio_desc *acpi_get_and_request_gpiod(char *path, unsigned int pin,
|
||||
char *label)
|
||||
{
|
||||
return ERR_PTR(-ENOSYS);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_GPIOLIB && CONFIG_ACPI */
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user