summaryrefslogtreecommitdiff
path: root/drivers/media/video/wmt_v4l2/sensors/flash/flash.c
diff options
context:
space:
mode:
authorSrikant Patnaik2015-01-11 12:28:04 +0530
committerSrikant Patnaik2015-01-11 12:28:04 +0530
commit871480933a1c28f8a9fed4c4d34d06c439a7a422 (patch)
tree8718f573808810c2a1e8cb8fb6ac469093ca2784 /drivers/media/video/wmt_v4l2/sensors/flash/flash.c
parent9d40ac5867b9aefe0722bc1f110b965ff294d30d (diff)
downloadFOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.gz
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.tar.bz2
FOSSEE-netbook-kernel-source-871480933a1c28f8a9fed4c4d34d06c439a7a422.zip
Moved, renamed, and deleted files
The original directory structure was scattered and unorganized. Changes are basically to make it look like kernel structure.
Diffstat (limited to 'drivers/media/video/wmt_v4l2/sensors/flash/flash.c')
-rwxr-xr-xdrivers/media/video/wmt_v4l2/sensors/flash/flash.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/media/video/wmt_v4l2/sensors/flash/flash.c b/drivers/media/video/wmt_v4l2/sensors/flash/flash.c
new file mode 100755
index 00000000..7d5d3b2c
--- /dev/null
+++ b/drivers/media/video/wmt_v4l2/sensors/flash/flash.c
@@ -0,0 +1,54 @@
+/*
+ * ==========================================================================
+ *
+ * Filename: flash.c
+ *
+ * Description:
+ *
+ * Version: 0.01
+ * Created: 2013年07月02日 14时16分08秒
+ *
+ * Author: smmei (),
+ * Company:
+ *
+ * ==========================================================================
+ */
+
+#include <linux/init.h>
+#include <linux/errno.h>
+#include "flash.h"
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+static struct flash_dev *fl_devices[] = {
+ &flash_dev_gpio,
+ &flash_dev_eup2471,
+ &flash_dev_eup3618,
+ &flash_dev_ktd231,
+ &flash_dev_sgm3780,
+};
+
+struct flash_dev *flash_instantiation(void)
+{
+ int i;
+ for (i = 0; i < ARRAY_SIZE(fl_devices); i++) {
+ struct flash_dev *fl = fl_devices[i];
+ if (fl->init && fl->init() == 0)
+ return fl;
+ }
+ return NULL;
+}
+
+int flash_set_mode(struct flash_dev *fl, int mode)
+{
+ return (fl && fl->set_mode) ? fl->set_mode (mode) : -EINVAL;
+}
+
+void flash_destroy(struct flash_dev *fl)
+{
+ if (fl && fl->exit)
+ fl->exit();
+}
+