<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/mmc/core/sd.c, branch v3.10</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>mmc: sdhci: enhance preset value function</title>
<updated>2013-02-24T19:37:11+00:00</updated>
<author>
<name>Kevin Liu</name>
<email>kliu5@marvell.com</email>
</author>
<published>2013-01-31T03:31:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=52983382c74f59a3953e622d7661a24e1bc4388a'/>
<id>52983382c74f59a3953e622d7661a24e1bc4388a</id>
<content type='text'>
4d55c5a1 ("mmc: sdhci: enable preset value after uhs initialization")
added preset value support and enabled it by default during sd card init.

Below are the enhancements introduced by this patch:

1. In current code, preset value is enabled after setting clock finished,
which means the clock is manually set by driver firstly and then suddenly
switched to preset value at this point. So the first setting is useless
and unnecessary. What's more, the first clock setting may differ from the
preset one.  The better way is enable preset value just after switch to
UHS mode so the preset value can take effect immediately. So move preset
value enable from mmc_sd_init_card to sdhci_set_ios which will be called
during set timing.

2. In current code, preset value is disabled at the beginning of
mmc_attach_sd.  It's too late since low freq (400khz) should be set in
mmc_power_up.  So move preset value disable to sdhci_set_ios which will
be called during power up.

3. host-&gt;clock and ios-&gt;drv_type should also be updated according to the
preset value if it's enabled. Current code missed this.

4. This patch also introduce a quirk to disable preset value in case
preset value doesn't work.

This patch has been verified on sdhci-pxav3 platform with both preset
enabled and disabled.

Signed-off-by: Kevin Liu &lt;kliu5@marvell.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
4d55c5a1 ("mmc: sdhci: enable preset value after uhs initialization")
added preset value support and enabled it by default during sd card init.

Below are the enhancements introduced by this patch:

1. In current code, preset value is enabled after setting clock finished,
which means the clock is manually set by driver firstly and then suddenly
switched to preset value at this point. So the first setting is useless
and unnecessary. What's more, the first clock setting may differ from the
preset one.  The better way is enable preset value just after switch to
UHS mode so the preset value can take effect immediately. So move preset
value enable from mmc_sd_init_card to sdhci_set_ios which will be called
during set timing.

2. In current code, preset value is disabled at the beginning of
mmc_attach_sd.  It's too late since low freq (400khz) should be set in
mmc_power_up.  So move preset value disable to sdhci_set_ios which will
be called during power up.

3. host-&gt;clock and ios-&gt;drv_type should also be updated according to the
preset value if it's enabled. Current code missed this.

4. This patch also introduce a quirk to disable preset value in case
preset value doesn't work.

This patch has been verified on sdhci-pxav3 platform with both preset
enabled and disabled.

Signed-off-by: Kevin Liu &lt;kliu5@marvell.com&gt;
Reviewed-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: Fixup signal voltage switch</title>
<updated>2013-02-24T19:37:08+00:00</updated>
<author>
<name>Johan Rudholm</name>
<email>johan.rudholm@stericsson.com</email>
</author>
<published>2013-01-28T14:08:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0797e5f1453b2bedc08bbcbea0ea4fbe20350823'/>
<id>0797e5f1453b2bedc08bbcbea0ea4fbe20350823</id>
<content type='text'>
When switching SD and SDIO cards from 3.3V to 1.8V signal levels, the
clock should be gated for 5 ms during the step. After enabling the
clock, the host should wait for at least 1 ms before checking for
failure. Failure by the card to switch is indicated by dat[0:3] being
pulled low. The host should check for this condition and power-cycle
the card if failure is indicated.

Add a retry mechanism for the SDIO case.

If the voltage switch fails repeatedly, give up and continue the
initialization using the original voltage.

This patch places a couple of requirements on the host driver:

 1) mmc_set_ios with ios.clock = 0 must gate the clock
 2) mmc_power_off must actually cut the power to the card
 3) The card_busy host_ops member must be implemented

if these requirements are not fulfilled, the 1.8V signal voltage switch
will still be attempted but may not be successful.

Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Signed-off-by: Kevin Liu &lt;kliu5@marvell.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When switching SD and SDIO cards from 3.3V to 1.8V signal levels, the
clock should be gated for 5 ms during the step. After enabling the
clock, the host should wait for at least 1 ms before checking for
failure. Failure by the card to switch is indicated by dat[0:3] being
pulled low. The host should check for this condition and power-cycle
the card if failure is indicated.

Add a retry mechanism for the SDIO case.

If the voltage switch fails repeatedly, give up and continue the
initialization using the original voltage.

This patch places a couple of requirements on the host driver:

 1) mmc_set_ios with ios.clock = 0 must gate the clock
 2) mmc_power_off must actually cut the power to the card
 3) The card_busy host_ops member must be implemented

if these requirements are not fulfilled, the 1.8V signal voltage switch
will still be attempted but may not be successful.

Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Signed-off-by: Kevin Liu &lt;kliu5@marvell.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: Break out start_signal_voltage_switch</title>
<updated>2013-02-24T19:37:07+00:00</updated>
<author>
<name>Johan Rudholm</name>
<email>johan.rudholm@stericsson.com</email>
</author>
<published>2013-01-28T14:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=567c89032cfdda8047562abe450947ac01f2d3c7'/>
<id>567c89032cfdda8047562abe450947ac01f2d3c7</id>
<content type='text'>
Allow callers to access the start_signal_voltage_switch host_ops
member without going through any cmd11 logic. This is mostly a
preparation for the following signal voltage switch patch.

Also, reset ios.signal_voltage to its original value if
start_signal_voltage_switch fails.

Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow callers to access the start_signal_voltage_switch host_ops
member without going through any cmd11 logic. This is mostly a
preparation for the following signal voltage switch patch.

Also, reset ios.signal_voltage to its original value if
start_signal_voltage_switch fails.

Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Tested-by: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sd: Simplify by using mmc_host_uhs</title>
<updated>2013-02-24T19:37:05+00:00</updated>
<author>
<name>Johan Rudholm</name>
<email>johan.rudholm@stericsson.com</email>
</author>
<published>2013-01-28T14:08:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3f8a7fabd60e83eb2fb7add00d353d455c0e7a78'/>
<id>3f8a7fabd60e83eb2fb7add00d353d455c0e7a78</id>
<content type='text'>
Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Johan Rudholm &lt;johan.rudholm@stericsson.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: reset signal voltage on power up</title>
<updated>2012-07-22T19:25:53+00:00</updated>
<author>
<name>Aaron Lu</name>
<email>aaron.lu@amd.com</email>
</author>
<published>2012-07-10T08:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=108ecc4cf9c46a4caabaf18efc42d19818c95b70'/>
<id>108ecc4cf9c46a4caabaf18efc42d19818c95b70</id>
<content type='text'>
Add a call to mmc_set_signal_voltage() to set signal voltage to 3.3v in
mmc_power_up so that we do not need to touch signal voltage setting in
mmc/sd/sdio init functions and rescan function.

For mmc/sd cards, when doing a suspend/resume cycle, consider the unsafe
resume case, the card will lose its power and when powered on again, we
will set signal voltage to 3.3v in mmc_power_up before its resume function
gets called, which will re-init the card.

And for sdio cards, when doing a suspend/resume cycle, consider the unsafe
resume case, the card will either lose its power or not depending on if it
wants to wakeup the host. If power is not maintained, it is the same case as
mmc/sd cards. If power is maintained, mmc_power_up will not be called and
the card's signal voltage will remain at the last setting.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Tested-by: Venkatraman S &lt;svenkatr@ti.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a call to mmc_set_signal_voltage() to set signal voltage to 3.3v in
mmc_power_up so that we do not need to touch signal voltage setting in
mmc/sd/sdio init functions and rescan function.

For mmc/sd cards, when doing a suspend/resume cycle, consider the unsafe
resume case, the card will lose its power and when powered on again, we
will set signal voltage to 3.3v in mmc_power_up before its resume function
gets called, which will re-init the card.

And for sdio cards, when doing a suspend/resume cycle, consider the unsafe
resume case, the card will either lose its power or not depending on if it
wants to wakeup the host. If power is not maintained, it is the same case as
mmc/sd cards. If power is maintained, mmc_power_up will not be called and
the card's signal voltage will remain at the last setting.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Tested-by: Venkatraman S &lt;svenkatr@ti.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sd: Fix sd current limit setting</title>
<updated>2012-07-22T19:25:52+00:00</updated>
<author>
<name>Aaron Lu</name>
<email>aaron.lu@amd.com</email>
</author>
<published>2012-07-04T05:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=55c4665ea0a42fd6427826bfce96eb4b0389262a'/>
<id>55c4665ea0a42fd6427826bfce96eb4b0389262a</id>
<content type='text'>
Host has different current capabilities at different voltages, we need
to record these settings seperately. The defined voltages are 1.8/3.0/3.3.
For other voltages, we do not touch current limit setting.

Before we set the current limit for the sd card, find out the host's
operating voltage first and then find out the current capabilities of
the host at that voltage to set the current limit.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Reviewed-by: Philip Rakity &lt;prakity@marvell.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Host has different current capabilities at different voltages, we need
to record these settings seperately. The defined voltages are 1.8/3.0/3.3.
For other voltages, we do not touch current limit setting.

Before we set the current limit for the sd card, find out the host's
operating voltage first and then find out the current capabilities of
the host at that voltage to set the current limit.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Reviewed-by: Philip Rakity &lt;prakity@marvell.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: Simplify and fix for SD switch processing</title>
<updated>2012-07-22T19:25:47+00:00</updated>
<author>
<name>Aaron Lu</name>
<email>aaron.lu@amd.com</email>
</author>
<published>2012-07-03T06:16:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a39ca6ae0a08994a59d017a445939e164bc77fd5'/>
<id>a39ca6ae0a08994a59d017a445939e164bc77fd5</id>
<content type='text'>
In mmc_read_switch, just do a one time mode 0 switch command to get the
support bits information, no need to do multiple times as the support
bits do not change with different arguments.

And no need to check current limit support bits, as these bits are
fixed according to the signal voltage. If the signal voltage is 1.8V,
the support bits would be 0xf and if the signal voltage is 3.3V, the
support bits would be 0x01. We will check host's ability to set the
current limit.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In mmc_read_switch, just do a one time mode 0 switch command to get the
support bits information, no need to do multiple times as the support
bits do not change with different arguments.

And no need to check current limit support bits, as these bits are
fixed according to the signal voltage. If the signal voltage is 1.8V,
the support bits would be 0xf and if the signal voltage is 3.3V, the
support bits would be 0x01. We will check host's ability to set the
current limit.

Signed-off-by: Aaron Lu &lt;aaron.lu@amd.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: correct invalid error checking</title>
<updated>2012-07-21T04:02:24+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2012-07-02T17:55:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b63b5e819d5b21ae493c17c356018ffa98d3ee1c'/>
<id>b63b5e819d5b21ae493c17c356018ffa98d3ee1c</id>
<content type='text'>
The effect of the existing code is that we continue blindly when we
should warn about an invalid allocation unit.

Reported-by: dcb314@hotmail.com
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44061
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The effect of the existing code is that we continue blindly when we
should warn about an invalid allocation unit.

Reported-by: dcb314@hotmail.com
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44061
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: sdhci: only set 200mA support for 1.8v if 200mA is available</title>
<updated>2012-07-21T04:02:23+00:00</updated>
<author>
<name>Philip Rakity</name>
<email>prakity@marvell.com</email>
</author>
<published>2012-05-28T01:36:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0aa6770000bafa65c17cf44b6619d328d4fc79b3'/>
<id>0aa6770000bafa65c17cf44b6619d328d4fc79b3</id>
<content type='text'>
max_current_caps can return 0 if not available from the sd controller.
If no regulator is present or the regulator specifies a current
less then 200ma, we no longer still set the 200mA caps bit anyway.

Signed-off-by: Philip Rakity &lt;prakity@marvell.com&gt;
Reviewed-by: Aaron Lu &lt;aaron_lu@amd.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
max_current_caps can return 0 if not available from the sd controller.
If no regulator is present or the regulator specifies a current
less then 200ma, we no longer still set the 200mA caps bit anyway.

Signed-off-by: Philip Rakity &lt;prakity@marvell.com&gt;
Reviewed-by: Aaron Lu &lt;aaron_lu@amd.com&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mmc: core: return an error on suspend if mmc_deselect_cards fails</title>
<updated>2012-06-06T13:49:47+00:00</updated>
<author>
<name>Jaehoon Chung</name>
<email>jh80.chung@samsung.com</email>
</author>
<published>2012-05-31T11:31:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=85e727edb963459d13cdd9ce84c335d251a005a7'/>
<id>85e727edb963459d13cdd9ce84c335d251a005a7</id>
<content type='text'>
When mmc_host is not spi mode, mmc/sd is doing mmc_deselect_cards().
mmc_deselect_cards could be returned error.
If returned error, we can know something wrong when enter suspend.

Signed-off-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When mmc_host is not spi mode, mmc/sd is doing mmc_deselect_cards().
mmc_deselect_cards could be returned error.
If returned error, we can know something wrong when enter suspend.

Signed-off-by: Jaehoon Chung &lt;jh80.chung@samsung.com&gt;
Signed-off-by: Kyungmin Park &lt;kyungmin.park@samsung.com&gt;
Acked-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Chris Ball &lt;cjb@laptop.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
