diff options
author | Dorian Snyder <dastin1015@gmail.com> | 2013-06-12 02:24:45 -0700 |
---|---|---|
committer | Dorian Snyder <dastin1015@gmail.com> | 2013-06-20 00:06:04 -0700 |
commit | 4b2308ce699b9c599dd6e6acf57ac11f483381d9 (patch) | |
tree | 4c31179b06d094887b1c8ca70264cf8f184a5981 /drivers/staging | |
parent | 855d6a6c1f7c54ef073caac3f6c5f9b1ed72eb4d (diff) | |
download | kernel_samsung_smdk4412-4b2308ce699b9c599dd6e6acf57ac11f483381d9.zip kernel_samsung_smdk4412-4b2308ce699b9c599dd6e6acf57ac11f483381d9.tar.gz kernel_samsung_smdk4412-4b2308ce699b9c599dd6e6acf57ac11f483381d9.tar.bz2 |
d710: initial support for the Epic 4G Touch (SPH-D710)
Change-Id: Iafbd9fb45253b02d539ac0ba114f57b3bf9eeed4
Diffstat (limited to 'drivers/staging')
-rwxr-xr-x | drivers/staging/westbridge/astoria/device/cyasdevice_na_spr.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/staging/westbridge/astoria/device/cyasdevice_na_spr.c b/drivers/staging/westbridge/astoria/device/cyasdevice_na_spr.c index ef3970c..53663f2 100755 --- a/drivers/staging/westbridge/astoria/device/cyasdevice_na_spr.c +++ b/drivers/staging/westbridge/astoria/device/cyasdevice_na_spr.c @@ -442,10 +442,40 @@ static ssize_t store_cyas_wbcid(struct device *dev, static DEVICE_ATTR(wbcid, S_IRUGO | S_IWUSR, show_cyas_wbcid, store_cyas_wbcid); #endif + +extern struct class *sec_class; +static struct device *sd_detection_cmd_dev; +static ssize_t sd_detection_cmd_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + unsigned int detect; + detect = cy_as_hal_detect_SD(); + pr_info("%s : detect = %d.\n", __func__, detect); + if (detect) { + pr_debug("sdhci: card inserted.\n"); + return sprintf(buf, "Insert\n"); + } else { + pr_debug("sdhci: card removed.\n"); + return sprintf(buf, "Remove\n"); + } +} + +static DEVICE_ATTR(status, 0444, sd_detection_cmd_show, NULL); static struct platform_device *westbridge_pd; static int __devinit wb_probe(struct platform_device *devptr) { + if (sd_detection_cmd_dev == NULL) { + sd_detection_cmd_dev = + device_create(sec_class, NULL, 0, + NULL, "sdcard"); + if (IS_ERR(sd_detection_cmd_dev)) + pr_err("Fail to create sysfs dev\n"); + + if (device_create_file(sd_detection_cmd_dev, + &dev_attr_status) < 0) + pr_err("Fail to create sysfs file\n"); + } cy_as_hal_print_message("%s called\n", __func__); return 0; } |