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

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

Merge "soc: qcom: bgspi: soft reset Blackghost on failure to resume"

parents 3b01799e 5723deb4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <soc/qcom/subsystem_notif.h>
#include "bgcom.h"
#include "linux/bgcom_interface.h"
#include "bgcom_interface.h"
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/gpio.h>
@@ -300,7 +301,7 @@ static int bgchar_write_cmd(struct bg_ui_data *fui_obj_msg, int type)
	return ret;
}

static int bg_soft_reset(void)
int bg_soft_reset(void)
{
	/*pull down reset gpio */
	gpio_direction_output(bgreset_gpio, 0);
@@ -308,6 +309,7 @@ static int bg_soft_reset(void)
	gpio_set_value(bgreset_gpio, 1);
	return 0;
}
EXPORT_SYMBOL(bg_soft_reset);

static long bg_com_ioctl(struct file *filp,
		unsigned int ui_bgcom_cmd, unsigned long arg)
+22 −0
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#ifndef BGCOM_INTERFACE_H
#define BGCOM_INTERFACE_H

/**
 * bg_soft_reset() - soft reset Blackghost
 * Return 0 on success or -Ve on error
*/
int bg_soft_reset(void);

#endif /* BGCOM_INTERFACE_H */
+8 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/kthread.h>
#include "bgcom.h"
#include "bgrsb.h"
#include "bgcom_interface.h"

#define BG_SPI_WORD_SIZE (0x04)
#define BG_SPI_READ_LEN (0x04)
@@ -781,8 +782,14 @@ int bgcom_resume(void *handle)

unlock:
	mutex_unlock(&bg_resume_mutex);
	if (retry == MAX_RETRY) {
		/* BG failed to resume. Trigger BG soft reset. */
		pr_err("BG failed to resume\n");
		bg_soft_reset();
		return -ETIMEDOUT;
	}
	pr_info("BG retries for wake up : %d\n", retry);
	return (retry == MAX_RETRY ? -ETIMEDOUT : 0);
	return 0;
}
EXPORT_SYMBOL(bgcom_resume);