kernel/kernel-mfld-blackbay.git
13 years agomerge of reated changes
German Monroy [Fri, 30 Sep 2011 00:39:30 +0000 (17:39 -0700)]
merge of reated changes
kernel build: add Android makefile

So that this kernel can be compiled together with the rest of Android
(i.e. build automatically creates boot.bin)

Change-Id: I7f59d0d17ed267e101f0cee2f75a5893de5cfbcb

kbuild: add a make defoldconfig make option

The oldconfig option is asking user to choose when new config options are defined in KConfig files, and not in .config
This prevents automatic builds.

This make target will use default values for all options not specified in .config

xxChange - Id: I713a5cc248130056441060dccfcb492ad0d8acb5
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
Change-Id: I5f12ca9bc66ba7ac54bc205319c23d2875c0ea6f

13 years agoUSB: Merge the following changes from UMG 2.6.35 tree
Fei Yang [Thu, 6 Oct 2011 23:27:37 +0000 (16:27 -0700)]
USB: Merge the following changes from UMG 2.6.35 tree

Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Signed-off-by: Fei Yang <fei.yang@intel.com>
commit 6a9f1076fde6cbcac68d51efe0bf8c8776d57f42
Author: jzhuan5 <jin.can.zhuang@intel.com>
Date:   Fri Sep 16 17:03:33 2011 -0400

    usb: langwell_udc: protect access to ep->desc and clear Auto low power featu

    BZ: 9110

    Two issue fixed:
    1. When langwell_ep_queue is being called, there could be interrupts, then e
    is set NULL, after returning from interrupt, langwell_ep_queue() calls queue
    which will access ep->desc without checking it, this leads to NULL pointer k

    The patch adds lock protection to ep->desc to avoid this.

    2. The auto low power feature is causing fabric error when calling langwell_
    in some extreme timing situtation. In this bug, langwell_ep_disable() is cal
    after bus suspend is received by device controller. If auto low power featur
    PHCD bit will be set by controller automatically. Then, langwell_ep_disable(
    fabric error.

    Since langwell_udc driver has not utilized this feature, this patch simply d

    Change-Id: Ia95d9ee9dee22c19e55f046b62a864a2fb4bd084
Signed-off-by: jzhuan5 <jin.can.zhuang@intel.com>
    Reviewed-on: http://android.intel.com:8080/18772
Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com>
Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
commit cfbe81d988a2201ca0a02fa33481f0f014cab3ab
Author: Wu, Hao <hao.wu@intel.com>
Date:   Thu Sep 1 22:24:24 2011 +0800

    usb/penwell_otg: increase ulpi access timeout

    BZ:  7272

    This patch increase the timeout for each ulpi access via
    PNW USB controller to MSIC ULPI registers, to increase
    tolerance for bad case.

    Change-Id: I5ee9769ba990f591744d08e4fc2147037f57fab6
Signed-off-by: Wu, Hao <hao.wu@intel.com>
    Reviewed-on: http://android.intel.com:8080/17034
Reviewed-by: buildbot <buildbot@intel.com>
Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com>
Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
commit 02bbb3bf258225f59fcd4f28827ae77d817db2d6
Author: jzhuan5 <jin.can.zhuang@intel.com>
Date:   Thu Sep 1 16:38:58 2011 -0400

    usb: client: Fix the issue of test mode fail in TEST_PACKET

    BZ:  8285 8779

    PET sends set_feature request to enable USB client to a state of TEST MODE.
    After the completion of status stage, USB client should enable TEST MODE by
    programming PORTSC1 register. Also stop TEST MODE after USB device power
    cycle according to USB Spec.

    Change-Id: Ie973dabd227ddde6fdbea30e55866ee07b9bb884
Signed-off-by: jzhuan5 <jin.can.zhuang@intel.com>
Signed-off-by: Wu, Hao <hao.wu@intel.com>
    Reviewed-on: http://android.intel.com:8080/17146
Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com>
Tested-by: Yin, Fengwei <fengwei.yin@intel.com>
commit 87f8a45120ee13c30100d687499be97c6d31bf04
Author: Yu Wang <yu.y.wang@intel.com>
Date:   Fri Aug 26 17:14:19 2011 +0800

    usb: langwell_udc: fix flush ep met fabric error.

    BZ:  7888

    When UDC flush ep, sometimes system met fabric error. The root cause is
    before flush ep, PHY would exit low power mode. And there is a latency
    in HW did this operation, if driver access UDC during this latency,
    system will meet fabric error.

    This patch add 3 millisecond delay to ensure the PHY HW exit low power
    mode, then operate UDC.

    Change-Id: I39992616c58e3c89789830413a323439ba785764
Signed-off-by: Yu Wang <yu.y.wang@intel.com>
commit d4252773bed09a139437efc975c78b1d684c527e
Author: jzhuan5 <jin.can.zhuang@intel.com>
Date:   Fri Aug 26 12:00:58 2011 -0400

    usb: otg: Disable MSIC interrupt when system is shutting down

    BZ:  7832

    This patch implements shutdown callback of penwell_otg driver.
    The shutdown callback disables MSIC interrupts to prevent from
    disturbing the process of system shutdown.
Signed-off-by: jzhuan5 <jin.can.zhuang@intel.com>
    Change-Id: I3de7f54d09b5b9b06304775403115e5932b28b72

commit 14a840ae3eb1d4d7dc886e332abd8afb0840633d
Author: Wu, Hao <hao.wu@intel.com>
Date:   Tue Aug 16 01:44:35 2011 +0800

    usb/penwell_otg: fix PD_DCP detection compliance Test issue.

    BZ:  4360

    This patch add 1ms sleep between Primary and Secondary Detection,
    and assert VDPSRC when DCP detected and attached. This resolved
    BC1.2 compliance test case PD_DCP issue.

    Change-Id: I9cf3b71e33a795748702a3cf582b8fa51abc6a11
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 1c3d68c874898e90442c2dfb541c8dd2397a3749
Author: Wu, Hao <hao.wu@intel.com>
Date:   Wed Aug 3 04:00:10 2011 +0800

    usb/langwell_udc: fix some issue to avoid blocking into D0i1.

    BZ:  6378
    This patch is from Borqs, resolve issue if ep flush timeout, then
    USB D0i1 state will be blocked.

    Change-Id: I9697cc2c310db20b337e8dd9032f1eb951a0f2e5
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 63e1d6fa995a95991b668d34126017629909099c
Author: Wu, Hao <hao.wu@intel.com>
Date:   Fri Jul 29 19:02:15 2011 +0800

    usb/penwell_otg: manual charger detection flow

    BZ:  2921

    This is a SW workaround for a hardware issue which cause charging
    failure, using manual charger detection flow instead of original one
    to avoid this hardware issue.
    Please note that the new flow using ULPI, only works on PNW C0 or later
    version.

    Change-Id: I1941c2dd7364b13b7354995f0eb5a3a6ec2da402
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 1ad65047b445da5455da82b8b05b168516979b56
Author: Wu, Hao <hao.wu@intel.com>
Date:   Thu Jul 28 02:45:12 2011 +0800

    usb/penwell_otg: enable OTG_VBUS_OFF test mode for compliance test

    BZ:  5895

    This patch enabled OTG_VBUS_OFF test mode in driver for USB OTG 2.0 complian
    case CT_A_CAP (OTG Compliance Plan 8.1.2 A-UUT Bypass Capacitance).

    Change-Id: I07891cb9d1138e620361b30c7d894b0f5f4dfec4
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 105bf83d769f9b5a4fc13287595080a236df4ece
Author: Wu, Hao <hao.wu@intel.com>
Date:   Fri Jul 15 03:50:30 2011 +0800
    usb/penwell:  fix incorrect charging current when USB is in unconfigured sta

    BZ: 5146

    This patch is for USB OTG2.0 Compliance issue, after a USB reset, USB will
    be back to unconfigured state, then only can draw less than IB_UNCFG max
    (2.5mA) current from connected SDP. This patch add related action triggered
    by USB reset event.

    Change-Id: I4d325de485e468b0bd808c0ccebc2aadea95768c
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 03da966f597139a67f7644a7b17631d06cda5c5e
Author: Yu Wang <yu.y.wang@intel.com>
Date:   Thu Jul 14 16:57:14 2011 +0800

    usb:  langwell_udc: fix pull up USB met fabric error issue.

    BZ: 5087

    After enabled the "USB tethering" from Android settings application,
    pulled up USB cable, board would meet fabric error. The root cause is
    after pulled up USB cable, UDC would go to D0I1 mode. And Android
    framework would find USB cabled was disconnected, then wrote zero to funtion
    enable interface of sysfs. But this sysfs interface hadn't resume UDC to D0
    mode before operated UDC HW, then met fabric error.

    This patch fixes this issue by resume UDC from DOI1 before operating HW
    in langwell_pullup function.

    Change-Id: I9b7c698afec79f0ef355c3053ef9538e8b9dd4e6
Signed-off-by: Yu Wang <yu.y.wang@intel.com>
commit ed3cd9c69c33d5a70f4918e8822413dd95001007
Author: Wu, Hao <hao.wu@intel.com>
Date:   Wed Jul 13 02:29:45 2011 +0800

    usb/penwell:  add SRP test mode support

    BZ: 4974
    This patch is for SRP Test mode support, please refer to USB OTG 2.0
    Spec 6.4.3, OTG Compliance Test 6.3.4.

    Change-Id: Iaba1d89b79c28862a0239c0cf5cc57a00fef8e8c
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit b49721682faf6a42aecbddfa71ebb10d537cf661
Author: Jiebing Li <jiebing.li@intel.com>
Date:   Fri Jul 1 04:10:08 2011 +0800

    usb:  langwell_udc: fix pull-up enable issue in langwell_pullup()

    BZ: 4154

    Sometimes USB host sends bus_suspend request to device due to
    some reason. When device receives the request, PHY will be put
    into low power suspend by device driver. If at this time
    langwell_pullup() is called by gadget driver to set USBCMD
    Run/Stop bit, the pull-up on D+ will not be enabled as expected.

    This patch fixes the issue by exiting PHY low power in langwell_pullup().

    Change-Id: I1b9836f57e0a25e16eeaa31b3c4319e811a542ad
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
commit 2e1aa820ecc706cde4798ead132629b276bcc84f
Author: Hao Wu <hao.wu@intel.com>
Date:   Mon Jun 20 10:43:42 2011 +0800

    usb/penwell_otg:  enable timer ta_wait_bcon for wait connection state.

    BZ: 4357

    After USB A-cable is inserted into OTG port, USB driver will enable
    Host stack and VBUS power supply, then wait device to connect. Per
    spec, enable the wait timeout as 15s (< 30s max).
    This is for OTG2.0 Compliance Test: 6.2.2 A_UUT Power up Test.

    Change-Id: I4a9ae8c23c26aabb461fa7c5c77b9057cbe6290d
Signed-off-by: Wu, Hao <hao.wu@intel.com>
commit 1163dcda8ec382b08299bf09d01f1f76ba977da7
Author: Hao Wu <hao.wu@intel.com>
Date:   Mon May 30 20:33:41 2011 +0800

    usb/langwell_udc: hold wakelock when USB is connected and not suspended

    BZ: 2824

    This patch enable USB udc driver to hold wake lock when USB is connected
    and usb bus is active state. This will prevent system from trying to enter
    S3 when usb is still alive.

    Change-Id: Ibc2ae6a985ea6d9168265c3ce4227f4a4309eba4
Signed-off-by: Hao Wu <hao.wu@intel.com>
commit 500c0f18a30a222620027446294d913fa3e9a60e
Author: Shanyu Zhao <shanyu.zhao@intel.com>
Date:   Tue May 17 15:31:55 2011 -0700

    USB: Fix commanded stall feature in the device controller

    BZ: 2314

    usbtest TEST CASE 13 - endpoint halt feature fails. Commanded stall
    occurs when host explicitly calls the endpoint's halt feature.
    The set_halt function at the gadget side will not halt theendpoint
    if the queue is not empty. Therefore when the host calls the
    halt feature for some gadget function such as the gadget zero, which
    always put a usb_request in the queue, the halt always  fails.

    To fix the failure, for commanded stall don't check for the queue.
    Also when reset the endpoint the halt flag shall be cleared manually.

    Change-Id: I1f5789a4c8115d46c800ee5b808141cab9c2da20
Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
commit acb6ef93331fb854408ba0748e26ae6e18c0b653
Author: Shanyu Zhao <shanyu.zhao@intel.com>
Date:   Tue May 17 14:39:52 2011 -0700

    USB:  disable HW zero length termination for device control endpoints
    BZ: 2767

    Since the control endpoints know the expected number of bytes in a
    transaction, zero length termination (zlt) is not needed. If enabled
    the device controller would wait indefinitely for the USB host to send
    an zero length packet which never  happens.

    This fixes the failure of the usbtest TEST CASE 14.

    Change-Id: Ib31f2c6dd87b60c669c265bb87afbead056d536f
Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
commit 35eaa2fdf470e9b6bf922ba67ca5ca48fdb8bfd1
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri May 6 13:26:25 2011 +0800

    usb: penwell_otg: use separate suspend/resume functions for D3

    BZ: 1424

    This patch updated penwell_otg driver to use separate resume/suspend
    function for D3 instead of reuse runtime pm functions, they contain
     more state machine handling for USB D3 state, including PHY Low
    power mode setting, timer delete and state transition. It resolved
     unstable issue caused by incorrect handle on USB states and events
     when D3 suspend/resume.

    Change-Id: I94d395a2851b5cfda0c8e2dd49ebd83c92e6aa83
Signed-off-by: Hao Wu <hao.wu@intel.com>
commit e29a44d2438cd13521af9b36719f00ebe8527593
Author: Sundar Iyer <sundar.iyer@intel.com>
Date:   Mon Apr 25 18:53:52 2011 +0530

    usb/penwell_otg: use dev_pm_ops interfaces for D3 suspend/resume.

    BZ:#1378/#1301

    This patch updates the penwell_otg to use .suspend/.resume in the dev_pm_ops
     interface instead of the legacy pci driver suspend/resume functions.
    This patch also removes duplicate pci related opeartions in suspend/resume
    functions.

    Change-Id: I66f2bf841979bc40787d3b3b884583c7b30511d8
Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
commit 6e2bf9dc73b990dc693ed6413d2f7ddc33df8615
Author: Jiebing Li <jiebing.li@intel.com>
Date:   Tue Apr 19 15:37:46 2011 +0800

    usb: langwell_udc: fix cable unplug issues

    BZ: 1001

    This patch fixed stop USB peripheral stack issue after received unplug event

    Two issues are fixed in this patch:
    1. add dtd_pool pointer check in order to avoid dtd pool free error
    2. remove PHY low power set in order to avoid EP flush timeout

    Change-Id: Ib259268cdffcb0ad30a19dd3258992efe63720cb
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
commit 9e6b9018a137bb68d8c55bcd9a9096a1134693d3
Author: Hao Wu <hao.wu@intel.com>
Date:   Tue Apr 19 14:59:34 2011 +0800

    usb: penwell_otg: fix missing unplug USB cable event.

    BZ: 1001

    This patch is for BZ1001, mainly solve missing unplug USB wall charger
    (DCP) event when USB is in D0i3 and charging from DCP.

    Main change in penwell_otg:
    - Use PNW USB OTGSC status register to check wakeup event.
    - Ensure mode is set and PHY is in low power mode before enter D0i3
    - Remove duplicate PHY low power mode setting.

    Change-Id: I4c842a7b8a10332360b7b7695139666870094284
Signed-off-by: Hao Wu <hao.wu@intel.com>
commit c2846926367114bead0e6cd0f1b4dff6fc6a121f
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri Apr 15 11:36:30 2011 +0800

    usb: penwell_otg: fixing SRP failure.

    Fixing patch for Sighting 3742776: SRP failed

    Change-Id: I64b9446b7ba8b5e87b1e95e87ea20b2682c071f4
Signed-off-by: Hao Wu <hao.wu@intel.com>
commit 3f35456f90c7ff997e078cc9083cfefda4bc4f02
Author: Jiebing Li <jiebing.li@intel.com>
Date:   Thu Mar 10 16:56:26 2011 +0800

    runtime PM mode change in gadget unregister operation

    put usb client to D0 mode in gagdet unregister operation and put it
    back to D0i3 after the operation done

    Change-Id: Ib8fe33f9f46947ed4a9e26458db75f2ae16318d3
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
commit d17c4c027c5c8e0e2e42d9c637cf4452c204b443
Author: Jiebing Li <jiebing.li@intel.com>
Date:   Fri Aug 20 13:49:09 2010 -0700

    linux-2.6.36-usb-penwell-otg-add-aca-device-support.patch

commit 80900b4c8976ec78b12393d64244e2f186998736
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri Aug 20 13:49:09 2010 -0700

    linux-2.6.36-usb-penwell_otg-HACK-resume-controller-before-reg-access.patch

commit f5ec09219efa41149a38930e84cd77dd402ed9dc
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri Aug 20 13:49:09 2010 -0700

    linux-2.6.36-usb-penwell_otg-add-phy-config.patch

commit ede32384e6a8021d6fa9627ead3ac378bafe60e7
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri Aug 20 13:49:09 2010 -0700

    linux-2.6.36-usb-penwell_otg-update-otg-state-machine-for-runtime_pm.patch

commit 7f1584ff3eac1fa4c01762c071c0b5bdeaba0da9
Author: Hao Wu <hao.wu@intel.com>
Date:   Fri Aug 20 13:49:09 2010 -0700

    linux-2.6.36-usb-langwell_udc-add-runtime-pm-support-for-otg.patch

Change-Id: I06a291cee179b1efe450eadf96e278434246742a

13 years agopci_quirks: adding D0i1 in usb hsu and D0i2 in sep
Illyas Mansoor [Tue, 17 May 2011 21:48:21 +0000 (03:18 +0530)]
pci_quirks: adding D0i1 in usb hsu and D0i2 in sep

BZ: 2280

currently USB, HSU don't have d1_supported flag set in pm capabilities
register, hence the D0i1 to D0i0 transition is prevented by
the pci framework. Also d2_supported flag is not set for sep.

This needs to be fixed in the IA FW, till then we add pci quirks
to fix this.

Change-Id: Ib4f1937896dc569472e7dd0dfbd7389f95ce80fd
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
13 years agoPMU: register choose_state fucntion for MID PCI platform ops with
Fei Yang [Tue, 4 Oct 2011 16:46:59 +0000 (09:46 -0700)]
PMU: register choose_state fucntion for MID PCI platform ops with
pmu_pci_choose_state() implemented in the pmu driver.

The following limitations apply to Medfield SoC,
LSS_04: SECURITY supports only D0i2
LSS_06: USB OTG supports only D0i1
LSS_07: USB HOST supports only D0i1
LSS_41: HSU supports only D0i1

Change-Id: I9ddcd198a3eed09efd7be307e8bc6fefa96e3a59
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agopenwell_otg: enable runtime_pm
Kristen Carlson Accardi [Fri, 26 Aug 2011 10:55:08 +0000 (11:55 +0100)]
penwell_otg: enable runtime_pm

runtime_pm was already implemented, but not enabled at probe.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agolangwell_otg: enable runtime pm at probe time
Kristen Carlson Accardi [Thu, 25 Aug 2011 11:20:33 +0000 (12:20 +0100)]
langwell_otg: enable runtime pm at probe time

decrement the usage count at probe time and enable runtime pm.
At remove time, prevent runtime pm by incrementing usage count
and forbidding runtime pm.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agoSCU_IPC: Found the following patch is needed as mmc driver is getting probed
Fei Yang [Fri, 23 Sep 2011 17:22:40 +0000 (10:22 -0700)]
SCU_IPC: Found the following patch is needed as mmc driver is getting probed
before intel_scu_ipc driver, thus intel_scu_ipc_command returns -ENODEV. Also
cleanup one compilation warning in intel_scu_ipcutil.c

commit 91c2605a6c2d4098ef2cefca8e3d783ade02468b
Author: Pierre Tardy <pierre.tardy@intel.com>
Date:   Fri Jan 14 11:45:33 2011 +0100

    intel_scu: change init time to early in the boot

    This will resolve lot of problem with gpio not beeing available, and
    other scu capability needed by drivers early in the boot process.

Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
Change-Id: I4db59373fbe9cb2eaa756d02d07b56c9837b1957
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agoMMC: Merge two patches from UMG 2.6.35
Fei Yang [Fri, 23 Sep 2011 16:20:41 +0000 (09:20 -0700)]
MMC: Merge two patches from UMG 2.6.35

commit 471bd99eac8935361ada496d59e1b4cc1ad83e90
Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date:   Thu Mar 3 13:49:00 2011 +0800

    mmc: emmc mutex support for medfield

    One of the Medfield eMMC controller (PCI device id 0x0823, SDIO3)
    is a shared resource used by the SCU and the IA processors.
    SCU primarily uses the eMMC host controller to access the eMMC device's
    Boot Partition, while the IA CPU uses the eMMC host controller to
    access the eMMC device's User Partition.

    After the SCU hands off the system to the IA processor, the IA processor
    assumes ownership to the eMMC host controller. Due to absence of any
    arbitration at the eMMC host controller, this could result in concurrent
    eMMC host accesses resulting in bus contention and garbage data ending up
    in either of the partitions.

    To circumvent this from happening, eMMC host controller locking mechanism
    is employed, where at any one given time, only one agent, SCU or IA,
    may be allowed to access the host. This is achieved by implementing
    Dekker's Algorithm (http://en.wikipedia.org/wiki/Dekker's_algorithm)
    between the two processors.

    Before handing off the system to the IA processor, SCU must set up three
    housekeeping mutex variables allocated in the shared SRAM as follows:

    eMMC_Owner = IA (SCU and IA processors - RW, 32bit)
    IA_Req = FALSE (IA -RW, SCU - RO, 32bit)
    SCU_Req = FALSE (IA - RO, SCU - R/W, 32bit)

    There is no hardware based access control to these variables and so code
    executing on SCU and IA processors must follow access rules of
    Dekker's algorithm. Detail info about this algorithm can be found in
    comments and code of this patch.

    Change-Id: Iaa27dcf5eaeaed30348073b041d3268890839a8b
Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
commit 9a8b4cc0bc0908006c566fd21c927fdc191fb185
Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date:   Thu Mar 3 13:50:02 2011 +0800

    mmc: use emmc mutex api to protect emmc

    Apply the eMMC mutext APIs to protect the critical sections of
    eMMC0 host controller opeartions on Medfield platform.

    Change-Id: I2ff82ab66c05f56b16c50431e27f78c8ee5cfa0b
Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Change-Id: I670b72c18c2bdac4e6165b82f5f60084b1809aa9
Signed-off-by: Fei Yang <fei.yang@yahoo.com>
13 years agommc: mmc_test: avoid stalled file in debugfs
Andy Shevchenko [Fri, 22 Jul 2011 13:13:36 +0000 (16:13 +0300)]
mmc: mmc_test: avoid stalled file in debugfs

During card removal and inserting cycle the test file in the debugfs could be
stalled until the host driver removes it. Let's keep the file in the linked
list and destroy it when card is removed.

Change-Id: I9a8340a2b38ffa9afa3086b0a36c5e75434a16e2
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Per Forlin <per.forlin@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: mmc_test: add debugfs file to list all tests
Per Forlin [Fri, 1 Jul 2011 16:55:25 +0000 (18:55 +0200)]
mmc: mmc_test: add debugfs file to list all tests

Add a debugfs file "testlist" to print all available tests.

Change-Id: I899def93bf537b75748aecc40088c7f8b14b6e7b
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar<sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: mmc_test: test to measure how sg_len affect performance
Per Forlin [Fri, 1 Jul 2011 16:55:27 +0000 (18:55 +0200)]
mmc: mmc_test: test to measure how sg_len affect performance

Add a test that measures how the mmc bandwidth depends on the numbers of
sg elements in the sg list. The transfer size if fixed and sg length goes
from a few up to 512. The purpose is to measure overhead caused by
multiple sg elements.

Change-Id: I8cbe352653938bc36a9d40863fe8a7b98ca06b93
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: mmc_test: add test for non-blocking transfers
Per Forlin [Fri, 1 Jul 2011 16:55:26 +0000 (18:55 +0200)]
mmc: mmc_test: add test for non-blocking transfers

Add four tests for read and write performance per
different transfer size, 4k to 4M.
 * Read using blocking mmc request
 * Read using non-blocking mmc request
 * Write using blocking mmc request
 * Write using non-blocking mmc request

The host driver must support pre_req() and post_req()
in order to run the non-blocking test cases.

Change-Id: Ief4ec9607d09659acce7ce30e0d13378576f2c11
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar<sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: core: use defined R1_STATE_PRG macro for card status
Jaehoon Chung [Wed, 10 Aug 2011 09:46:28 +0000 (18:46 +0900)]
mmc: core: use defined R1_STATE_PRG macro for card status

Change-Id: I8d6b242cb324c6fa83b289cbdd4dd4d66fdd0836
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: core: Detect eMMC v4.5 ext_csd entries
Kyungmin Park [Tue, 26 Jul 2011 08:12:37 +0000 (17:12 +0900)]
mmc: core: Detect eMMC v4.5 ext_csd entries

The eMMC v4.5 Spec is released now:

EXT_CSD_REV Extended CSD Revision
255-7 Reserved
6 Revision 1.6 (for MMC v4.5)
5 Revision 1.5 (for MMV v4.41)
...

Change-Id: I24f84b7bea41ffc480c3fbce1960fc1a97eedd75
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agonotifiers: pm: move pm notifiers into suspend.h
Amerigo Wang [Tue, 26 Jul 2011 00:13:11 +0000 (17:13 -0700)]
notifiers: pm: move pm notifiers into suspend.h

It is not necessary to share the same notifier.h.

Change-Id: Icb098842df77e217d15cb4609e181ad9945983ff
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agommc: print debug messages for runtime PM actions
Daniel Drake [Sun, 17 Jul 2011 15:38:41 +0000 (16:38 +0100)]
mmc: print debug messages for runtime PM actions

At http://www.mail-archive.com/linux-mmc@vger.kernel.org/msg08371.html
(thread: "mmc: sdio: reset card during power_restore") we found and
fixed a bug where mmc's runtime power management functions were not being
called. We have now also made improvements to the SDIO powerup routine
which could possibly mask this kind of issue in future.

Add debug messages to the runtime PM hooks so that it is easy to verify
if and when runtime PM is happening.

Change-Id: I563bcd5b7f9902b1ec54ad6d1d44af58c416b039
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: fix runtime PM with -ENOSYS suspend case
Ohad Ben-Cohen [Sun, 17 Jul 2011 15:38:21 +0000 (16:38 +0100)]
mmc: fix runtime PM with -ENOSYS suspend case

In the case where a driver returns -ENOSYS from its suspend handler
to indicate that the device should be powered down over suspend, the
remove routine of the driver was not being called, leading to lots of
confusion during resume.

The problem is that runtime PM is disabled during this process,
and when we reach mmc_sdio_remove, calling the runtime PM functions here
(validly) return errors, and this was causing us to skip the remove
function.

Fix this by ignoring the error value of pm_runtime_get_sync(), which
can return valid errors. This also matches the behaviour of
pci_device_remove().

Change-Id: I4309732b25ae3c4d4c45a141d520abac7c899241
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: fixed NULL pointer dereference
Jaehoon Chung [Wed, 13 Jul 2011 08:02:16 +0000 (17:02 +0900)]
mmc: block: fixed NULL pointer dereference

We already check for ongoing async transfers when handling discard
requests, but not in mmc_blk_issue_flush().  This patch fixes that
omission.

Tested with an SDHCI controller and eMMC4.41.

Change-Id: I514b79abcbe91a23311a7b8a4ea08dfdf02f03c8
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Per Forlin <per.forlin@linaro.org>
Cc: <stable@kernel.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: core: Set non-default Drive Strength via platform hook
Philip Rakity [Wed, 6 Jul 2011 15:51:32 +0000 (08:51 -0700)]
mmc: core: Set non-default Drive Strength via platform hook

Non default Drive Strength cannot be set automatically.  It is a function
of the board design and only if there is a specific platform handler can
it be set.  The platform handler needs to take into account the board
design.  Pass to the platform code the necessary information.

For example:  The card and host controller may indicate they support HIGH
and LOW drive strength.  There is no way to know what should be chosen
without specific board knowledge.  Setting HIGH may lead to reflections
and setting LOW may not suffice.  There is no mechanism (like ethernet
duplex or speed pulses) to determine what should be done automatically.

If no platform handler is defined -- use the default value.

Change-Id: I76b34da2a62d6c3fe307ac92f241ead2f98d4950
Signed-off-by: Philip Rakity <prakity@marvell.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: add handling for two parallel block requests in issue_rw_rq
Per Forlin [Fri, 1 Jul 2011 16:55:33 +0000 (18:55 +0200)]
mmc: block: add handling for two parallel block requests in issue_rw_rq

Change mmc_blk_issue_rw_rq() to become asynchronous.
The execution flow looks like this:

* The mmc-queue calls issue_rw_rq(), which sends the request
  to the host and returns back to the mmc-queue.
* The mmc-queue calls issue_rw_rq() again with a new request.
* This new request is prepared in issue_rw_rq(), then it waits for
  the active request to complete before pushing it to the host.
* When the mmc-queue is empty it will call issue_rw_rq() with a NULL
  req to finish off the active request without starting a new request.

Change-Id: I77a4906a11dddb6570e87b92d048ef209f37fb01
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: queue: add a second mmc queue request member
Per Forlin [Fri, 1 Jul 2011 16:55:31 +0000 (18:55 +0200)]
mmc: queue: add a second mmc queue request member

Add an additional mmc queue request instance to make way for two active
block requests. One request may be active while the other request is
being prepared.

Change-Id: I306d5f0ab4eeac7fbad0e600e131e4862cd24a19
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: move error path in issue_rw_rq to a separate function.
Per Forlin [Fri, 1 Jul 2011 16:55:30 +0000 (18:55 +0200)]
mmc: block: move error path in issue_rw_rq to a separate function.

Break out code without functional changes. This simplifies the code and
makes way for handling two parallel requests.

Change-Id: Ie27ee124fbd933603ebcf59de96ab1798e1ef105
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar<sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: add a block request prepare function
Per Forlin [Fri, 1 Jul 2011 16:55:29 +0000 (18:55 +0200)]
mmc: block: add a block request prepare function

Break out code from mmc_blk_issue_rw_rq to create a block request prepare
function. This doesn't change any functionallity. This helps when handling
more than one active block request.

Change-Id: I8df6f5422cb03a839154680e160f1be86ca10346
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: core: add non-blocking mmc request function
Per Forlin [Fri, 1 Jul 2011 16:55:22 +0000 (18:55 +0200)]
mmc: core: add non-blocking mmc request function

Previously there has only been one function mmc_wait_for_req()
to start and wait for a request. This patch adds:

 * mmc_start_req() - starts a request wihtout waiting
   If there is on ongoing request wait for completion
   of that request and start the new one and return.
   Does not wait for the new command to complete.

This patch also adds new function members in struct mmc_host_ops
only called from core.c:

 * pre_req - asks the host driver to prepare for the next job
 * post_req - asks the host driver to clean up after a completed job

The intention is to use pre_req() and post_req() to do cache maintenance
while a request is active. pre_req() can be called while a request is
active to minimize latency to start next job. post_req() can be used after
the next job is started to clean up the request. This will minimize the
host driver request end latency. post_req() is typically used before
ending the block request and handing over the buffer to the block layer.

Add a host-private member in mmc_data to be used by pre_req to mark the
data. The host driver will then check this mark to see if the data is
prepared or not.

Change-Id: Ifc89392648d50d4616f9ef89372517fb54af2fcb
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: add member in mmc queue struct to hold request data
Per Forlin [Sat, 9 Jul 2011 21:12:36 +0000 (17:12 -0400)]
mmc: block: add member in mmc queue struct to hold request data

The way the request data is organized in the mmc queue struct, it only
allows processing of one request at a time.  This patch adds a new struct
to hold mmc queue request data such as sg list, request, blk request and
bounce buffers, and updates any functions depending on the mmc queue
struct. This prepares for using multiple active requests in one mmc queue.

Change-Id: Ica93d986bfa0671ce9bc3583362ca488859c3770
Signed-off-by: Per Forlin <per.forlin@linaro.org>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Venkatraman S <svenkatr@ti.com>
Tested-by: Sourav Poddar <sourav.poddar@ti.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: add checking of r/w command response
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:49 +0000 (20:10 +0100)]
mmc: block: add checking of r/w command response

Check the status bits in the r/w command response for any errors.
If error bits are set, then we won't have seen any data transferred,
so it's pointless doing any further checking.

Change-Id: Ib4b533ae646db48dbf452b632ca9e4b394f3c73d
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: improve error recovery from command channel errors
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:28 +0000 (20:10 +0100)]
mmc: block: improve error recovery from command channel errors

Command channel errors fall into four classes:

1. The command was issued with the card in the wrong state
2. The command failed to be received by the card correctly
3. The cards response failed to be received by the host (CRC error)
4. The card failed to respond to the card

For (1), in theory we should know that the card is in the correct state.
However, a failed stop command (or other failure) may result in the card
remaining in a data transfer state from the previous command.  If we
detect this condition, we try to recover by sending a stop command.

For the initial commands (set block count and the read/write command)
no data will have been transferred.  All that we need deal with is
retrying at this point.  A failed stop command can be remedied as
above.

If we are unable to recover the card (eg, the card ignores our requests
for status, or we don't recognise the error code) then we immediately
fail the request.

Change-Id: I94d2350be32efad1cdd01b075a598949314c8c55
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: block: allow get_card_status() to return error status
Russell King - ARM Linux [Mon, 20 Jun 2011 19:10:08 +0000 (20:10 +0100)]
mmc: block: allow get_card_status() to return error status

If the MMC_SEND_STATUS command is not successful, we should not return
a zero status word, but instead allow the caller to know positively
that an error occurred.

Convert the open-coded get_card_status() to use the helper function,
and provide definitions for the card state field.

Change-Id: Id6c2809b6e1f1d9ab38238f732d93b060affb5b1
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: queue: let host controllers specify maximum discard timeout
Adrian Hunter [Tue, 28 Jun 2011 14:16:02 +0000 (17:16 +0300)]
mmc: queue: let host controllers specify maximum discard timeout

Some host controllers will not operate without a hardware
timeout that is limited in value.  However large discards
require large timeouts, so there needs to be a way to
specify the maximum discard size.

A host controller driver may now specify the maximum discard
timeout possible so that max_discard_sectors can be calculated.

However, for eMMC when the High Capacity Erase Group Size
is not in use, the timeout calculation depends on clock
rate which may change.  For that case Preferred Erase Size
is used instead.

Change-Id: I3badc5c160cafe8fb7788736ebdd5c21b895e12e
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: Standardize header file inclusion checks.
Robert P. J. Day [Fri, 27 May 2011 20:04:03 +0000 (16:04 -0400)]
mmc: Standardize header file inclusion checks.

Standardize the checks for multiple MMC header file inclusion,
including adding comments to terminating #endif's, and fixing
one incorrect comment.

Change-Id: I9e5ab7eaebc2b26a96087b560bb786c5e7cdae51
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci: don't try to do anything during power off
Andy Shevchenko [Thu, 25 Aug 2011 11:13:49 +0000 (12:13 +0100)]
mmc: sdhci: don't try to do anything during power off

The commit c5d3189 ("sdhci: Add runtime pm support for sdhci-pci") brings
runtime pm support partially. Due to this we could get a traceback:

<2>[    3.954232] kernel BUG at /home/ash/work/linux/drivers/mmc/host/sdhci.c:1155!
<0>[    3.954253] invalid opcode: 0000 [#1] PREEMPT SMP
<4>[    3.954282] Modules linked in:
<4>[    3.954299]
<4>[    3.954316] Pid: 10, comm: kworker/0:1 Not tainted 3.0.0+ #669
<4>[    3.954345] EIP: 0060:[<c12e8f15>] EFLAGS: 00010083 CPU: 0
<4>[    3.954373] EIP is at sdhci_set_power+0x35/0xf0
<4>[    3.954390] EAX: f56607f0 EBX: 00000001 ECX: 00000000 EDX: 00000000
<4>[    3.954410] ESI: f5660698 EDI: f56608b0 EBP: f5c8be8c ESP: f5c8be88
<4>[    3.954430]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
<0>[    3.954451] Process kworker/0:1 (pid: 10, ti=f5c8a000 task=f5c88260 task.ti=f5c8a000)
<0>[    3.954468] Stack:
<4>[    3.954479]  f56607f0 f5c8bea4 c12e9e33 00000286 f56603b0 f5660698 00000000 f5c8bef4
<4>[    3.954531]  c12dbf01 00000002 f5c88260 00000006 f5c8becc c107fc56 f5c88260 c13a5fcd
<4>[    3.954583]  f56605fc f5c8bedc c107fd9c f56605fc 00000282 f5c8bee4 c107fdeb f5c8bef4
<0>[    3.954635] Call Trace:
<4>[    3.954660]  [<c12e9e33>] sdhci_set_ios+0x1d3/0x370
<4>[    3.954687]  [<c12dbf01>] mmc_gate_clock+0x71/0x120
<4>[    3.954712]  [<c107fc56>] ? mark_held_locks+0x56/0x80
<4>[    3.954739]  [<c13a5fcd>] ? _raw_spin_unlock_irqrestore+0x4d/0x60
<4>[    3.954763]  [<c107fd9c>] ? trace_hardirqs_on_caller+0x11c/0x160
<4>[    3.954787]  [<c107fdeb>] ? trace_hardirqs_on+0xb/0x10
<4>[    3.954813]  [<c12dd816>] mmc_host_clk_gate_delayed+0xd6/0x150
<4>[    3.954840]  [<c105f93a>] ? process_one_work+0xfa/0x550
<4>[    3.954866]  [<c12dd89d>] mmc_host_clk_gate_work+0xd/0x10
<4>[    3.954891]  [<c105f9b6>] process_one_work+0x176/0x550
<4>[    3.954915]  [<c105f93a>] ? process_one_work+0xfa/0x550
<4>[    3.954940]  [<c12dd890>] ? mmc_host_clk_gate_delayed+0x150/0x150
<4>[    3.954966]  [<c1061c2a>] worker_thread+0x12a/0x2c0
<4>[    3.954990]  [<c1061b00>] ? manage_workers.clone.18+0x100/0x100
<4>[    3.955015]  [<c1066244>] kthread+0x74/0x80
<4>[    3.955040]  [<c10661d0>] ? __init_kthread_worker+0x60/0x60
<4>[    3.955066]  [<c13a707a>] kernel_thread_helper+0x6/0xd
<0>[    3.955080] Code: 74 5c bb 01 00 00 00 d3 e3 81 fb 00 00 04 00 74 31 7e 1b 81 fb 00 00 10 00 0f 84 b7 00 00 00 81 fb 00 00 20 00 0f 84 ab 00 00 00 <0f> 0b 90 81 fb 80 00 00 00 0f 84 94 00 00 00 81 fb 00 00 02 00
<0>[    3.955377] EIP: [<c12e8f15>] sdhci_set_power+0x35/0xf0 SS:ESP 0068:f5c8be88

The patch corrects logic of the sdhci_set_ios() in case of clock = 0
(asynchronous power off).

Change-Id: If58b8d20f8d6ce001d316da323dcf17d681ff912
Reported-by: Alexander Shishin <alexander.shishkin@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
13 years agosdhci: correct clk_gate runtime_pm init
Pierre Tardy [Thu, 25 Aug 2011 11:13:29 +0000 (12:13 +0100)]
sdhci: correct clk_gate runtime_pm init

at init, the default state of mmc_clkgate fw is clock not gate
So at boot, set_ios is not ensured to be called with ios->clock!=0
This may result to fabric errors at boot.

Correct this by setting the default host->iosclock to !=0
and taking a runtime_pm ref counter at init.

Change-Id: I32e8f31861b268d17047ca15eea45044b635a4bc
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
13 years agosdhci: Add runtime pm support for sdhci-pci
Kristen Carlson Accardi [Thu, 25 Aug 2011 11:12:47 +0000 (12:12 +0100)]
sdhci: Add runtime pm support for sdhci-pci

Ported the parts that were not upstream from the mrst kernel.

Change-Id: I78ada0b020c11376e09120236fc8bbec92d036ea
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
13 years agommc: sdhci: use f_max instead of host->clock for timeouts
Andy Shevchenko [Wed, 3 Aug 2011 15:36:01 +0000 (18:36 +0300)]
mmc: sdhci: use f_max instead of host->clock for timeouts

When timeout_clk is calculated the host->clock could be zero.
So, instead of host->clock the calculation now uses mmc->f_max.

Change-Id: I7f69c4506df90de4f661443403774f259bea8201
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci: move timeout_clk calculation farther down
Andy Shevchenko [Wed, 3 Aug 2011 15:36:00 +0000 (18:36 +0300)]
mmc: sdhci: move timeout_clk calculation farther down

This moves the calculation below the assignment of mmc->f_max, which
we need for calculating timeout_clk in the next patch in this series.

Change-Id: I5392567df246e7519184d71c868f392284c38c2d
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci: check host->clock before using it as a denominator
Andy Shevchenko [Wed, 3 Aug 2011 15:35:59 +0000 (18:35 +0300)]
mmc: sdhci: check host->clock before using it as a denominator

Sometimes host->clock could be zero which is a legal situation. This
patch checks host->clock before usage as a denominator when timeout is
calculated. A similar patch is applied for mmc core (see commit e9b8684,
"mmc: fix division by zero in MMC core").

Without this patch, the execution of the sdhci_calc_timeout could end up
with a backtrace:

<0>[    4.014319] divide error: 0000 [#1] PREEMPT SMP
<4>[    4.014352] Modules linked in: g_ether
<4>[    4.014376]
<4>[    4.014393] Pid: 33, comm: kworker/u:2 Not tainted 3.0.0+ #646
<4>[    4.014421] EIP: 0060:[<c12fa38e>] EFLAGS: 00010046 CPU: 1
<4>[    4.014449] EIP is at sdhci_calc_timeout+0x2e/0x100
<4>[    4.014468] EAX: 00000000 EBX: f5930fc8 ECX: 00000000 EDX: 00000000
<4>[    4.014488] ESI: f5291de8 EDI: f5291db8 EBP: f5291c6c ESP: f5291c50
<4>[    4.014508]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
<0>[    4.014529] Process kworker/u:2 (pid: 33, ti=f5290000 task=f53065a0 task.ti=f5290000)
<0>[    4.014546] Stack:
<4>[    4.014557]  00000082 c1054fdd f5291c78 04000000 f5930fc8 f5291de8 f5291db8 f5291cac
<4>[    4.014611]  c12fab7c c107a98b f5291c88 c13b6d3f f593109c f5882000 f5291cac c1054fdd
<4>[    4.014663]  00000000 00000000 f5882000 00000082 f5930fc8 f5291db8 0000000a f5291ccc
<0>[    4.014716] Call Trace:
<4>[    4.014743]  [<c1054fdd>] ? mod_timer+0x11d/0x380
<4>[    4.014770]  [<c12fab7c>] sdhci_prepare_data+0x2c/0x3a0
<4>[    4.014798]  [<c107a98b>] ? trace_hardirqs_off+0xb/0x10
<4>[    4.014827]  [<c13b6d3f>] ? _raw_spin_unlock_irqrestore+0x2f/0x60
<4>[    4.014854]  [<c1054fdd>] ? mod_timer+0x11d/0x380
<4>[    4.014880]  [<c12fc7db>] sdhci_send_command+0xdb/0x210
<4>[    4.014906]  [<c12fd5f3>] sdhci_request+0xc3/0x150
<4>[    4.014932]  [<c12ec56a>] mmc_start_request+0xda/0x200
<4>[    4.014960]  [<c120d7c2>] ? __raw_spin_lock_init+0x32/0x60
<4>[    4.014989]  [<c1066a85>] ? __init_waitqueue_head+0x35/0x50
<4>[    4.015015]  [<c12ec70b>] mmc_wait_for_req+0x7b/0x90
<4>[    4.015045]  [<c12f0c67>] mmc_send_cxd_data+0xf7/0x130
<4>[    4.015076]  [<c12ecbc0>] ? mmc_erase+0x140/0x140
<4>[    4.015102]  [<c12f139d>] mmc_send_ext_csd+0x1d/0x20
<4>[    4.015125]  [<c12efef0>] mmc_get_ext_csd+0x70/0x140
<4>[    4.015151]  [<c12effe8>] mmc_compare_ext_csds+0x28/0x190
<4>[    4.015176]  [<c12f039f>] mmc_init_card+0x24f/0x650
<4>[    4.015201]  [<c13b6d5d>] ? _raw_spin_unlock_irqrestore+0x4d/0x60
<4>[    4.015226]  [<c107fd9c>] ? trace_hardirqs_on_caller+0x11c/0x160
<4>[    4.015255]  [<c12f09a4>] mmc_attach_mmc+0xa4/0x190
<4>[    4.015282]  [<c12ee3f0>] mmc_rescan+0x210/0x240
<4>[    4.015311]  [<c105f9b6>] process_one_work+0x176/0x550
<4>[    4.015336]  [<c105f93a>] ? process_one_work+0xfa/0x550
<4>[    4.015360]  [<c12ee1e0>] ? mmc_init_erase+0x140/0x140
<4>[    4.015385]  [<c1061c2a>] worker_thread+0x12a/0x2c0
<4>[    4.015410]  [<c1061b00>] ? manage_workers.clone.18+0x100/0x100
<4>[    4.015437]  [<c1066244>] kthread+0x74/0x80
<4>[    4.015463]  [<c10661d0>] ? __init_kthread_worker+0x60/0x60
<4>[    4.015490]  [<c13b7dfa>] kernel_thread_helper+0x6/0xd
<0>[    4.015507] Code: 57 89 d7 56 53 89 c3 83 ec 10 8b 40 04 8b 72 28 f6 c4 10 89 45 f0 0f 85 91 00 00 00 85 f6 0f 84 c1 00 00 00 8b 4e 04 31 d2 89 c8 <f7> 73 58 ba d3 4d 62 10 89 c1 8b 06 f7 e2 c1 ea 06 01 d1 f7 45
<0>[    4.015829] EIP: [<c12fa38e>] sdhci_calc_timeout+0x2e/0x100 SS:ESP 0068:f5291c50

Change-Id: I55ff5e66a7a58c85615226ba5f41c374bc65ae42
Reported-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"
Andy Shevchenko [Wed, 3 Aug 2011 15:35:58 +0000 (18:35 +0300)]
mmc: Revert "mmc: sdhci: Fix SDHCI_QUIRK_TIMEOUT_USES_SDCLK"

This reverts commit 4b01681c7764, which introduced a new potential
divide by zero in the process of fixing one.  The subsequent commits
attempt to fix the issue properly.

Change-Id: I7317a5e43dca24b9f7829e7e8d2afe2fb2823d0d
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs
Adrian Hunter [Wed, 29 Jun 2011 11:23:47 +0000 (14:23 +0300)]
mmc: sdhci-pci: allow 8-bit bus width for Intel Medfield eMMCs

Unless MMC_CAP_8_BIT_DATA is set, the bus width defaults to 4.

Change-Id: Iec2df14ed23d433f71eac8152c0a9c865e2cc2cf
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci-pci: add 8-bit bus width support for mrst hc0
Major Lee [Wed, 29 Jun 2011 11:23:46 +0000 (14:23 +0300)]
mmc: sdhci-pci: add 8-bit bus width support for mrst hc0

And hook platform_8bit_width to support 8-bit bus width.

Change-Id: I894565bb280be251a1a1998a555b25ef9b91268f
Signed-off-by: Major Lee <major_lee@wistron.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci: specify maximum discard timeout
Adrian Hunter [Tue, 28 Jun 2011 14:16:03 +0000 (17:16 +0300)]
mmc: sdhci: specify maximum discard timeout

In general, SDHC hardware timeout cannot be avoided.
Accordingly, the maximum timeout is specified to limit
the maximum discard size.

Change-Id: Id51635ccf890fd9a1558cff58ac39fbb79e3cee1
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agommc: sdhci: fix interrupt storm from card detection
Shawn Guo [Tue, 21 Jun 2011 14:41:48 +0000 (22:41 +0800)]
mmc: sdhci: fix interrupt storm from card detection

The issue was initially found by Eric Benard as below.

http://permalink.gmane.org/gmane.linux.ports.arm.kernel/108031

Not sure about other SDHCI based controller, but on Freescale eSDHC,
the SDHCI_INT_CARD_INSERT bits will be immediately set again when it
gets cleared, if a card is inserted. The driver need to mask the irq
to prevent interrupt storm which will freeze the system.  And the
SDHCI_INT_CARD_REMOVE gets the same situation.

The patch fixes the problem based on the initial idea from
Eric Benard.

Change-Id: Ibcb5031c1c751da98bb6744c71240a0d984cab4d
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Eric Benard <eric@eukrea.com>
Tested-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
13 years agousb-gadget: fix build error
Fengwei Yin [Mon, 19 Sep 2011 06:38:15 +0000 (14:38 +0800)]
usb-gadget: fix build error

Change-Id: If7c07fa8d790a109a8f7c1c8bd4a17b16d75a31d

13 years agousb: gadget: Add host_request_flag for hnp polling
Hao Wu [Fri, 26 Aug 2011 10:55:05 +0000 (11:55 +0100)]
usb: gadget: Add host_request_flag for hnp polling

HNP polling is a new feature from USB OTG 2.0 spec, OTG host will
poll the host request flag from the OTG device side using get_status().
This patch add one member in usb_gadget data structure for this purpose.

Change-Id: Ica076eaf0b2635bfe00e666c266c4db9590a4592
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agopenwell_otg: fix typo
Kristen Carlson Accardi [Fri, 26 Aug 2011 10:55:07 +0000 (11:55 +0100)]
penwell_otg: fix typo

just because it bugged me.

Change-Id: I9a713227e8a1390e08aaf667bc6e3063cc861645
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: penwell_otg: Enable hnp polling
Hao Wu [Fri, 26 Aug 2011 10:55:06 +0000 (11:55 +0100)]
usb: penwell_otg: Enable hnp polling

This patch only enables basic HNP function on penwell back-to-back
case. This driver is still in development and not enough OTG Spec
compliance test was done due to no OPT currently, but more work on
it in next step.

Change-Id: I93f0915b42429cb8f16437ad2bc762fb5e1d58f7
Signed-off-by: Hao Wu <hao.wu@intel.com>
[Added bug fixes from Hao Wu]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: penwell_otg: Add hnp polling support
Hao Wu [Fri, 26 Aug 2011 10:55:06 +0000 (11:55 +0100)]
usb: penwell_otg: Add hnp polling support

Add HNP polling support in penwell_otg transceiver driver.

Change-Id: I42206a88982b211e25af7f6842f7ba86bbd17577
Signed-off-by: Hao Wu <hao.wu@intel.com>
[Reapplied by hand due to other changes]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: penwell_otg: Add srp support
Hao Wu [Fri, 26 Aug 2011 10:55:05 +0000 (11:55 +0100)]
usb: penwell_otg: Add srp support

This penwell_otg transceiver driver patch enables
MFLD USB OTG SRP function per OTG 2.0 spec requirement.

Change-Id: I647ac2a88b24f81835a936cc55de25037141bf3b
Signed-off-by: Hao Wu <hao.wu@intel.com>
[Removed unnecessary bus polling]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: penwell_otg: Fix usb interrupt issue
Hao Wu [Fri, 26 Aug 2011 10:55:05 +0000 (11:55 +0100)]
usb: penwell_otg: Fix usb interrupt issue

This patch clears PHCD bit (set PHY into normal mode) before driver starts to
do something on controller. The reason is that bootloader may set PHY into Low
power mode, if initialize controller with PHY in Low power mode, will cause
unexpected behavior on usb controller.

Change-Id: Iaab7b1ebecea46b6ee6b4da5975d9604a3cd49d8
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoThis adds current_event variable to the struct otg_bc_cap. The current_event allows...
Hao Wu [Thu, 25 Aug 2011 11:20:35 +0000 (12:20 +0100)]
This adds current_event variable to the struct otg_bc_cap. The current_event allows the battery driver to read the event even after the bc_callback() is called.

Change-Id: Id6a7c412d769bc9bcc6c0358838a9a4e13e588db
Signed-off-by: Hao Wu <hao.wu@intel.com>
[Rewrote the commit message]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: penwell_otg: add runtime pm support
Hao Wu [Thu, 25 Aug 2011 11:20:35 +0000 (12:20 +0100)]
usb: penwell_otg: add runtime pm support

Add runtime pm support in penwell_otg transceiver driver.

Change-Id: I30f9bbb33efb3a0a6d8e313c6dd6dfefe656c3a8
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: penwell_otg: add charging current negotiation and notification support
Hao Wu [Thu, 25 Aug 2011 11:20:35 +0000 (12:20 +0100)]
usb: penwell_otg: add charging current negotiation and notification support

This patch adds charging current negotiation in Transceiver driver for
SDP/CDP/DCP cases and it also provides notification/query interfaces to
Battery driver for charging current information notification.

*It requires device controller/gadget driver modification to fully
support SDP/CDP cases.

Change-Id: I2d7db99bf16423d308a738bdc25206d9a90e2db4
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: penwell_otg: add USB charger detection
Hao Wu [Thu, 25 Aug 2011 11:20:35 +0000 (12:20 +0100)]
usb: penwell_otg: add USB charger detection

This patch enables penwell USB OTG Transceiver driver USB Charger Detection
support. It can detect different types of USB charger based on MSIC.
SDP (Standard Downstream Port - USB Host port charger), DCP (Dedicated
Charging Port - USB Wall charger), CDP (Charging Downstream Port - Special
USB Host port charger).

Change-Id: I34009bb775bba53357f91a23c9190317d69d3654
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: penwell_otg: Add Intel Penwell USB OTG Transceiver driver
Hao Wu [Thu, 25 Aug 2011 11:20:34 +0000 (12:20 +0100)]
usb: penwell_otg: Add Intel Penwell USB OTG Transceiver driver

Description
  This driver tries to implement host/device role switch according to
  OTG 2.0 spec on MFLD. The actual host and device functions are
  accomplished in modified EHCI driver and Intel Penwell USB OTG device
  controller driver. This is the first version and it only support Host
  Peripheral role switch per different USB cable. Development work is
  still on going, more features will be submitted soon after verified.

Dependency
  CONFIG_INTEL_SCU_IPC - IPC driver.

Enable driver in Kernel
  "Device Drivers"  --->  "USB support"  --->
          "Intel Penwell USB OTG dual-role support"

Kernel configs
  CONFIG_INTEL_SCU_IPC=y
  CONFIG_USB=y
  CONFIG_USB_OTG=y
  CONFIG_USB_OTG_UTILS=y
  CONFIG_PENWELL_OTG=y

Todo List
  USB Charging Support
  Power management (runtime)
  MHL-USB coexistence
  HNP/HNP Polling/SRP
  ADP(Attach Detection Protocol) Support

Change-Id: Ie9daf11fc21f03be659ed6c8992a4ac904421e0f
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: Add hnp polling support
Hao Wu [Fri, 26 Aug 2011 10:55:05 +0000 (11:55 +0100)]
usb: langwell_udc: Add hnp polling support

This patch adds get_status support for HNP polling in langwell_udc.

Change-Id: Ia700cb6a64d3c428de2fdd047960be6c98c1736b
Signed-off-by: Hao Wu <hao.wu@intel.com>
[Reapplied by hand due to other changes]
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agousb: langwell_udc: Init SRAM on S0i3 resume
Sundar Iyer [Thu, 25 Aug 2011 11:20:34 +0000 (12:20 +0100)]
usb: langwell_udc: Init SRAM on S0i3 resume

On an exit from S0i3, the USB stack tries to access the SRAM
without initializing. Add SRAM initialization code to avoid
ECC error. This patch is for langwell_udc controller driver.

Change-Id: I92c80eed95094706020b8659a3db6585bdd8fca3
Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: Fix max packet size calculations
JiebingLi [Thu, 25 Aug 2011 11:20:34 +0000 (12:20 +0100)]
usb: langwell_udc: Fix max packet size calculations

This patch is used to fix max packet size issue in langwell_udc
controller driver.  As max packct size is 1024 for ISO transfer, 0x7ff
(bit 0~10) should be used to compute the value. If 0x8ff is used, the
value may be wrongly set as 0 instead of 1024 or 512.

Change-Id: Ic78105f17d949d98c6f3c1667b0bac2c0fb8ae6c
Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: cancel pending requests when controller is suspended.
Philippe Skowronski [Thu, 25 Aug 2011 11:20:33 +0000 (12:20 +0100)]
usb: langwell_udc: cancel pending requests when controller is suspended.

It is safer to cancel pending requests before free dTD and dQH when
controller enters suspend state.

Change-Id: I5cb342093934af111ce70911908f492914c3001e
Signed-off-by: Philippe Skowronski <philippe.skowronski@intel.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb/gadget/langwell: do not hold spin_lock when sleep
Jacob Pan [Thu, 25 Aug 2011 11:20:33 +0000 (12:20 +0100)]
usb/gadget/langwell: do not hold spin_lock when sleep

Use GFP_ATOMIC to avoid going to sleep while holding spin_lock.
Fix based on following call trace.
[  443.445677]  [<c102a8e8>] __might_sleep+0xf7/0xff
[  443.445677]  [<c10bca9b>] dma_pool_alloc+0x27/0x2ec
[  443.445677]  [<c12e4346>] ? langwell_ep_queue+0x1eb/0x25a
[  443.445677]  [<c12e4346>] ? langwell_ep_queue+0x1eb/0x25a
[  443.445677]  [<c12e3bd9>] req_to_dtd+0x37/0x10e
[  443.445677]  [<c14d08bd>] ? _raw_spin_lock_irqsave+0x35/0x3e
[  443.445677]  [<c12e4350>] langwell_ep_queue+0x1f5/0x25a

Change-Id: I6f15cf806444caaf8ddef8b899c083445eb24345
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: add HighSpeed/FullSpeed events notification
Hao Wu [Thu, 25 Aug 2011 11:20:33 +0000 (12:20 +0100)]
usb: langwell_udc: add HighSpeed/FullSpeed events notification

It adds notification to Intel Penwell otg transceiver driver for
HighSpeed/FullSpeed. This change mainly to support battery charging
current negotiation for Charging Downstream Port(CDP) case. USB OTG
Transceiver driver will notify battery driver about charging current
limitation change according to different Speed Mode (HS/FS).

Change-Id: Icc7f8004b8173cd74ae78d5fce90d3c57e94a847
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: fixup missing size field for non transceiver build
Alan Cox [Thu, 25 Aug 2011 11:20:32 +0000 (12:20 +0100)]
usb: fixup missing size field for non transceiver build

Change-Id: I62a1f2ba9c8d1934f44d24c4a65c8d4e496aa91b
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: set vbus_active flag according to state
Hao Wu [Thu, 25 Aug 2011 11:20:32 +0000 (12:20 +0100)]
usb: langwell_udc: set vbus_active flag according to state

This patch adds active bit setting in order to avoid issues
with composite gadget on pullup functions which query on this
bit.

Change-Id: I063bcd6021b2b322854d6e94e850c5fae6266b28
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: enable PHY Low Power Mode for Penwell
Jiebing Li [Thu, 25 Aug 2011 11:20:32 +0000 (12:20 +0100)]
usb: langwell_udc: enable PHY Low Power Mode for Penwell

This patch enables PHY Low Power mode to save power for Penwell case.

Change-Id: I2be3d772742de926c0791ec50d0c7d9c2f43a4d5
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: langwell_udc: add Intel Penwell USB Device Controller support
Jiebing Li [Thu, 25 Aug 2011 11:20:07 +0000 (12:20 +0100)]
usb: langwell_udc: add Intel Penwell USB Device Controller support

Add Intel Penwell USB Device Controller Support in langwell_udc driver.
This driver will support both langwell/penwell USB Device controller with
this patch.

Change-Id: I50534ac35bc666849db6712eeeb943bd6bf27311
Signed-off-by: JiebingLi <jiebing.li@intel.com>
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: gadget: fix up depencies
Sebastian Andrzej Siewior [Tue, 5 Jul 2011 13:39:48 +0000 (16:39 +0300)]
usb: gadget: fix up depencies

Both fusb300 and langwell udcs seem to only
work with 32-bit address space.

Change-Id: I3d7517574564356bddfde9a25877f594c37cc02c
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: gadget: allow multiple gadgets to be built
Fengwei Yin [Thu, 15 Sep 2011 07:44:14 +0000 (15:44 +0800)]
usb: gadget: allow multiple gadgets to be built

ported from AC tree: 193ab2a6070039e7ee2b9b9bebea754a7c52fd1b

Change-Id: Id5b4330c47ed0796a4421d596de82b63a663de52

13 years agousb: langwell_udc: use common OTG data structure for Intel MID platform
Hao Wu [Thu, 25 Aug 2011 11:18:45 +0000 (12:18 +0100)]
usb: langwell_udc: use common OTG data structure for Intel MID platform

This patch provided the support to common OTG data structure.

Main changes:
- Notify otg related events using notifier and remove direct
  access to otg data structure(state machine).
- Provide start_peripheral/stop_peripheral function to transceiver.
- Provide client register/unregister function.

  modified:   drivers/usb/gadget/langwell_udc.c
  modified:   drivers/usb/gadget/langwell_udc.h

Change-Id: Icfa1f5171a2459fe7d9098c842777b488bf48aaa
Signed-off-by: Hao Wu <hao.wu@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
13 years agousb: gadget: langwell_udc: fix compile warnings
Felipe Balbi [Mon, 4 Jul 2011 08:12:32 +0000 (11:12 +0300)]
usb: gadget: langwell_udc: fix compile warnings

This patch fixes the following compile warnings:

drivers/usb/gadget/langwell_udc.c: In function â€˜queue_dtd’:
drivers/usb/gadget/langwell_udc.c:596:2: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
drivers/usb/gadget/langwell_udc.c: In function â€˜langwell_udc_probe’:
drivers/usb/gadget/langwell_udc.c:3274:2: warning: format â€˜%d’ expects argument of type â€˜int’, but argument 4 has type â€˜size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3289:2: warning: format â€˜%d’ expects argument of type â€˜int’, but argument 4 has type â€˜size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c: In function â€˜langwell_udc_resume’:
drivers/usb/gadget/langwell_udc.c:3473:2: warning: format â€˜%d’ expects argument of type â€˜int’, but argument 4 has type â€˜size_t’ [-Wformat]
drivers/usb/gadget/langwell_udc.c:3487:2: warning: format â€˜%d’ expects argument of type â€˜int’, but argument 4 has type â€˜size_t’ [-Wformat]

Change-Id: I84e4ed2a9a084994582836cb92827b02b6537c1a
Signed-off-by: Felipe Balbi <balbi@ti.com>
13 years agousb: gadget: convert all users to the new udc infrastructure
Sebastian Andrzej Siewior [Tue, 28 Jun 2011 13:33:47 +0000 (16:33 +0300)]
usb: gadget: convert all users to the new udc infrastructure

peripheral drivers are using usb_add_gadget()/usb_del_gadget() to
register/unregister to the udc-core.

The udc-core will take the first available gadget driver and attach
function driver which is calling usb_gadget_register_driver(). This is
the same behaviour we have right now.

Only dummy_hcd was tested, the others were compiled tested.

Change-Id: I8f38315183c262e4697ce50f9965074092a64fb0
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Dan Carpenter <error27@gmail.com>
Cc: Darius Augulis <augulis.darius@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Roy Huang <roy.huang@analog.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Toshiharu Okada <toshiharu-linux@dsn.okisemi.com>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Cc: Yuan-Hsin Chen <yhchen@faraday-tech.com>
Cc: cxie4 <cxie4@marvell.com>
Cc: linux-geode@lists.infradead.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agousb: gadget: introduce UDC Class
Felipe Balbi [Tue, 28 Jun 2011 13:33:46 +0000 (16:33 +0300)]
usb: gadget: introduce UDC Class

this class will be used to abstract away several of the duplicated
operations scattered among the USB gadget controller drivers.

Later, we can add an atomic notifier to tell interested drivers about
what's happening with the controller. Notifications such as suspend,
resume, enumerated, etc. will be useful, at a minimum, for implementing
usb charger detection.

As part of the converting process usb_gadget_probe_driver() is no longer
part of each udc but pushed into the ->stap() callback. The same for his
couterpart.

The core is currently set explicit to 'n'. It will be changed to 'y' once
all users are converted since it provides functions which clash with
other drivers.

Change-Id: I7ea32afc0dafbd35d2c56e79ac631fcb6b52239d
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agolinux-2.6.36-intel-scu-ipcutil-allow-ipcutil-compile-as-module.patch
Fei Yang [Mon, 12 Sep 2011 22:01:37 +0000 (15:01 -0700)]
linux-2.6.36-intel-scu-ipcutil-allow-ipcutil-compile-as-module.patch

Change-Id: I168b5e7d3d6df31908a2edfaa821815b6dbe8bae
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agoIPC: Fix merge problems.
Fei Yang [Mon, 12 Sep 2011 21:54:45 +0000 (14:54 -0700)]
IPC: Fix merge problems.

The latest version in 2.6.35 tree is using if-else statement in function
scu_ipc_ioctl, however in AC tree switch-case statement is used instead,
need to add break instruction accordingly.
Also CPU type checking is introduced in 2.6.35 tree, need to merge that
change for INTEL_SCU_IPC_FW_UPDATE.
In Linux 3.0 pm_qos_add_request doesn't allocate memory any more, the
function requires a pre-allocated struct pm_qos_request_list. make change
in intel_scu_ipc_init accordingly.

Change-Id: Ia36a46030f52ad3f68c0c8e9d101bb049460e2ec
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agoAdd MIP header update when FW is upgraded
jianwei.yang [Wed, 15 Sep 2010 14:40:47 +0000 (16:40 +0200)]
Add MIP header update when FW is upgraded

The MIP header will also be updated when FW is upgraded through loadfw

Change-Id: I19bd38068cfea8bcbc8504b00e99a3e902634ff7
Signed-off-by: jianwei.yang <jianwei.yang@intel.com>
13 years agointel_scu_ipc: Drop to C6s0i0 when there is IPC communication ongoing
Samu Onkalo [Fri, 2 Sep 2011 12:01:08 +0000 (15:01 +0300)]
intel_scu_ipc: Drop to C6s0i0 when there is IPC communication ongoing

BZ: 8911

When a IPC command is issued the IPC driver waits for the completion
interrupt from the SCU by issuing a wait_for_competion_timeout API
this causes the IPC driver to sleep, invoking idle process, which then
triggers S0ix, this causes the SCU to disable the interrupts and the
pending IPC completion interrupt is never delivered this causes
IPC timeout to occur.

Fixed this by not doing S0ix by using PM Qos which prevents any deeper
than C6 states from happening. This restrictioin is removed once the
IPC command completes.

Change-Id: I97136b131c1d6019e505e1ab97ec67cec1a473d9
Signed-off-by: Samu Onkalo <samu.onkalo@intel.com>
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
Signed-off-by: Marie-Celine Dubut <marie.celinex.dubut@intel.com>
Reviewed-on: http://android.intel.com:8080/17210

13 years agoipc: upgrade ifwi at reboot
Bin Yang [Wed, 24 Aug 2011 09:24:34 +0000 (17:24 +0800)]
ipc: upgrade ifwi at reboot

BZ:  5466

SCU FW has a limitation, that it cannot support any IPC
command after ifwi upgrading except for reboot. And it is
a risk to continue run kernel and SCU after ifwi upgrading.

After discussing with Pierre, we have this solution to upgrade
ifwi right before reboot.

This patch support to prepare for ifwi upgrading at kernel
runtime, then kick off the real upgrading at the end of system
reboot.

Change-Id: I3d4f5feefe3fbc5863e1a63958d529b040dc6660
Signed-off-by: Bin Yang <bin.yang@intel.com>
13 years agoipc: support to write umip unaligned
Li, Ning [Thu, 18 Aug 2011 07:13:39 +0000 (15:13 +0800)]
ipc: support to write umip unaligned

BZ:  6567

UMIP only supports four bytes aligment access. This patch
helps to read and modify UMIP atomic with unailigned length.

Change-Id: I69b036cce4d5820ba54eb15e03c2fba43a5a9686
Signed-off-by: Bin Yang <bin.yang@intel.com>
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
13 years agoipc: workarround for SCU bug to retry umip/smip cmd
Bin Yang [Tue, 16 Aug 2011 03:43:55 +0000 (11:43 +0800)]
ipc: workarround for SCU bug to retry umip/smip cmd

BZ: 6541

SCU is not a multi thread system. It has design limitation
to implement dekker's algorithm.
If IA is using eMMC, umip/smip command will be failed
immediately. But SCU does not cancel the mutex request.
Then, SCU will get the owner of this mutex after it is
released by IA. But SCU had completed umip/smip command,
and not aware of this owner change. So SCU will not release
the mutex and IA will lose the mutex later.

This patch is a workarround for this SCU limitation.
It keeps to send umip/smip command while it is failed.
When it is successful, SCU will release the mutex.

It should not be the final solution. SCU needs to fix
this issue in the future.

Change-Id: I87f5db6f558e37ba0e595cfe21835249c8e417f6
Signed-off-by: Bin Yang <bin.yang@intel.com>
13 years agoipc: enable IPC interrupt mode
Li, Ning [Mon, 8 Aug 2011 08:09:31 +0000 (16:09 +0800)]
ipc: enable IPC interrupt mode

BZ: 6898

IPC driver was polling the status busy bit to wait
for command completion. It was not effective.

This patch enhances driver to wait interrupt.
CPU is relaxed when IPC command is in progress.

Change-Id: I0107ebb74b7db316fd68eca859ec2c71e30d656d
Signed-off-by: Li, Ning <ning.li@intel.com>
Signed-off-by: Bin Yang <bin.yang@intel.com>
13 years agomrst: need to include gpio.h in mrst.c as the touchscreen code added for
Fei Yang [Fri, 9 Sep 2011 17:06:50 +0000 (10:06 -0700)]
mrst: need to include gpio.h in mrst.c as the touchscreen code added for
Cypress TTSP makes reference to the GPIO API's

Change-Id: Ib11b05ab8b5ec9b1e85748072ab1f5c0f8e493a9
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agoCYTTSP: I2C read errors are seen during boot time when initializing
Fei Yang [Thu, 8 Sep 2011 20:30:34 +0000 (13:30 -0700)]
CYTTSP: I2C read errors are seen during boot time when initializing
touchscreen. Problem is that CY_DELAY_SYSINFO is not accurately defined.
Making the delay 30ms to avoid I2C read error.

Need to revisit when hardware specification is available.

Change-Id: I44f408212d698524ce7603b85df18260d859b21f
Signed-off-by: Fei Yang <fei.yang@intel.com>
13 years agocyttsp: move early_suspend registration to the end of probe
Jianwei Yang [Wed, 3 Aug 2011 04:36:55 +0000 (12:36 +0800)]
cyttsp: move early_suspend registration to the end of probe

BZ: 6424

early_suspend may be registered even if driver probe fails, this
will cause kernel panic when the early_suspend is executed without
driver registered.

Change-Id: If898bce838f40a4c28e7c4b997e742c541891618
Signed-off-by: Jianwei Yang <jianwei.yang@intel.com>
13 years agoinput/cyttsp: optimize msleeps in device initialization path
Sundar Iyer [Fri, 1 Jul 2011 10:20:04 +0000 (15:50 +0530)]
input/cyttsp:  optimize msleeps in device initialization path

BZ: 4982

Optimize generous msleeps in the device initialization code
to reduce the total cyttsp boot time from 2839065 usecs to 249755 usecs.
This saves around ~2.5s of total platform boot time

Change-Id: I96bc9668a930251a5cbec5643d705b4b2aff6f7f
Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
13 years agocyttsp: fix compile error when CONFIG_PM is not configured
Hong Liu [Thu, 23 Jun 2011 02:45:29 +0000 (10:45 +0800)]
cyttsp: fix compile error when CONFIG_PM is not configured

BZ: 3778

Touch controller needs to be active when updating the touch firmware.
It resumes the device if it is suspended. Make sure the call is guarded
by CONFIG_PM option.

And also disable irq unconditionally when updating firmware.

Change-Id: Ie77b94521d419839ae9346743b3827af60542bbb
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agocyttsp: simplify event reporting and fix onFling issue
Hong Liu [Fri, 3 Jun 2011 08:19:57 +0000 (16:19 +0800)]
cyttsp:  simplify event reporting and fix onFling issue

BZ: 1372

Simplify the multi-touch event report sequence for the cyttsp driver,
and with this improvement, we can modify the tracking id to be 0-based,
this solves the onFling not generated issue on Android, since Android
only generate onFling event for tracking id 0.

Change-Id: I61a8bc3d75776168ce38aba9019f0d536f382ee6
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agocyttsp: fix touchscreen not working after S3 resume
Hong Liu [Mon, 25 Apr 2011 05:05:53 +0000 (13:05 +0800)]
cyttsp: fix touchscreen not working after S3 resume

BZ:1101

Gaurd the cyttsp core suspend function with the suspended state,
and move the legacy suspend/resume to the new dev_pm_ops.

Change-Id: Iaadd8935e94b27b8a985ac6b8bcf4de48a1ed7a5
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agocyttsp: remove unnecessary pointer manipulation
Hong Liu [Tue, 12 Apr 2011 01:41:51 +0000 (09:41 +0800)]
cyttsp: remove unnecessary pointer manipulation

We store the pointer to struct cyttsp as driver data in cyttsp_core_init,
and bus driver (cyttsp_i2c) will pass this driver data to cyttsp_core later.

Change-Id: I56c506ccace2fe81c14c9277cba3bc1316fdc50c
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agocyttsp: implement early_suspend for cypress controller
Hong Liu [Tue, 12 Apr 2011 01:38:06 +0000 (09:38 +0800)]
cyttsp: implement early_suspend for cypress controller

Put the controller into deep sleep mode when display is off.
This gives a saving of ~5mW on the TMD panel during S0i3.

Change-Id: I69d1e182311c164ad9372a44f736f8a71826fa17
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agocyttsp: correct return value for cyttsp suspend/resume func
Hong Liu [Mon, 11 Apr 2011 02:44:27 +0000 (10:44 +0800)]
cyttsp: correct return value for cyttsp suspend/resume func

Return 0 for success and < 0 for error, to make them be consistent with
kernel convention.

Change-Id: I7cb9293833ca4f178e177373c9dd9160d0c303ce
Signed-off-by: Hong Liu <hong.liu@intel.com>
13 years agoTEMPORARY: iCDK touchscreen support
Fei Yang [Thu, 8 Sep 2011 18:11:02 +0000 (11:11 -0700)]
TEMPORARY: iCDK touchscreen support

This patch is based on UMG 2.6.35 kernel. It provides support for
Cypress TTSP touchscreen that is in medfield iCDK. There are no changes
compared to UMG kernel except a few conflicts in platform file.

The driver is still using legacy PM functions which would need to be
converted to dev pm ops if we load this driver when doing S0i3 checks

NOT FOR UPSTREAM. Please wash hands after handling.

Change-Id: I464795f24af35c9b06dff19dd0f62b3846f57b72
Signed-off-by: Pauli Nieminen <pauli.nieminen@intel.com>
13 years agoPCI core warns if the legacy PM and new PM functions are
Octavian Purdila [Thu, 25 Aug 2011 11:14:04 +0000 (12:14 +0100)]
PCI core warns if the legacy PM and new PM functions are
present. Update the driver to only use the new power management
framework.

This patch fixes the following warning seen during suspend/resume:

<7>[   24.193850] i2c-designware-pci 0000:08:13.0: suspend
<4>[   24.193866] ------------[ cut here ]------------
<4>[   24.193892] WARNING: at drivers/pci/pci-driver.c:605 pci_has_legacy_pm_support+0x48/0x4d()
<4>[   24.193925] Hardware name: OakTrail
<4>[   24.193936] Modules linked in:
<4>[   24.193958] Pid: 2834, comm: kworker/u:22 Tainted: G        W   2.6.36greenridge-01402-gc8047e6 #171
<4>[   24.193974] Call Trace:
<4>[   24.193999]  [<c1033a93>] warn_slowpath_common+0x66/0xc2
<4>[   24.194025]  [<c1164143>] ? pci_has_legacy_pm_support+0x48/0x4d
<4>[   24.194052]  [<c1033afe>] warn_slowpath_null+0xf/0x13
<4>[   24.194079]  [<c1164143>] pci_has_legacy_pm_support+0x48/0x4d
<4>[   24.194106]  [<c11643ff>] pci_pm_suspend+0x22/0x154
<4>[   24.194131]  [<c11643dd>] ? pci_pm_suspend+0x0/0x154
<4>[   24.194156]  [<c11e8a7a>] pm_op+0x3e/0x95
<4>[   24.194182]  [<c11e931d>] __device_suspend+0x12e/0x194
<4>[   24.194208]  [<c11e974d>] ? dpm_drv_timeout+0x0/0x47
<4>[   24.194237]  [<c11e9729>] async_suspend+0x16/0x3a
<4>[   24.194265]  [<c104de8e>] async_run_entry_fn+0x97/0x135
<4>[   24.194291]  [<c1043c34>] process_one_work+0x1c9/0x2db

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: Add runtime power management support
Dirk Brandewie [Thu, 25 Aug 2011 11:14:04 +0000 (12:14 +0100)]
i2c-designware: Add runtime power management support

Add runtime power management to the PCI driver.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: Add support for Designware core behind PCI devices.
Dirk Brandewie [Thu, 25 Aug 2011 11:14:04 +0000 (12:14 +0100)]
i2c-designware: Add support for Designware core behind PCI devices.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: Push all register reads/writes into the core code.
Dirk Brandewie [Thu, 25 Aug 2011 11:14:03 +0000 (12:14 +0100)]
i2c-designware: Push all register reads/writes into the core code.

Move all register manipulation code into the core, also move register
offset definitions to i2c-designware-core.c since the bus specific
portions of the driver no longer need/use them.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: Support multiple cores using same ISR
Dirk Brandewie [Thu, 25 Aug 2011 11:14:03 +0000 (12:14 +0100)]
i2c-designware: Support multiple cores using same ISR

Add check to make sure that the core is enabled and has outstanding
interrupts. The activity bit is masked due to the fact that it will
stay active even after the controller has been disabled until the
contoller internal state machines have settled.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: move controller config to bus specific portion of driver
Dirk Brandewie [Thu, 25 Aug 2011 11:14:03 +0000 (12:14 +0100)]
i2c-designware: move controller config to bus specific portion of driver

With multiple I2C adapters possible in the system each running at
(possibly) different speeds we need to move the controller
configuration bit field to the adapter.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: move i2c functionality bit field to be adapter specific
Dirk Brandewie [Thu, 25 Aug 2011 11:14:03 +0000 (12:14 +0100)]
i2c-designware: move i2c functionality bit field to be adapter specific

The functionality of the adapter depends on the configuration of the
IP block at silicon compile time and is adapter specific.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: Move retriveving the clock speed out of core code.
Dirk Brandewie [Thu, 25 Aug 2011 11:14:02 +0000 (12:14 +0100)]
i2c-designware: Move retriveving the clock speed out of core code.

The clock frequecy supplied to the IP core is specific to a single
instance of the driver.  This patch makes it possible to have multiple
Designware I2C cores in the system possibly running at different core
frequencies.

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoi2c-designware: split of i2c-designware.c into core and bus specific parts
Dirk Brandewie [Thu, 25 Aug 2011 11:14:02 +0000 (12:14 +0100)]
i2c-designware: split of i2c-designware.c into core and bus specific parts

This patch splits i2c-designware.c into three pieces:
     i2c-designware-core.c, contains the code that interacts directly
     with the core.

     i2c-designware-platdrv.c, contains the code specific to the
     platform driver using the core.

     i2c-designware-core.h contains the definitions and declareations
     shared by i2c-designware-core.c and i2c-designware-platdrv.c.

This patch is the first in a set to allow multiple instances of the
designware I2C core in the system.

Change-Id: Ib876d49780e55ade274026380326c550752e4193
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
13 years agoUSB: net2272: driver for PLX NET2272 USB device controller
Seth Levy [Mon, 6 Jun 2011 23:42:44 +0000 (19:42 -0400)]
USB: net2272: driver for PLX NET2272 USB device controller

This is based on the last release from PLX:
http://www.plxtech.com/files/products/net2000/software/selectiontool/RE061204-net2272-linux2.6.18.tgz

I've managed to contact them and they've confirmed that this driver was
wholly written by PLX (Seth Levy).  While they have no problem with it
being merged (and they've already licensed it as GPL), they don't have
any interest in doing so themselves as this is an old part for them.

ADI has long had an add-on card which has this part on it, so we've been
keeping it up-to-date out of tree.  But now that PLX has confirmed the
source of the driver, we can can take the next step of cleaning it up and
getting it merged.

So here we are!  I've done quite a large clean up of the driver and
attempted to address all the common issues.  Hopefully in the process,
I haven't broken anything.  While it seems to still work with the board
that I have access to, it is not a PCI variant.  So I have not tested
any of the PCI logic myself (beyond clean compile).  Perhaps someone who
actually has a card and cares can do so.

I'll try to address further feedback, but don't expect miracles.  I'm
not really familiar with the part itself, just the platform glue.

Change-Id: Ife07cd1726128d06cf9f5df07108474996b46ca2
Signed-off-by: Seth Levy <seth.levy@plxtech.com>
Signed-off-by: Ash Aziz <ash.aziz@plxtech.com>
Signed-off-by: Roy Huang <roy.huang@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 years agoPMU: fix lpmp3 trigger when lss_51, 52 in D0i0
Illyas Mansoor [Tue, 6 Sep 2011 17:33:42 +0000 (23:03 +0530)]
PMU: fix lpmp3 trigger when lss_51, 52 in D0i0

When voice call + mp3 is on enabling s0i1/LPMP3 causes
system hang.

This is due to the target config for LPMP3 was set
to get triggered if LSS_08/09 + LSS_51/52 are in D0i0
and rest in D0i3.

Fixed this by add check for LSS_51/52 to be in D0i3 before
triggering LPMP3 ie., only LSS_08/09 can be in D0i0 for
triggering LPMP3.

Change-Id: I03866e3aa5325149303902a80b591a88ea19ff63
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>
13 years agoPMU: fix divide by zero in pmu_stat_seq_printf
Illyas Mansoor [Tue, 30 Aug 2011 11:10:55 +0000 (16:40 +0530)]
PMU: fix divide by zero in pmu_stat_seq_printf

When echo clear > /d/mid_pmu_states is done,
and immediately "cat /d/mid_pmu_states" is
called, the variable init_2_now_time could be zero.

t = cpu_clock(raw_smp_processor_id());
t -= pmu_init_time;

init_2_now_time = (unsigned long) t;

remainder = do_div(t, init_2_now_time);

Fixed this by checking for init_2_now_time for zero.

Change-Id: I2bdd22526622327007e52cd93ebbe82fd78e72d2
Signed-off-by: Illyas Mansoor <illyas.mansoor@intel.com>