Skip to content

Commit

Permalink
some FA19 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hroark13 committed Feb 24, 2012
1 parent fc68313 commit 5c386cc
Show file tree
Hide file tree
Showing 11 changed files with 1,327 additions and 1,122 deletions.
9 changes: 9 additions & 0 deletions arch/arm/mach-msm/sec_jack.c
Expand Up @@ -81,8 +81,10 @@
#include <linux/gpio.h>

#include <mach/hardware.h>
#include <linux/wakelock.h>

#define DET_CHECK_TIME_MS 200 // 200ms
#define WAKE_LOCK_TIME (HZ * 3) /* 3 sec */

/* PROJECT SPECIFICATION START
*/
Expand Down Expand Up @@ -208,6 +210,8 @@ struct h2w_info {

int pressed_btn;

struct wake_lock det_wake_lock;

unsigned int use_irq : 1;
};
static struct h2w_info *hi;
Expand Down Expand Up @@ -530,6 +534,8 @@ static irqreturn_t detect_irq_handler(int irq, void *dev_id)

// ESCAPE Detection issue fix

wake_lock_timeout(&hi->det_wake_lock, WAKE_LOCK_TIME);

set_irq_type(hi->irq_btn, IRQF_TRIGGER_RISING); // button detect high
while ( time_left_ms > 0)
{
Expand Down Expand Up @@ -799,6 +805,8 @@ static int h2w_probe(struct platform_device *pdev)
goto err_get_h2w_detect_irq_num_failed;
}

wake_lock_init(&hi->det_wake_lock, WAKE_LOCK_SUSPEND, "sec_jack_det");

hrtimer_init(&hi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hi->timer.function = detect_event_timer_func;
#ifndef FEATURE_MAX8899_PMIC_SENDEND
Expand Down Expand Up @@ -951,6 +959,7 @@ static int h2w_remove(struct platform_device *pdev)
#ifdef GPIO_POPUP_SW_EN
gpio_free(GPIO_POPUP_SW_EN);
#endif
wake_lock_destroy(&hi->det_wake_lock);
gpio_free(GPIO_EAR_LDO_EN);
gpio_free(GPIO_DETECT_HEADSET);
free_irq(hi->irq, 0);
Expand Down
5 changes: 3 additions & 2 deletions drivers/dpram/dpram.c
Expand Up @@ -113,7 +113,7 @@
#define READ_FROM_DPRAM(dest, src, size) \
_memcpy(dest, (void *)(SmemBase + src), size)

#define NUM_PDP_CONTEXT 8
#define NUM_PDP_CONTEXT 6

#ifdef _ENABLE_ERROR_DEVICE
#define DPRAM_ERR_MSG_LEN 65
Expand Down Expand Up @@ -176,7 +176,7 @@ struct pdp_info {
union {
/* Virtual serial interface */
struct {
struct tty_driver tty_driver[NUM_PDP_CONTEXT]; // CSD, CDMA, TRFB
struct tty_driver tty_driver[NUM_PDP_CONTEXT]; // CSD, CDMA
int refcount;
struct tty_struct *tty_table[1];
struct ktermios *termios[1];
Expand Down Expand Up @@ -583,6 +583,7 @@ static int dpram_write(dpram_device_t *device,
{
int retval = 0;
int size = 0;
int ret = 0;

u16 head, tail;
u16 irq_mask = 0;
Expand Down
5 changes: 4 additions & 1 deletion drivers/i2c/chips/kr3dm_accel_driver.c
Expand Up @@ -393,6 +393,7 @@ printk(KERN_INFO"%s\n", __FUNCTION__);


// iamaj ec27 [[
/*
if(++dataPo == KR3DM_REF) dataPo =0;
kr3dmData[KR3DM_X][dataPo] = acc->x;
kr3dmData[KR3DM_Y][dataPo] = acc->y;
Expand All @@ -410,6 +411,7 @@ printk(KERN_INFO"%s\n", __FUNCTION__);
else acc->y = kr3dmData[KR3DM_Y][KR3DM_REF];
if( KisChangeZ) kr3dmData[KR3DM_Z][KR3DM_REF] = acc->z;
else acc->z = kr3dmData[KR3DM_Z][KR3DM_REF];
*/
// ]]

#if 0
Expand Down Expand Up @@ -535,6 +537,7 @@ printk(KERN_INFO"%s\n", __FUNCTION__);


// iamaj ec27 [[
/*
if(++dataPo == KR3DM_REF) dataPo =0;
kr3dmData[KR3DM_X][dataPo] = acc->x;
kr3dmData[KR3DM_Y][dataPo] = acc->y;
Expand All @@ -553,7 +556,7 @@ printk(KERN_INFO"%s\n", __FUNCTION__);
if( KisChangeZ) kr3dmData[KR3DM_Z][KR3DM_REF] = acc->z;
else acc->z = kr3dmData[KR3DM_Z][KR3DM_REF];
// ]]

*/
#if 0
printk("[KR3DM] x = %d / y = %d / z = %d converted data \n", acc->x, acc->y, acc->z ); //kimhyuns_temp
#endif
Expand Down
15 changes: 6 additions & 9 deletions drivers/net/wireless/broadcom/src/bcmsdio/sys/bcmsdh_linux.c
Expand Up @@ -195,7 +195,7 @@ int bcmsdh_probe(struct device *dev)
irq_flags = \
IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
#else
irq_flags = IRQF_TRIGGER_RISING;
irq_flags = IRQF_TRIGGER_RISING;
#endif /* HW_OOB */
irq = dhd_customer_oob_irq_map(&irq_flags);
if (irq < 0) {
Expand Down Expand Up @@ -632,15 +632,12 @@ int bcmsdh_register_oob_intr(void * dhdp)
if (!sdhcinfo->oob_irq_registered) {
SDLX_MSG(("%s IRQ=%d Type=%X \n", __FUNCTION__, \
(int)sdhcinfo->oob_irq, (int)sdhcinfo->oob_flags));
/* Refer to customer Host IRQ docs about proper irqflags definition */
error = request_irq(sdhcinfo->oob_irq, wlan_oob_irq,
IRQF_TRIGGER_RISING, "bcmsdh_sdmmc", NULL);//SecFeature.Chief
/* Refer to customer Host IRQ docs about proper irqflags definition */
error = request_threaded_irq(sdhcinfo->oob_irq, NULL, wlan_oob_irq,
IRQF_TRIGGER_RISING, "bcmsdh_sdmmc", NULL);

if (error)
{
printk (KERN_ERR "Unable to request wlan_oob_irq[%d]\n", sdhcinfo->oob_irq);
return -ENODEV;
}
if (error)
return -ENODEV;

set_irq_wake(sdhcinfo->oob_irq, 1);

Expand Down
9 changes: 6 additions & 3 deletions drivers/net/wireless/broadcom/src/bcmsdio/sys/bcmsdh_sdmmc.c
Expand Up @@ -829,8 +829,9 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, uint8 *by
}

if (err_ret) {
sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
rw ? "Write" : "Read", func, regaddr, *byte, err_ret));
/* sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
rw ? "Write" : "Read", func, regaddr, *byte, err_ret)); */
sd_err("bcmsdh_sdmmc: Failed \n");
}

return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
Expand Down Expand Up @@ -877,7 +878,9 @@ sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func, uint add
sdio_release_host(gInstance->func[func]);

if (err_ret) {
sd_err(("%s : Failed to %d word, Err: 0x%08x \n",__FUNCTION__, rw ,err_ret));
/*sd_err(("bcmsdh_sdmmc: Failed to %s word, Err: 0x%08x",
rw ? "Write" : "Read", err_ret));*/
sd_err("bcmsdh_sdmmc: Failed \n");
}

return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
Expand Down
17 changes: 8 additions & 9 deletions drivers/net/wireless/broadcom/src/dhd/sys/dhd_linux.c
Expand Up @@ -2287,15 +2287,6 @@ dhd_bus_start(dhd_pub_t *dhdp)
DHD_ERROR(("%s, dhd_bus_init failed %d\n", __FUNCTION__, ret));
return ret;
}

/* If bus is not ready, can't come up */
if (dhd->pub.busstate != DHD_BUS_DATA) {
dhd->wd_timer_valid = FALSE;
del_timer_sync(&dhd->timer);
DHD_ERROR(("%s failed bus is not ready\n", __FUNCTION__));
return -ENODEV;
}

#if defined(OOB_INTR_ONLY)
/* Host registration for OOB interrupt */
if (bcmsdh_register_oob_intr(dhdp)) {
Expand All @@ -2311,6 +2302,13 @@ dhd_bus_start(dhd_pub_t *dhdp)
dhd_enable_oob_intr(dhd->pub.bus, TRUE);
#endif /* defined(OOB_INTR_ONLY) */

/* If bus is not ready, can't come up */
if (dhd->pub.busstate != DHD_BUS_DATA) {
dhd->wd_timer_valid = FALSE;
del_timer_sync(&dhd->timer);
DHD_ERROR(("%s failed bus is not ready\n", __FUNCTION__));
return -ENODEV;
}

#ifdef READ_MACADDR
if (dhd_read_macaddr(dhd) < 0)
Expand Down Expand Up @@ -2340,6 +2338,7 @@ dhd_bus_start(dhd_pub_t *dhdp)
setbit(dhdp->eventmask, WLC_E_TXFAIL);
setbit(dhdp->eventmask, WLC_E_JOIN_START);
setbit(dhdp->eventmask, WLC_E_SCAN_COMPLETE);
setbit(dhdp->eventmask, WLC_E_DEAUTH);
setbit(dhdp->eventmask, WLC_E_RELOAD);
#ifdef PNO_SUPPORT
setbit(dhdp->eventmask, WLC_E_PFN_NET_FOUND);
Expand Down
26 changes: 22 additions & 4 deletions drivers/net/wireless/broadcom/src/dhd/sys/dhd_sdio.c
Expand Up @@ -501,6 +501,7 @@ dhdsdio_set_siaddr_window(dhd_bus_t *bus, uint32 address)
return err;
}

static int g_sdioerr = 0;

/* Turn backplane clock on or off */
static int
Expand Down Expand Up @@ -531,7 +532,12 @@ dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)

bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
if (err) {
DHD_ERROR(("%s: HT Avail request error1: %d\n", __FUNCTION__, err));
DHD_ERROR(("%s: HT Avail request error: %d\n", __FUNCTION__, err));
printk("[%s] : htclk error [%d] \r\n" , __func__ , g_sdioerr++);
if(g_sdioerr > 3) {
bus->dhd->busstate = DHD_BUS_DOWN;
g_sdioerr = 0;
}
return BCME_ERROR;
}

Expand Down Expand Up @@ -580,6 +586,11 @@ dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
if (err) {
DHD_ERROR(("%s: HT Avail request error: %d\n", __FUNCTION__, err));
printk("[%s] : htclk error [%d] \r\n" , __func__ , g_sdioerr++);
if(g_sdioerr > 3) {
bus->dhd->busstate = DHD_BUS_DOWN;
g_sdioerr = 0;
}
return BCME_ERROR;
}
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
Expand Down Expand Up @@ -624,6 +635,11 @@ dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
if (err) {
DHD_ERROR(("%s: Failed access turning clock off: %d\n",
__FUNCTION__, err));
printk("[%s] : htclk error3333 [%d] \r\n" , __func__ , g_sdioerr++);
if(g_sdioerr > 3) {
bus->dhd->busstate = DHD_BUS_DOWN;
g_sdioerr = 0;
}
return BCME_ERROR;
}
}
Expand Down Expand Up @@ -1394,7 +1410,7 @@ dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen)
int retries = 0;
R_SDREG(intstatus, &bus->regs->intstatus, retries);
DHD_ERROR(("%s: resumed on timeout, INT=0x%X\n", __FUNCTION__, intstatus));
#ifdef DHD_DEBUG
#if 0 // to avoid kernel panic from OOB interrupts timeout //def DHD_DEBUG
dhd_os_sdlock(bus->dhd);
dhdsdio_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
Expand Down Expand Up @@ -1866,12 +1882,14 @@ dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
DHD_ERROR(("%s: %s\n", __FUNCTION__, strbuf.origbuf));
}

#if 0 // remove only debugging purpose codes
#ifdef DHD_DEBUG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
/* Mem dump to a file on device */
dhdsdio_mem_dump(bus);
}
#endif /* DHD_DEBUG */
#endif

done:
if (mbuffer)
Expand Down Expand Up @@ -2743,6 +2761,8 @@ dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)

BUS_WAKE(bus);

/* Change our idea of bus state */
bus->dhd->busstate = DHD_BUS_DOWN;

/* Enable clock for device interrupts */
dhdsdio_clkctl(bus, CLK_AVAIL, FALSE);
Expand All @@ -2762,8 +2782,6 @@ dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
DHD_ERROR(("%s: Failed to force clock for F2: err %d\n", __FUNCTION__, err));
}

/* Change our idea of bus state */
bus->dhd->busstate = DHD_BUS_DOWN;
/* Turn off the bus (F2), free any pending packets */
DHD_INTR(("%s: disable SDIO interrupts\n", __FUNCTION__));
bcmsdh_intr_disable(bus->sdh);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/broadcom/src/include/bcmsdh_sdmmc.h
Expand Up @@ -27,7 +27,7 @@
#ifndef __BCMSDH_SDMMC_H__
#define __BCMSDH_SDMMC_H__

#define sd_err(x) printk(x)
#define sd_err(x)
#define sd_trace(x)
#define sd_info(x)
#define sd_debug(x)
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/wireless/broadcom/src/include/spid.h
Expand Up @@ -5,29 +5,28 @@
*
* Copyright (C) 1999-2010, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
*
* $Id: spid.h,v 1.7.10.1.16.3 2009/04/09 19:23:14 Exp $
*/


#ifndef _SPI_H
#define _SPI_H

Expand Down

0 comments on commit 5c386cc

Please sign in to comment.