Age | Commit message (Collapse) | Author | Files | Lines |
|
Some of the functions are using struct fwnode_handle, some struct device
pointer. In the GPIO library the firmware node of the GPIO device is the
same as GPIO node of the GPIO chip. Due to this fact we may use former
to access properties everywhere in the code.
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Tested-by: Marijn Suijten <[email protected]>
[Bartosz: stick to the 80-char limit where it's not hurting readability]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
<linux/kernel.h> is included only for using container_of().
Include <linux/container_of.h> instead, it is much lighter.
Signed-off-by: Christophe JAILLET <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into gpio/for-next
Introduce the i2c_client_get_device_id() helper.
|
|
gpio-line-names really depends on ti,ngpios. However, the maximum value
we have seen across the board is on K2G and da850 platforms where it can
be upto 144.
Link: https://lore.kernel.org/linux-arm-kernel/20221115200357.qa2rvw3clbz7unzq@symptom/T/#u
Fixes: c830b87a761b ("dt-bindings: gpio: gpio-davinci: Convert to json-schema")
Reported-by: Robert Nelson <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next
intel-gpio for v6.2-1
* Miscellaneous updates to the core (cdev, acpi) and Intel Merrifield driver
The following is an automated git shortlog grouped by driver:
gpiolib:
- cdev: Fix typo in kernel doc for struct line
- acpi: Use METHOD_NAME__AEI macro for acpi_walk_resources
merrifield:
- Use str_enable_disable() helper
|
|
Note that this is a RFC patch and not meant to be merged. I looked into
a problem with linux-next-20221110 on the Qualcomm SA8540P automotive
board (sc8280xp) where the UFS host controller would fail to probe due
to repeated probe deferrals when trying to get reset-gpios via
devm_gpiod_get_optional().
of_get_named_gpiod_flags() returns -EPROBE_DEFER, which is caused by
of_gpiochip_match_node_and_xlate() returning 0 since the of_xlate function
pointer is not set for the qcom,sc8280xp-tlmm pinctrl driver. The
pinctrl driver doesn't define one, so of_gpiochip_add() should
automatically setup of_gpio_simple_xlate() on it's behalf. This doesn't
happen since the fwnode member on the struct gpiochip is set to null
when of_gpiochip_add() is called. Let's work around this by ensuring
that it's set if available.
Note that this broke sometime within the last few weeks within
linux-next and I haven't bisected this. I'm posting this in the hopes
that someone may know offhand which patch(es) may have broken this.
Signed-off-by: Brian Masney <[email protected]>
Tested-by: Marijn Suijten <[email protected]>
Tested-by: Konrad Dybcio <[email protected]>
Tested-by: Steev Klimaszewski <[email protected]> #Lenovo Thinkpad X13s
Tested-by: Neil Armstrong <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Remove use of the deprecated mask_invert flag. Inverted mask
registers (where a '1' bit enables an IRQ) can be described more
directly as an unmask register.
Signed-off-by: Aidan MacDonald <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The OF node store in chip->fwnode is used to explicitly override the FW
node for a GPIO chip. For chips that use the default FW node (i.e. that
of their parent device), this will be NULL and cause the chip not to be
fully registered.
Instead, use the GPIO device's FW node, which is set to either the node
of the parent device or the explicit override in chip->fwnode.
Fixes: 8afe82550240 ("gpiolib: of: Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode")
Tested-by: Marek Szyprowski <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Tested-by: Robert Marko <[email protected]>
Tested-by: Andrew Halaney <[email protected]>
Reviewed-by: Brian Masney <[email protected]>
Tested-by: Brian Masney <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The callers never call the function with invalid pointer.
Moreover, compiler quite likely dropped that check anyway
because we use that pointer before the check.
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
GPIO library is getting rid of of_node, fwnode should be utilized instead.
Prepare of_mm_gpiochip_add_data() for fwnode.
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Now that static device properties understand notion of child nodes and
references, let's teach gpiolib to handle them:
- GPIOs are represented as a references to software nodes representing
gpiochip
- references must have 2 arguments - GPIO number within the chip and
GPIO flags (GPIO_ACTIVE_LOW/GPIO_ACTIVE_HIGH, etc)
- a new PROPERTY_ENTRY_GPIO() macro is supplied to ensure the above
- name of the software node representing gpiochip must match label of
the gpiochip, as we use it to locate gpiochip structure at runtime
The following illustrates use of software nodes to describe a "System"
button that is currently specified via use of gpio_keys_platform_data
in arch/mips/alchemy/board-mtx1.c. It follows bindings specified in
Documentation/devicetree/bindings/input/gpio-keys.yaml.
static const struct software_node mxt1_gpiochip2_node = {
.name = "alchemy-gpio2",
};
static const struct property_entry mtx1_gpio_button_props[] = {
PROPERTY_ENTRY_U32("linux,code", BTN_0),
PROPERTY_ENTRY_STRING("label", "System button"),
PROPERTY_ENTRY_GPIO("gpios", &mxt1_gpiochip2_node, 7, GPIO_ACTIVE_LOW),
{ }
};
Similarly, arch/arm/mach-tegra/board-paz00.c can be converted to:
static const struct software_node tegra_gpiochip_node = {
.name = "tegra-gpio",
};
static struct property_entry wifi_rfkill_prop[] __initdata = {
PROPERTY_ENTRY_STRING("name", "wifi_rfkill"),
PROPERTY_ENTRY_STRING("type", "wlan"),
PROPERTY_ENTRY_GPIO("reset-gpios",
&tegra_gpiochip_node, 25, GPIO_ACTIVE_HIGH);
PROPERTY_ENTRY_GPIO("shutdown-gpios",
&tegra_gpiochip_node, 85, GPIO_ACTIVE_HIGH);
{ },
};
static struct platform_device wifi_rfkill_device = {
.name = "rfkill_gpio",
.id = -1,
};
...
software_node_register(&tegra_gpiochip_node);
device_create_managed_software_node(&wifi_rfkill_device.dev,
wifi_rfkill_prop, NULL);
Acked-by: Linus Walleij <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Ensure that all paths to obtain/look up GPIOD from generic
consumer-visible APIs go through the new gpiod_find_and_request()
helper, so that we can easily extend it with support for new firmware
mechanisms.
The only exception is OF-specific [devm_]gpiod_get_from_of_node() API
that is still being used by a couple of drivers and will be removed as
soon as patches converting them to use generic fwnode/device APIs are
accepted.
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
There is no need for the generic parts of GPIOLIB to be aware of
implementation details of ACPI-bases lookups.
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
In preparation of switching all ACPI-based GPIO lookups to go through
acpi_find_gpio() we need to make sure it can handle data-only ACPI
nodes, same as existing acpi_node_get_gpiod().
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
In preparation of switching all ACPI-based GPIO lookups to go through
acpi_find_gpio() let's change it to accept device node as its argument
as we do not always have access to device structure.
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
In preparation of switching all OF-based GPIO lookups to go through
of_find_gpio() let's change it to accept device node as its argument as
we do not always have access to device structure.
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Introduces new helper function to aid in .probe_new() refactors. In order
to use existing i2c_get_device_id() on the probe callback, the device
match table needs to be accessible in that function, which would require
bigger refactors in some drivers using the deprecated .probe callback.
This issue was discussed in more detail in the IIO mailing list.
Link: https://lore.kernel.org/all/[email protected]/
Suggested-by: Nuno Sá <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Suggested-by: Jonathan Cameron <[email protected]>
Signed-off-by: Angel Iglesias <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
|
|
Added module build support for the davinci gpio driver
Signed-off-by: Guillaume La Roque <[email protected]>
Signed-off-by: Nicolas Frayer <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
gpiochip_init_valid_mask()
In preparation to complete fwnode switch, integrate
of_gpiochip_init_valid_mask() into gpiochip_init_valid_mask().
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
GPIO library is getting rid of of_node, fwnode should be utilized instead.
Prepare of_gpiochip_add() / of_gpiochip_remove() for fwnode.
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Now that there are no more users of these APIs in the kernel we can
remove them.
Signed-off-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
devm_fwnode_get_gpiod_from_child() is going away as the name is too
unwieldy, let's switch to using the new devm_fwnode_gpiod_get().
Signed-off-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
devm_fwnode_get_gpiod_from_child() is going away as the name is too
unwieldy, let's switch to using the new devm_fwnode_gpiod_get().
Signed-off-by: Dmitry Torokhov <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Add support for HiSilicon GPIO controller in embedded platform, which
boot from devicetree.
Signed-off-by: Weilong Chen <[email protected]>
Acked-by: Jay Fang <[email protected]>
Reviewed-by: Yicong Yang <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Add the new compatible for HiSilicon gpio controller driver.
Signed-off-by: Weilong Chen <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Yicong Yang <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
It's actually preferable to use Generic regmap GPIO over other
simple approaches. Add a TODO item for that.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Bindings for Freescale PCIe controller use a separate property called
"reset-gpio-active-high" to control polarity of its reset line, add it
to the list of quirks in gpiolib so that gpiod API can be used in the
driver.
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Several legacy bindings use a separate property to specify polarity of
GPIOs instead of specifying it directly in the GPIO property. Factor
out this code to make it easier to add more such cases.
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Make use of device_match_of_node() instead of open coding its
functionality.
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Dialog semiconductors SLG7XL45106 is an 8-bit I2C GPO expander.
The output port is controlled by a data byte with register
address. Add a compatible string for the same. Also update
the driver to write and read from it.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Add struct pca9570_platform_data for adding the platform data
structure. Also modify the existing structs for pca9570 and pca9571
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
This patch adds compatible string for the SLG7XL45106,
I2C GPO expander.
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
It's possible that PCI device can provide an IO port resource for
the device. regmap MMIO currently uses MMIO by default. With an
additional flag we enable support for IO port accesses.
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: William Breathitt Gray <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
This driver implements a GPIO multiplexer based on latches connected to
other GPIOs. A set of data GPIOs is connected to the data input of
multiple latches. The clock input of each latch is driven by another
set of GPIOs. With two 8-bit latches 10 GPIOs can be multiplexed into
16 GPIOs. GPOs might be a better term as in fact the multiplexed pins
are output only.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Serge Semin <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
[Bartosz: fixed the strange of_device_id formatting]
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
This adds a binding for a GPIO multiplexer driver based on latches
connected to other GPIOs.
Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Reviewed-by: Serge Semin <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
When eflags has been renamed to the edflags, the kernel doc change were
missed. Update kernel doc accordingly.
Fixes: b1a92e94560d ("gpiolib: cdev: consolidate edge detector configuration flags")
Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Kent Gibson <[email protected]>
|
|
Using the METHOD_NAME__AEI macro instead of using "_AEI" directly.
Signed-off-by: Xiang Yang <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
|
|
The ACCES PCI-IDIO-16 device is part of the ACCES IDIO-16 family, so the
idio-16 GPIO library module is selected and utilized to consolidate
code.
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The ACCES 104-IDIO-16 device is part of the ACCES IDIO-16 family, so the
idio-16 GPIO library module is selected and utilized to consolidate
code.
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Exposes consumer library functions to facilitate communication with
devices within the ACCES IDIO-16 family such as the 104-IDIO-16 and
the PCI-IDIO-16.
A CONFIG_GPIO_IDIO_16 Kconfig option is introduced by this patch.
Modules wanting access to these idio-16 library functions should select
this Kconfig option and import the GPIO_IDIO_16 symbol namespace.
Cc: Andy Shevchenko <[email protected]>
Signed-off-by: William Breathitt Gray <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Currently, we use just the fixed string "FTGPIO010" as the gpiochip name
for ftgpio010 drivers. Because it's fixed, this means we cannot
distinguish multiple ftgpio010 devices present on a single system.
This change uses the dev_name() instead, which should be unique between
multiple instances.
Signed-off-by: Jeremy Kerr <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Existing DTS that use legacy (non-standard) property name for the reset
line "gpios-reset" also specify incorrect polarity (0 which maps to
"active high"). Add a quirk to force polarity to "active low" so that
once driver is converted to gpiod API that pays attention to line
polarity it will work properly.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
Bindings for Freescale Fast Ethernet Controller use a separate
property "phy-reset-active-high" to specify polarity of its phy
gpio line. To allow converting the driver to gpiod API we need
to add this quirk to gpiolib.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
There are several instances where we use a separate property to
override polarity specified in gpio property. Factor it out into
a separate function.
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The driver is using non-standard "gpio-rtc-data", "gpio-rtc-sclk", and
"gpio-rtc-reset" names for properties describing its gpios. In
preparation to converting to the standard naming ("rtc-*-gpios") and
switching the driver to gpiod API add a quirk to gpiolib to keep
compatibility with existing DTSes.
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The controller is using non-standard "cirrus,gpio-nreset" name for its
reset gpio property, whereas gpiod API expects "<name>-gpios".
Add a quirk so that gpiod API will still work on unmodified DTSes.
Reviewed-by: Daniel Thompson <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|
|
The controller is using non-standard "reset-n-io" name for its reset
gpio property, whereas gpiod API expects "<name>-gpios". Add a quirk
so that gpiod API will still work on unmodified DTSes.
Reviewed-by: Daniel Thompson <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
|