/*
 * Google Veyron (and derivatives) fragment for sdmmc cards
 *
 * Copyright 2015 Google, Inc
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *  Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

&io_domains {
	sdcard-supply = <&vccio_sd>;
};

&pinctrl {
	sdmmc {
		/*
		 * We run sdmmc at max speed; bump up drive strength.
		 * We also have external pulls, so disable the internal ones.
		 */
		sdmmc_bus4: sdmmc-bus4 {
			rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
					<6 17 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
					<6 18 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
					<6 19 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
		};

		sdmmc_clk: sdmmc-clk {
			rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
		};

		sdmmc_cmd: sdmmc-cmd {
			rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
		};

		/*
		 * Builtin CD line is hooked to ground to prevent JTAG at boot
		 * (and also to get the voltage rail correct).
		 * Configure gpio6_C6 as GPIO so dw_mmc builtin CD doesn't
		 * think there's a card inserted
		 */
		sdmmc_cd_disabled: sdmmc-cd-disabled {
			rockchip,pins = <6 22 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		/* This is where we actually hook up CD */
		sdmmc_cd_gpio: sdmmc-cd-gpio {
			rockchip,pins = <7 5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&rk808 {
	vcc9-supply = <&vcc_5v>;

	regulators {
		vccio_sd: LDO_REG4 {
			regulator-name = "vccio_sd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-state-mem {
				regulator-off-in-suspend;
			};
		};

		vcc33_sd: LDO_REG5 {
			regulator-name = "vcc33_sd";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			regulator-state-mem {
				regulator-off-in-suspend;
			};
		};
	};
};

&sdmmc {
	status = "okay";

	bus-width = <4>;
	cap-mmc-highspeed;
	cap-sd-highspeed;
	card-detect-delay = <200>;
	cd-gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
	num-slots = <1>;
	vmmc-supply = <&vcc33_sd>;
	vqmmc-supply = <&vccio_sd>;
};
