Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/fih/fpcfingerprint_tee/fpc1020_tee.c b/drivers/fih/fpcfingerprint_tee/fpc1020_tee.c
- index bbd99b5..de664b1 100755
- --- a/drivers/fih/fpcfingerprint_tee/fpc1020_tee.c
- +++ b/drivers/fih/fpcfingerprint_tee/fpc1020_tee.c
- @@ -32,11 +32,13 @@
- #include <linux/clk.h>
- #include <linux/delay.h>
- +#include <linux/fb.h>
- #include <linux/gpio.h>
- #include <linux/interrupt.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/mutex.h>
- +#include <linux/notifier.h>
- #include <linux/of.h>
- #include <linux/of_gpio.h>
- #include <linux/regulator/consumer.h>
- @@ -87,6 +89,7 @@ struct fpc1020_data {
- struct clk *iface_clk;
- struct clk *core_clk;
- struct regulator *vreg[ARRAY_SIZE(vreg_conf)];
- + struct notifier_block fb_notif;
- struct wake_lock ttw_wl;
- int irq_gpio;
- @@ -646,6 +649,33 @@ static const struct attribute_group attribute_group = {
- .attrs = attributes,
- };
- +static int fb_notifier_callback(struct notifier_block *self, unsigned long event, void *data)
- +{
- + struct fpc1020_data *fpc1020 = container_of(self, struct fpc1020_data, fb_notif);
- + struct fb_event *evdata = data;
- +
- + if ((event == FB_EVENT_BLANK) && evdata && evdata->data) {
- + int blank = *(int *)evdata->data;
- +
- + switch (blank) {
- + case FB_BLANK_POWERDOWN:
- + pr_info("fpc1020: suspending++\n");
- + fpc1020->clocks_suspended = fpc1020->clocks_enabled;
- + set_clks(fpc1020, false);
- + pr_info("fpc1020: suspended --\n");
- + break;
- + case FB_BLANK_UNBLANK:
- + pr_info("fpc1020: resuming++\n");
- + if (fpc1020->clocks_suspended)
- + set_clks(fpc1020, true);
- + pr_info("fpc1020: resumed --\n");
- + break;
- + }
- + }
- +
- + return NOTIFY_OK;
- +}
- +
- static irqreturn_t fpc1020_irq_handler(int irq, void *handle)
- {
- struct fpc1020_data *fpc1020 = handle;
- @@ -845,6 +875,13 @@ static int fpc1020_probe(struct spi_device *spi)
- goto exit;
- }
- + fpc1020->fb_notif.notifier_call = fb_notifier_callback;
- + rc = fb_register_client(&fpc1020->fb_notif);
- + if (rc) {
- + dev_err(fpc1020->dev, "Unable to register fb_notifier: %d\n", rc);
- + goto exit;
- + }
- +
- if (of_property_read_bool(dev->of_node, "fpc,enable-on-boot")) {
- dev_info(dev, "Enabling hardware\n");
- (void)device_prepare(fpc1020, true);
- @@ -870,6 +907,7 @@ static int fpc1020_remove(struct spi_device *spi)
- return 0;
- }
- +#if 0
- static int fpc1020_suspend(struct device *dev)
- {
- struct fpc1020_data *fpc1020 = dev_get_drvdata(dev);
- @@ -893,6 +931,7 @@ static const struct dev_pm_ops fpc1020_pm_ops = {
- .suspend = fpc1020_suspend,
- .resume = fpc1020_resume,
- };
- +#endif
- static struct of_device_id fpc1020_of_match[] = {
- { .compatible = "fpc,fpc1020", },
- @@ -905,7 +944,7 @@ static struct spi_driver fpc1020_driver = {
- .name = "fpc1020",
- .owner = THIS_MODULE,
- .of_match_table = fpc1020_of_match,
- - .pm = &fpc1020_pm_ops,
- + //.pm = &fpc1020_pm_ops,
- },
- .probe = fpc1020_probe,
- .remove = fpc1020_remove,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement