M7350v3_en_gpl

This commit is contained in:
T
2024-09-09 08:55:19 +00:00
parent 801e6d2ad8
commit 2d95e8761a
2791 changed files with 89608 additions and 390711 deletions

View File

@ -25,7 +25,6 @@
#include <mach/msm_smsm.h>
#include <mach/socinfo.h>
#include <mach/ipa.h>
#include <mach/msm_iomap.h>
#include "ipa_i.h"
#define A2_NUM_PIPES 6
@ -115,38 +114,6 @@ static struct a2_mux_context_type *a2_mux_ctx;
static void handle_a2_mux_cmd(struct sk_buff *rx_skb);
/* [chenchao start] Do not excute BUG() in recovery */
static bool is_recovery_mode(void)
{
unsigned int value = 0;
static bool is_recovery = 0;
static bool checked = 0;
void* restart_reason = 0;
if (checked == 1)
{
return is_recovery;
}
checked = 1;
restart_reason = MSM_IMEM_BASE + 0x65C;
value = __raw_readl(restart_reason);
/* [chenchao] Fix always go into recovery */
__raw_writel(0, restart_reason);
pr_info("CCCC restart_reason %x\r\n", value);
is_recovery = (value == 0x77665502);
return is_recovery;
}
static void bug_not_recovery(void)
{
if (!is_recovery_mode())
{
BUG();
}
}
/* [chenchao end] */
static bool bam_ch_is_open(int index)
{
return a2_mux_ctx->bam_ch[index].status ==
@ -340,7 +307,7 @@ static void ul_wakeup(void)
return;
bail:
mutex_unlock(&a2_mux_ctx->wakeup_lock);
bug_not_recovery();
BUG();
return;
}
@ -374,7 +341,7 @@ static void a2_mux_write_done(bool is_tethered, struct sk_buff *skb)
}
spin_unlock_irqrestore(&a2_mux_ctx->bam_tx_pool_spinlock,
flags);
bug_not_recovery();
BUG();
}
list_del(&info->list_node);
spin_unlock_irqrestore(&a2_mux_ctx->bam_tx_pool_spinlock, flags);
@ -486,7 +453,7 @@ static void kickoff_ul_wakeup_func(struct work_struct *work)
if (unlikely(ret == 0)) {
IPAERR("%s timeout waiting for A2 PROD granted\n",
__func__);
bug_not_recovery();
BUG();
return;
}
}
@ -512,7 +479,7 @@ static void kickoff_ul_request_resource_func(struct work_struct *work)
if (unlikely(ret == 0)) {
IPAERR("%s timeout waiting for A2 PROD granted\n",
__func__);
bug_not_recovery();
BUG();
return;
}
}
@ -1683,9 +1650,6 @@ int a2_mux_init(void)
*/
a2_mux_ctx->bam_ch[A2_MUX_TETHERED_0].status |= BAM_CH_REMOTE_OPEN;
/* [chenchao] init restart reason */
is_recovery_mode();
rc = 0;
goto bail;

View File

@ -23,7 +23,6 @@
#include <linux/input.h>
#include <linux/log2.h>
#include <linux/qpnp/power-on.h>
#include <linux/wakelock.h>
/* Common PNP defines */
#define QPNP_PON_REVISION2(base) (base + 0x01)
@ -110,7 +109,6 @@ struct qpnp_pon {
};
static struct qpnp_pon *sys_reset_dev;
struct wake_lock powerkey_wlock;
static u32 s1_delay[PON_S1_COUNT_MAX + 1] = {
0 , 32, 56, 80, 138, 184, 272, 408, 608, 904, 1352, 2048,
@ -334,7 +332,6 @@ qpnp_pon_input_dispatch(struct qpnp_pon *pon, u32 pon_type)
input_report_key(pon->pon_input, cfg->key_code,
(pon_rt_sts & pon_rt_bit));
input_sync(pon->pon_input);
wake_lock_timeout(&powerkey_wlock, 5 * HZ);
return 0;
}
@ -642,20 +639,6 @@ qpnp_pon_request_irqs(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
return rc;
}
/* [chenchao start] Fix send up event when resume from sleep */
static int no_suppend_resume(struct device *dev)
{
return 0;
}
struct dev_pm_domain input_device_pm_domain = {
.ops = {
.suspend = no_suppend_resume,
.resume = no_suppend_resume,
}
};
/* [chenchao end] */
static int __devinit
qpnp_pon_config_input(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
{
@ -668,8 +651,6 @@ qpnp_pon_config_input(struct qpnp_pon *pon, struct qpnp_pon_config *cfg)
}
pon->pon_input->name = "qpnp_pon";
pon->pon_input->phys = "qpnp_pon/input0";
/* [chenchao] Fix send up event when resume from sleep */
pon->pon_input->dev.pm_domain = &input_device_pm_domain;
}
input_set_capability(pon->pon_input, EV_KEY, cfg->key_code);
@ -1018,14 +999,12 @@ static struct spmi_driver qpnp_pon_driver = {
static int __init qpnp_pon_init(void)
{
wake_lock_init(&powerkey_wlock, WAKE_LOCK_SUSPEND, "powerkey");
return spmi_driver_register(&qpnp_pon_driver);
}
module_init(qpnp_pon_init);
static void __exit qpnp_pon_exit(void)
{
wake_lock_destroy(&powerkey_wlock);
return spmi_driver_unregister(&qpnp_pon_driver);
}
module_exit(qpnp_pon_exit);

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2013, 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
@ -144,7 +144,6 @@ struct usb_bam_ipa_handshake_info {
bool in_lpm;
bool pending_lpm;
u8 prod_pipes_enabled_per_bam;
bool pending_bam_reset;
int (*wake_cb)(void *);
void *wake_param;
@ -1540,65 +1539,9 @@ void msm_bam_hsic_notify_on_resume(void)
spin_unlock(&usb_bam_lock);
}
/**
* msm_bam_hsic_host_pipe_empty - Check all HSIC host BAM pipe state
*
* return true if all BAM pipe used for HSIC Host mode is empty.
*/
bool msm_bam_hsic_host_pipe_empty(void)
{
struct usb_bam_pipe_connect *pipe_connect;
struct sps_pipe *pipe = NULL;
enum usb_bam bam = HSIC_BAM;
int i, ret;
u32 status;
pr_debug("%s: enter\n", __func__);
for (i = 0; i < ctx.max_connections; i++) {
pipe_connect = &usb_bam_connections[i];
if (pipe_connect->bam_type == bam &&
pipe_connect->enabled) {
pipe = ctx.usb_bam_sps.sps_pipes[i];
ret = sps_is_pipe_empty(pipe, &status);
if (ret) {
pr_err("%s(): sps_is_pipe_empty() failed\n",
__func__);
pr_err("%s(): SRC index(%d), DEST index(%d):\n",
__func__,
pipe_connect->src_pipe_index,
pipe_connect->dst_pipe_index);
WARN_ON(1);
}
if (!status) {
pr_err("%s(): pipe is not empty.\n", __func__);
pr_err("%s(): SRC index(%d), DEST index(%d):\n",
__func__,
pipe_connect->src_pipe_index,
pipe_connect->dst_pipe_index);
return false;
} else {
pr_debug("%s(): SRC index(%d), DEST index(%d):\n",
__func__,
pipe_connect->src_pipe_index,
pipe_connect->dst_pipe_index);
}
}
}
if (!pipe)
pr_err("%s: Bam %s has no connected pipes\n", __func__,
bam_enable_strings[bam]);
return true;
}
EXPORT_SYMBOL(msm_bam_hsic_host_pipe_empty);
bool msm_bam_hsic_lpm_ok(void)
{
int i, ret;
int i;
struct usb_bam_pipe_connect *pipe_iter;
if (hsic_host_info.dev) {
@ -1621,17 +1564,6 @@ bool msm_bam_hsic_lpm_ok(void)
IPA_RM_RESOURCE_RELEASED &&
ctx.is_bam_inactivity[HSIC_BAM] && info[HSIC_BAM].in_lpm) {
pr_err("%s(): checking HSIC Host pipe state\n",
__func__);
ret = msm_bam_hsic_host_pipe_empty();
if (!ret) {
pr_err("%s(): HSIC HOST Pipe is not empty.\n",
__func__);
spin_unlock(&usb_bam_lock);
return false;
}
/* HSIC host will go now to lpm */
pr_debug("%s: vote for suspend hsic %x\n",
__func__, (int)hsic_host_info.dev);
@ -1743,18 +1675,13 @@ int usb_bam_connect_ipa(struct usb_bam_connect_ipa_params *ipa_params)
(ctx.pipes_enabled_per_bam[cur_bam] == 0)) {
spin_unlock(&usb_bam_lock);
if (cur_bam == HSUSB_BAM) {
if (cur_bam == HSUSB_BAM)
msm_hw_bam_disable(1);
if (sps_device_reset(ctx.h_bam[cur_bam]))
pr_err("%s: BAM reset failed\n", __func__);
sps_device_reset(ctx.h_bam[cur_bam]);
if (cur_bam == HSUSB_BAM)
msm_hw_bam_disable(0);
} else if (info[HSIC_BAM].pending_bam_reset &&
cur_bam == HSIC_BAM) {
if (sps_device_reset(ctx.h_bam[cur_bam]))
pr_err("%s: BAM reset failed\n", __func__);
}
/* On re-connect assume out from lpm for HSIC BAM */
if (cur_bam == HSIC_BAM && hsic_host_info.dev &&
@ -3009,28 +2936,6 @@ void msm_bam_notify_lpm_resume()
}
EXPORT_SYMBOL(msm_bam_notify_lpm_resume);
void msm_bam_hsic_reset(void)
{
struct msm_usb_bam_platform_data *pdata;
if (!ctx.usb_bam_pdev) {
pr_debug("%s: setting pending_bam_reset\n", __func__);
info[HSIC_BAM].pending_bam_reset = 1;
return;
}
pdata = ctx.usb_bam_pdev->dev.platform_data;
WARN_ON(ctx.pipes_enabled_per_bam[HSIC_BAM] != 0);
if (pdata->reset_on_connect[HSIC_BAM] == true) {
pr_debug("%s: reset the HSIC BAM", __func__);
if (sps_device_reset(ctx.h_bam[HSIC_BAM]))
pr_err("%s: HSIC BAM reset failed\n", __func__);
}
}
EXPORT_SYMBOL(msm_bam_hsic_reset);
static int usb_bam_remove(struct platform_device *pdev)
{
destroy_workqueue(ctx.usb_bam_wq);