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

Commit a3e5d7b5 authored by Abinaya P's avatar Abinaya P
Browse files

drivers: net: can: increase the delay value for controller boot-up



In certain targets, K61 controller takes around 1.25 msecs to come up.
Increase the delay value in the probe to successfully register for
CAN controller.

CRs-Fixed: 2074505
Change-Id: I6d89988b556cbf3ff7d2b950eee871c2c731153c
Signed-off-by: default avatarAbinaya P <abinayap@codeaurora.org>
parent 35eaac3d
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#define XFER_BUFFER_SIZE		64
#define K61_CLOCK			120000000
#define K61_MAX_CHANNELS		1
#define K61_FW_QUERY_RETRY_COUNT	3

struct k61_can {
	struct net_device	*netdev;
@@ -366,7 +367,7 @@ static int k61_query_firmware_version(struct k61_can *priv_data)

	if (ret == 0) {
		wait_for_completion_interruptible_timeout(
				&priv_data->response_completion, 0.1 * HZ);
				&priv_data->response_completion, 0.001 * HZ);
		ret = priv_data->cmd_result;
	}

@@ -806,7 +807,7 @@ cleanup_privdata:

static int k61_probe(struct spi_device *spi)
{
	int err;
	int err, retry = 0, query_err = -1;
	struct k61_can *priv_data;
	struct device *dev;

@@ -842,10 +843,10 @@ static int k61_probe(struct spi_device *spi)
	gpio_direction_output(priv_data->reset, 0);
	udelay(1);
	gpio_direction_output(priv_data->reset, 1);
	/* Provide a delay of 10us for the chip to reset. This is part of
	/* Provide a delay of 300us for the chip to reset. This is part of
	 * the reset sequence.
	 */
	usleep_range(10, 11);
	usleep_range(300, 301);

	err = k61_create_netdev(spi, priv_data);
	if (err) {
@@ -868,9 +869,12 @@ static int k61_probe(struct spi_device *spi)
	}
	dev_dbg(dev, "Request irq %d ret %d\n", spi->irq, err);

	err = k61_query_firmware_version(priv_data);
	while ((query_err != 0) && (retry < K61_FW_QUERY_RETRY_COUNT)) {
		query_err = k61_query_firmware_version(priv_data);
		retry++;
	}

	if (err) {
	if (query_err) {
		dev_info(dev, "K61 probe failed\n");
		err = -ENODEV;
		goto free_irq;