Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bf664e9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wsa881x: Add delay after device reset"

parents 25d24cdc 495df114
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@
#include "wsa881x.h"
#include "wsa881x-temp-sensor.h"

#define WSA881X_NUM_RETRY	5

enum {
	G_18DB = 0,
	G_16P5DB,
@@ -1278,6 +1280,8 @@ static int wsa881x_swr_down(struct swr_device *pdev)
static int wsa881x_swr_reset(struct swr_device *pdev)
{
	struct wsa881x_priv *wsa881x;
	u8 retry = WSA881X_NUM_RETRY;
	u8 devnum = 0;

	wsa881x = swr_get_dev_data(pdev);
	if (!wsa881x) {
@@ -1286,6 +1290,10 @@ static int wsa881x_swr_reset(struct swr_device *pdev)
	}
	wsa881x->bg_cnt = 0;
	wsa881x->clk_cnt = 0;
	while (swr_get_logical_dev_num(pdev, pdev->addr, &devnum) && retry--) {
		/* Retry after 1 msec delay */
		usleep_range(1000, 1100);
	}
	regcache_mark_dirty(wsa881x->regmap);
	regcache_sync(wsa881x->regmap);
	return 0;