clk: at91: fix update bit maps on CFG_MOR write
PATCH 1/6 clk: at91: fix update bit maps on CFG_MOR write
From: Eugen Hristev <[email protected]>
[ Upstream commit 263eaf8f172d9f44e15d6aca85fe40ec18d2c477 ]
The regmap update bits call was not selecting the proper mask, considering the bits which was updating.
Update the mask from call to also include OSCBYPASS.
Removed MOSCEN which was not updated.
--- drivers/clk/at91/clk-main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/at91/clk-main.c +1 -1
@@ -162,7 +162,7 @@ at91_clk_register_main_osc(struct regmap *regmap,if (bypass)regmap_update_bits (regmap,AT91_CKGR_MOR ,MOR_KEY_MASK | -AT91_PMC_MOSCEN , +AT91_PMC_OSCBYPASS ,AT91_PMC_OSCBYPASS |AT91_PMC_KEY ); hw = &osc->hw;
Signature · 1 line
2.24.0
PATCH 2/6 arm: add missing include platform-data/atmel.h
From: Philippe Mazenauer <[email protected]>
[ Upstream commit 95701b1c3c8fe36368361394e3950094eece4723 ]
Include corresponding headerfile <linux/platform-data/atmel.h> for function at91_suspend_entering_slow_clock().
../arch/arm/mach-at91/pm.c:279:5: warning: no previous prototype for ‘at91_suspend_entering_slow_clock’ [-Wmissing-prototypes]
int at91_suspend_entering_slow_clock(void)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- arch/arm/mach-at91/pm.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-at91/pm.c +1 -0
@@ -25,6 +25,7 @@#include <linux/platform_data/atmel.h> #include <linux/io.h> #include <linux/clk/at91_pmc.h> +#include <linux/platform_data/atmel.h> #include <asm/irq.h> #include <linux/atomic.h>
Signature · 1 line
2.24.0
PATCH 3/6 media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE
In reply to Lee JonesFrom: Eugen Hristev <[email protected]>
[ Upstream commit a0816e5088baab82aa738d61a55513114a673c8e ]
Control DO_WHITE_BALANCE is a button, with read only and execute-on-write flags. Adding this control in the proper list in the fill function.
After adding it here, we can see output of v4l2-ctl -L do_white_balance 0x0098090d (button) : flags=write-only, execute-on-write
--- drivers/media/v4l2-core/v4l2-ctrls.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/v4l2-core/v4l2-ctrls.c +1 -0
@@ -1007,6 +1007,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,case V4L2_CID_FLASH_STROBE_STOP :case V4L2_CID_AUTO_FOCUS_START :case V4L2_CID_AUTO_FOCUS_STOP : +case V4L2_CID_DO_WHITE_BALANCE : *type =V4L2_CTRL_TYPE_BUTTON ; *flags |=V4L2_CTRL_FLAG_WRITE_ONLY |V4L2_CTRL_FLAG_EXECUTE_ON_WRITE ;
Signature · 1 line
2.24.0
PATCH 4/6 net: macb: fix error format in dev_err()
In reply to Lee JonesFrom: Luca Ceresoli <[email protected]>
[ Upstream commit f413cbb332a0b5251a790f396d0eb4ebcade5dec ]
Errors are negative numbers. Using %u shows them as very large positive numbers such as 4294967277 that don't make sense. Use the %d format instead, and get a much nicer -19.
--- drivers/net/ethernet/cadence/macb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/cadence/macb.c +7 -7
@@ -2364,14 +2364,14 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, *pclk =devm_clk_get (&pdev->dev,"pclk" );if (IS_ERR (*pclk)) { err =PTR_ERR (*pclk); -dev_err (&pdev->dev,"failed to get macb_clk (%u)\n" , err); +dev_err (&pdev->dev,"failed to get macb_clk (%d)\n" , err);return err; } *hclk =devm_clk_get (&pdev->dev,"hclk" );if (IS_ERR (*hclk)) { err =PTR_ERR (*hclk); -dev_err (&pdev->dev,"failed to get hclk (%u)\n" , err); +dev_err (&pdev->dev,"failed to get hclk (%d)\n" , err);return err; }
@@ -2385,25 +2385,25 @@ static int macb_clk_init(struct platform_device *pdev, struct clk **pclk, err =clk_prepare_enable (*pclk);if (err) { -dev_err (&pdev->dev,"failed to enable pclk (%u)\n" , err); +dev_err (&pdev->dev,"failed to enable pclk (%d)\n" , err);return err; } err =clk_prepare_enable (*hclk);if (err) { -dev_err (&pdev->dev,"failed to enable hclk (%u)\n" , err); +dev_err (&pdev->dev,"failed to enable hclk (%d)\n" , err); goto err_disable_pclk; } err =clk_prepare_enable (*tx_clk);if (err) { -dev_err (&pdev->dev,"failed to enable tx_clk (%u)\n" , err); +dev_err (&pdev->dev,"failed to enable tx_clk (%d)\n" , err); goto err_disable_hclk; } err =clk_prepare_enable (*rx_clk);if (err) { -dev_err (&pdev->dev,"failed to enable rx_clk (%u)\n" , err); +dev_err (&pdev->dev,"failed to enable rx_clk (%d)\n" , err); goto err_disable_txclk; }
@@ -2823,7 +2823,7 @@ static int at91ether_clk_init(struct platform_device *pdev, struct clk **pclk, err =clk_prepare_enable (*pclk);if (err) { -dev_err (&pdev->dev,"failed to enable pclk (%u)\n" , err); +dev_err (&pdev->dev,"failed to enable pclk (%d)\n" , err);return err; }
Signature · 1 line
2.24.0
PATCH 5/6 media: atmel: atmel-isc: fix asd memory allocation
In reply to Lee JonesFrom: Eugen Hristev <[email protected]>
[ Upstream commit 1e4e25c4959c10728fbfcc6a286f9503d32dfe02 ]
The subsystem will free the asd memory on notifier cleanup, if the asd is added to the notifier.
However the memory is freed using kfree.
Thus, we cannot allocate the asd using devm_*
This can lead to crashes and problems.
To test this issue, just return an error at probe, but cleanup the notifier beforehand.
--- drivers/media/platform/atmel/atmel-isc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/media/platform/atmel/atmel-isc.c +6 -2
@@ -1297,8 +1297,11 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc)break ; } - subdev_entity->asd =devm_kzalloc (dev, -sizeof (*subdev_entity->asd),GFP_KERNEL ); +/* asd will be freed by the subsystem once it's added to the +* notifier list +*/ + subdev_entity->asd =kzalloc (sizeof (*subdev_entity->asd), +GFP_KERNEL );if (subdev_entity->asd ==NULL ) {of_node_put (rem); ret = -ENOMEM ;
@@ -1432,6 +1435,7 @@ static int atmel_isc_probe(struct platform_device *pdev) &subdev_entity->notifier);if (ret) {dev_err (dev,"fail to register async notifier\n" ); +kfree (subdev_entity->asd); goto cleanup_subdev; }
Signature · 1 line
2.24.0
PATCH 6/6 pwm: Clear chip_data in pwm_put()
In reply to Lee JonesFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit e926b12c611c2095c7976e2ed31753ad6eb5ff1a ]
After a PWM is disposed by its user the per chip data becomes invalid. Clear the data in common code instead of the device drivers to get consistent behaviour. Before this patch only three of nine drivers cleaned up here.
--- drivers/pwm/core.c | 1 + drivers/pwm/pwm-berlin.c | 1 - drivers/pwm/pwm-samsung.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-)
drivers/pwm/core.c +1 -0
@@ -858,6 +858,7 @@ void pwm_put(struct pwm_device *pwm)if (pwm->chip->ops->free) pwm->chip->ops->free (pwm->chip, pwm); +pwm_set_chip_data (pwm,NULL ); pwm->label =NULL ;module_put (pwm->chip->ops->owner);
drivers/pwm/pwm-berlin.c +0 -1
@@ -78,7 +78,6 @@ static void berlin_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) {struct berlin_pwm_channel *channel =pwm_get_chip_data (pwm); -pwm_set_chip_data (pwm,NULL );kfree (channel); }
drivers/pwm/pwm-samsung.c +0 -1
@@ -235,7 +235,6 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm)static void pwm_samsung_free (struct pwm_chip *chip,struct pwm_device *pwm) {devm_kfree (chip->dev,pwm_get_chip_data (pwm)); -pwm_set_chip_data (pwm,NULL ); }static int pwm_samsung_enable (struct pwm_chip *chip,struct pwm_device *pwm)
Signature · 1 line
2.24.0