From d0847ecc9f969e6ac089e505d5c1ddedddedfcd4 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 1 May 2020 22:04:50 +0530 Subject: spi: Zap lpc32xx_ssp driver-related code lpc32xx_ssp driver is deprecated, no active updates and no board user, hence dropped the same. Cc: Vladimir Zapolskiy Cc: Albert ARIBAUD Cc: Tom Rini Signed-off-by: Jagan Teki --- include/configs/devkit3250.h | 5 ----- include/configs/work_92105.h | 5 ----- 2 files changed, 10 deletions(-) (limited to 'include') diff --git a/include/configs/devkit3250.h b/include/configs/devkit3250.h index f1f2be0797..4471a12f34 100644 --- a/include/configs/devkit3250.h +++ b/include/configs/devkit3250.h @@ -54,11 +54,6 @@ */ #define CONFIG_LPC32XX_GPIO -/* - * SSP/SPI - */ -#define CONFIG_LPC32XX_SSP_TIMEOUT 100000 - /* * Ethernet */ diff --git a/include/configs/work_92105.h b/include/configs/work_92105.h index 421384d9ba..93c8d64b14 100644 --- a/include/configs/work_92105.h +++ b/include/configs/work_92105.h @@ -104,11 +104,6 @@ #define CONFIG_LPC32XX_GPIO -/* - * SSP/SPI/DISPLAY - */ - -#define CONFIG_LPC32XX_SSP_TIMEOUT 100000 /* * Environment */ -- cgit From cd3e01b14f34bcfb69927dc246c1de792c784468 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 1 May 2020 23:44:17 +0530 Subject: phy: Fix node description of phy_get_by_node node is most of device related API's are termed as device node and without device related API's are termed as ofnode. generic_phy_get_by_node API is without device API, so fixed the node description as ofnode. Cc: Neil Armstrong Cc: Tom Rini Signed-off-by: Jagan Teki --- include/generic-phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/generic-phy.h b/include/generic-phy.h index 55629ae0b4..6d7cf5303b 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -215,7 +215,7 @@ int generic_phy_get_by_index(struct udevice *user, int index, /** * generic_phy_get_by_node() - Get a PHY device by integer index on ofnode * - * @node: the device node + * @node: The client ofnode. * @index: The index in the list of available PHYs * @phy: A pointer to the PHY port * -- cgit From 5a2b6778fac98f2cb9ee1e7e6b98cd88d18dcbb9 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 1 May 2020 23:44:18 +0530 Subject: phy: Use _nodev naming convention if non-device clients Clients that are requesting some of uclass API's without a device (with ofnode) usually have _nodev naming convention. - clk_get_by_index_nodev - clk_get_by_name_nodev - reset_get_by_index_nodev - gpio_request_by_name_nodev So, update the same naming convention PHY framework. This doesn't change the existing functionality. Cc: Neil Armstrong Cc: Tom Rini Signed-off-by: Jagan Teki --- include/generic-phy.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/generic-phy.h b/include/generic-phy.h index 6d7cf5303b..5ab34cda03 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -213,12 +213,15 @@ int generic_phy_get_by_index(struct udevice *user, int index, struct phy *phy); /** - * generic_phy_get_by_node() - Get a PHY device by integer index on ofnode + * generic_phy_get_by_index_nodev() - Get a PHY device by integer index + * without a device * * @node: The client ofnode. * @index: The index in the list of available PHYs * @phy: A pointer to the PHY port * + * This is a version of generic_phy_get_by_index() that does not use a device. + * * This looks up a PHY device for a client device based on its ofnode and on * its position in the list of the possible PHYs. * @@ -237,7 +240,7 @@ int generic_phy_get_by_index(struct udevice *user, int index, * * @return 0 if OK, or a negative error code */ -int generic_phy_get_by_node(ofnode node, int index, struct phy *phy); +int generic_phy_get_by_index_nodev(ofnode node, int index, struct phy *phy); /** * generic_phy_get_by_name() - Get a PHY device by its name. -- cgit From d7c56616dcc8cac6f5de8e605fd00486a59fef50 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Fri, 1 May 2020 23:45:08 +0530 Subject: clk: Fix clk func names in comments clk function names in comments should be prefix with clk instead of clock. Fix it. Cc: Simon Glass Cc: Tom Rini Signed-off-by: Jagan Teki Reviewed-by: Simon Glass --- include/clk.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/clk.h b/include/clk.h index 60c4b7d075..c6a2713f62 100644 --- a/include/clk.h +++ b/include/clk.h @@ -93,7 +93,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int index, struct phandle_1_arg *cells, struct clk *clk); /** - * clock_get_by_index - Get/request a clock by integer index. + * clk_get_by_index - Get/request a clock by integer index. * * This looks up and requests a clock. The index is relative to the client * device; each device is assumed to have n clocks associated with it somehow, @@ -110,7 +110,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int index, int clk_get_by_index(struct udevice *dev, int index, struct clk *clk); /** - * clock_get_by_index_nodev - Get/request a clock by integer index + * clk_get_by_index_nodev - Get/request a clock by integer index * without a device. * * This is a version of clk_get_by_index() that does not use a device. @@ -124,7 +124,7 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk); int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk); /** - * clock_get_bulk - Get/request all clocks of a device. + * clk_get_bulk - Get/request all clocks of a device. * * This looks up and requests all clocks of the client device; each device is * assumed to have n clocks associated with it somehow, and this function finds @@ -139,7 +139,7 @@ int clk_get_by_index_nodev(ofnode node, int index, struct clk *clk); int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk); /** - * clock_get_by_name - Get/request a clock by name. + * clk_get_by_name - Get/request a clock by name. * * This looks up and requests a clock. The name is relative to the client * device; each device is assumed to have n clocks associated with it somehow, @@ -169,7 +169,7 @@ int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk); int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk); /** - * clock_get_optional_nodev - Get/request an optinonal clock by name + * clk_get_optional_nodev - Get/request an optinonal clock by name * without a device. * @node: The client ofnode. * @name: The name of the clock to request. @@ -331,7 +331,7 @@ static inline int clk_release_bulk(struct clk_bulk *bulk) int clk_request(struct udevice *dev, struct clk *clk); /** - * clock_free - Free a previously requested clock. + * clk_free - Free a previously requested clock. * * @clock: A clock struct that was previously successfully requested by * clk_request/get_by_*(). -- cgit From 54232474d6fe9214942b79fa2608c3ad1d9f07d0 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Sat, 2 May 2020 12:45:01 +0530 Subject: iopoll: Add read_poll_timeout common API Add read_poll_timeout common API similar to Linux iopoll. readx_poll_timeout will trigger read_poll_timeout with proper op. This will help to extend the functionalities like sleep_us to poll timeout in future. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki --- include/linux/iopoll.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index ab0ae1969a..51966d83da 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -11,7 +11,7 @@ #include /** - * readx_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs + * read_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs * @op: accessor function (takes @addr as its only argument) * @addr: Address to poll * @val: Variable to read the value into @@ -24,7 +24,7 @@ * When available, you'll probably want to use one of the specialized * macros defined below rather than this macro directly. */ -#define readx_poll_timeout(op, addr, val, cond, timeout_us) \ +#define read_poll_timeout(op, addr, val, cond, timeout_us) \ ({ \ unsigned long timeout = timer_get_us() + timeout_us; \ for (;;) { \ @@ -39,6 +39,8 @@ (cond) ? 0 : -ETIMEDOUT; \ }) +#define readx_poll_timeout(op, addr, val, cond, timeout_us) \ + read_poll_timeout(op, addr, val, cond, timeout_us) #define readb_poll_timeout(addr, val, cond, timeout_us) \ readx_poll_timeout(readb, addr, val, cond, timeout_us) -- cgit From c094e219a8614b3da275ad696cdfefbb9f2c453d Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Sat, 2 May 2020 12:45:02 +0530 Subject: iopoll: Add dealy to read poll Some drivers and other bsp code not only poll the register with timeout but also required to delay on each transaction. This patch add that requirement by adding sleep_us variable so-that read_poll_timeout now support delay as well. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki --- include/linux/iopoll.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 51966d83da..76d2f951c1 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -6,6 +6,7 @@ #ifndef _LINUX_IOPOLL_H #define _LINUX_IOPOLL_H +#include #include #include #include @@ -16,6 +17,7 @@ * @addr: Address to poll * @val: Variable to read the value into * @cond: Break condition (usually involving @val) + * @sleep_us: Maximum time to sleep in us * @timeout_us: Timeout in us, 0 means never timeout * * Returns 0 on success and -ETIMEDOUT upon a timeout. In either @@ -24,7 +26,7 @@ * When available, you'll probably want to use one of the specialized * macros defined below rather than this macro directly. */ -#define read_poll_timeout(op, addr, val, cond, timeout_us) \ +#define read_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ ({ \ unsigned long timeout = timer_get_us() + timeout_us; \ for (;;) { \ @@ -35,12 +37,14 @@ (val) = op(addr); \ break; \ } \ + if (sleep_us) \ + udelay(sleep_us); \ } \ (cond) ? 0 : -ETIMEDOUT; \ }) #define readx_poll_timeout(op, addr, val, cond, timeout_us) \ - read_poll_timeout(op, addr, val, cond, timeout_us) + read_poll_timeout(op, addr, val, cond, false, timeout_us) #define readb_poll_timeout(addr, val, cond, timeout_us) \ readx_poll_timeout(readb, addr, val, cond, timeout_us) -- cgit From ce786ae3913f3a006ec959cc9538d6c4d4114345 Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Sat, 2 May 2020 12:45:03 +0530 Subject: iopoll: Add readl_poll_sleep_timeout Add readl poll API with sleep and timeout support. This change is referenced from Linux from below commit: commit <5f5323a14cad19323060a8cbf9d96f2280a462dd> ("iopoll: introduce read_poll_timeout macro") Signed-off-by: Jagan Teki --- include/linux/iopoll.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 76d2f951c1..30cdea0cdc 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -43,6 +43,12 @@ (cond) ? 0 : -ETIMEDOUT; \ }) +#define readx_poll_sleep_timeout(op, addr, val, cond, sleep_us, timeout_us) \ + read_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) + +#define readl_poll_sleep_timeout(addr, val, cond, sleep_us, timeout_us) \ + readx_poll_sleep_timeout(readl, addr, val, cond, sleep_us, timeout_us) + #define readx_poll_timeout(op, addr, val, cond, timeout_us) \ read_poll_timeout(op, addr, val, cond, false, timeout_us) -- cgit