summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXinyu Chen <xinyu.chen@freescale.com>2012-09-07 09:57:12 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2012-09-07 09:57:12 +0800
commitcbc0db0202a9d92e726de41c9884baee5190e4c1 (patch)
tree943b80849424b5f2be814c8a31c455371c4fbfac /drivers
parenta45bfa0fcb4f54a4ff8e4c6785f8faa6bdf1cd8c (diff)
parentb387e1ccdaaf6f15a0c40e9738ef6eef0df83253 (diff)
Merge remote branch 'fsl-linux-sdk/imx_3.0.35_12.09.01' into imx_3.0.35_android
Conflicts: arch/arm/mach-mx6/pm.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/caam/caamhash.c10
-rw-r--r--drivers/crypto/caam/desc_constr.h1
-rw-r--r--drivers/mxc/thermal/thermal.c15
-rwxr-xr-xdrivers/power/sabresd_battery.c44
-rw-r--r--drivers/video/mxc_hdmi.c28
5 files changed, 59 insertions, 39 deletions
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c
index cdc3f3efef02..ee065151f0fc 100644
--- a/drivers/crypto/caam/caamhash.c
+++ b/drivers/crypto/caam/caamhash.c
@@ -441,7 +441,13 @@ static u32 hash_digest_key(struct caam_hash_ctx *ctx, const u8 *key_in,
dma_addr_t src_dma, dst_dma;
int ret = 0;
- desc = kmalloc(CAAM_CMD_SZ * 6 + CAAM_PTR_SZ * 2, GFP_KERNEL | GFP_DMA);
+ /*
+ * Hashing descriptor is 6 commands (including header), 2 pointers,
+ * and 2 extended lengths
+ */
+ desc = kmalloc((CAAM_CMD_SZ * 6 + CAAM_PTR_SZ * 2 +
+ CAAM_EXTLEN_SZ * 2),
+ GFP_KERNEL | GFP_DMA);
init_job_desc(desc, 0);
@@ -1504,6 +1510,8 @@ static int ahash_init(struct ahash_request *req)
state->final = ahash_final_no_ctx;
state->current_buf = 0;
+ state->buflen_0 = 0;
+ state->buflen_1 = 0;
return 0;
}
diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h
index c85c1f058401..0393c98f5b9c 100644
--- a/drivers/crypto/caam/desc_constr.h
+++ b/drivers/crypto/caam/desc_constr.h
@@ -9,6 +9,7 @@
#define IMMEDIATE (1 << 23)
#define CAAM_CMD_SZ sizeof(u32)
#define CAAM_PTR_SZ sizeof(dma_addr_t)
+#define CAAM_EXTLEN_SZ sizeof(u32)
#define CAAM_DESC_BYTES_MAX (CAAM_CMD_SZ * MAX_CAAM_DESCSIZE)
#ifdef DEBUG
diff --git a/drivers/mxc/thermal/thermal.c b/drivers/mxc/thermal/thermal.c
index 6f3c7a912170..f0e961f6109d 100644
--- a/drivers/mxc/thermal/thermal.c
+++ b/drivers/mxc/thermal/thermal.c
@@ -132,15 +132,15 @@
#define KELVIN_TO_CEL(t, off) (((t) - (off)))
#define CEL_TO_KELVIN(t, off) (((t) + (off)))
#define DEFAULT_RATIO 145
-#define DEFAULT_N25C 1541
-#define REG_VALUE_TO_CEL(ratio, raw) ((raw_n25c - raw) * 100 / ratio - 25)
+#define DEFAULT_N40C 1563
+#define REG_VALUE_TO_CEL(ratio, raw) ((raw_n40c - raw) * 100 / ratio - 40)
#define ANATOP_DEBUG false
#define THERMAL_FUSE_NAME "/sys/fsl_otp/HW_OCOTP_ANA1"
/* variables */
unsigned long anatop_base;
unsigned int ratio;
-unsigned int raw_25c, raw_hot, hot_temp, raw_n25c, raw_125c, raw_critical;
+unsigned int raw_25c, raw_hot, hot_temp, raw_n40c, raw_125c, raw_critical;
static struct clk *pll3_clk;
static bool full_run = true;
static bool suspend_flag;
@@ -320,10 +320,9 @@ static int anatop_thermal_get_temp(struct thermal_zone_device *thermal,
if (ANATOP_DEBUG)
anatop_dump_temperature_register();
-
- /* only the temp between -25C and 125C is valid, this
+ /* only the temp between -40C and 125C is valid, this
is for save */
- if (tmp <= raw_n25c && tmp >= raw_125c)
+ if (tmp <= raw_n40c && tmp >= raw_125c)
tz->temperature = REG_VALUE_TO_CEL(ratio, tmp);
else {
printk(KERN_WARNING "Invalid temperature, force it to 25C\n");
@@ -848,7 +847,7 @@ static int anatop_thermal_counting_ratio(unsigned int fuse_data)
hot_temp = fuse_data & 0xff;
ratio = ((raw_25c - raw_hot) * 100) / (hot_temp - 25);
- raw_n25c = raw_25c + ratio / 2;
+ raw_n40c = raw_25c + (13 * ratio) / 20;
raw_125c = raw_25c - ratio;
/* Init default critical temp to set alarm */
raw_critical = raw_25c - ratio * (KELVIN_TO_CEL(TEMP_CRITICAL, KELVIN_OFFSET) - 25) / 100;
@@ -913,7 +912,7 @@ static int anatop_thermal_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to remap anatop calibration data address!\n");
goto anatop_failed;
}
- raw_n25c = DEFAULT_N25C;
+ raw_n40c = DEFAULT_N40C;
/* use calibration data to get ratio */
anatop_thermal_counting_ratio(__raw_readl(calibration_addr));
diff --git a/drivers/power/sabresd_battery.c b/drivers/power/sabresd_battery.c
index 516fbd806b64..c7318a6eb02c 100755
--- a/drivers/power/sabresd_battery.c
+++ b/drivers/power/sabresd_battery.c
@@ -884,16 +884,52 @@ static int max8903_suspend(struct platform_device *pdev,
pm_message_t state)
{
struct max8903_data *data = platform_get_drvdata(pdev);
-
- cancel_delayed_work(&data->work);
+ int irq;
+ if (data) {
+ struct max8903_pdata *pdata = data->pdata;
+ if (pdata) {
+ irq = gpio_to_irq(pdata->dok);
+ enable_irq_wake(irq);
+ irq = gpio_to_irq(pdata->uok);
+ enable_irq_wake(irq);
+ cancel_delayed_work(&data->work);
+ }
+ }
return 0;
}
static int max8903_resume(struct platform_device *pdev)
{
struct max8903_data *data = platform_get_drvdata(pdev);
-
- schedule_delayed_work(&data->work, BATTERY_UPDATE_INTERVAL);
+ bool ta_in;
+ bool usb_in;
+ int irq;
+ if (data) {
+ struct max8903_pdata *pdata = data->pdata;
+ if (pdata) {
+ ta_in = gpio_get_value(pdata->dok) ? false : true;
+ usb_in = gpio_get_value(pdata->uok) ? false : true;
+ if (ta_in != data->ta_in) {
+ data->ta_in = ta_in;
+ pr_info("TA(DC-IN) Charger %s.\n", ta_in ?
+ "Connected" : "Disconnected");
+ max8903_charger_update_status(data);
+ power_supply_changed(&data->psy);
+ }
+ if (usb_in != data->usb_in) {
+ data->usb_in = usb_in;
+ pr_info("USB Charger %s.\n", usb_in ?
+ "Connected" : "Disconnected");
+ max8903_charger_update_status(data);
+ power_supply_changed(&data->usb);
+ }
+ irq = gpio_to_irq(pdata->dok);
+ disable_irq_wake(irq);
+ irq = gpio_to_irq(pdata->uok);
+ disable_irq_wake(irq);
+ schedule_delayed_work(&data->work, BATTERY_UPDATE_INTERVAL);
+ }
+ }
return 0;
}
diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c
index 9e23bdea331f..74a42aabe976 100644
--- a/drivers/video/mxc_hdmi.c
+++ b/drivers/video/mxc_hdmi.c
@@ -1070,7 +1070,7 @@ static int hdmi_phy_configure(struct mxc_hdmi *hdmi, unsigned char pRep,
while (val == 0) {
udelay(1000);
if (msec-- == 0) {
- dev_err(&hdmi->pdev->dev, "PHY PLL not locked\n");
+ dev_dbg(&hdmi->pdev->dev, "PHY PLL not locked\n");
return false;
}
val = hdmi_readb(HDMI_PHY_STAT0) & HDMI_PHY_TX_PHY_LOCK;
@@ -1394,28 +1394,6 @@ static int mxc_hdmi_read_edid(struct mxc_hdmi *hdmi)
return HDMI_EDID_SUCCESS;
}
-static void mxc_hdmi_enable_pins(struct mxc_hdmi *hdmi)
-{
- struct fsl_mxc_hdmi_platform_data *plat = hdmi->pdev->dev.platform_data;
-
- dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
-
- /* Enable pins to HDMI */
- if (plat->enable_pins)
- plat->enable_pins();
-}
-
-static void mxc_hdmi_disable_pins(struct mxc_hdmi *hdmi)
-{
- struct fsl_mxc_hdmi_platform_data *plat = hdmi->pdev->dev.platform_data;
-
- dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
-
- /* Disable pins to HDMI */
- if (plat->disable_pins)
- plat->disable_pins();
-}
-
static void mxc_hdmi_phy_disable(struct mxc_hdmi *hdmi)
{
dev_dbg(&hdmi->pdev->dev, "%s\n", __func__);
@@ -1656,7 +1634,7 @@ static void mxc_hdmi_set_mode(struct mxc_hdmi *hdmi)
dev_dbg(&hdmi->pdev->dev,
"%s: Video mode same as previous\n", __func__);
/* update fbi mode in case modelist is updated */
- hdmi->fbi->mode = mode;
+ hdmi->fbi->mode = (struct fb_videomode *)mode;
mxc_hdmi_phy_init(hdmi);
} else {
dev_dbg(&hdmi->pdev->dev, "%s: New video mode\n", __func__);
@@ -2297,8 +2275,6 @@ static void mxc_hdmi_disp_deinit(struct mxc_dispdrv_handle *disp)
fb_unregister_client(&hdmi->nb);
- mxc_hdmi_disable_pins(hdmi);
-
clk_disable(hdmi->hdmi_isfr_clk);
clk_put(hdmi->hdmi_isfr_clk);
clk_disable(hdmi->hdmi_iahb_clk);