summaryrefslogtreecommitdiff
path: root/drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
committerYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
commit8e4bff4cab0ddac6060645b0715210484d02ff40 (patch)
tree3a5c3024371a04692a3a6d9974d001cdff8ebf84 /drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c
Initial file dump from open source releaseHEADmaster
Diffstat (limited to 'drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c')
-rw-r--r--drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c b/drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c
new file mode 100644
index 00000000..746495ab
--- /dev/null
+++ b/drivers/media/sprd_dcam/flash/flash_sprd_sm5701.c
@@ -0,0 +1,48 @@
+/*
+* * Copyright (C) 2012 Spreadtrum Communications Inc.
+* *
+* * This software is licensed under the terms of the GNU General Public
+* * License version 2, as published by the Free Software Foundation, and
+* * may be copied, distributed, and modified under those terms.
+* *
+* * This program 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.
+* */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <soc/sprd/hardware.h>
+#include <soc/sprd/board.h>
+#include <soc/sprd/adi.h>
+#include <linux/leds.h>
+#include <linux/mfd/sprd_sm5701_core.h>
+
+int sprd_flash_on(void)
+{
+
+ sm5701_led_ready(MOVIE_MODE);
+ sm5701_set_fleden(SM5701_FLEDEN_ON_MOVIE);
+
+ return 0;
+}
+
+int sprd_flash_high_light(void)
+{
+
+ sm5701_led_ready(FLASH_MODE);
+ sm5701_set_fleden(SM5701_FLEDEN_ON_FLASH);
+
+ return 0;
+}
+
+int sprd_flash_close(void)
+{
+
+ sm5701_set_fleden(SM5701_FLEDEN_DISABLED);
+ sm5701_led_ready(LED_DISABLE);
+
+ return 0;
+}
+