Skip to content

Commit

Permalink
Upd goodix finger print
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperion70 committed Mar 16, 2019
1 parent d81a196 commit c0910e6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
2 changes: 1 addition & 1 deletion drivers/input/fingerprint/gx556/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat
subdir-ccflags-y += -I$(srctree)/drivers/spi/mediatek/$(MTK_PLATFORM)
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/mt6735/
subdir-ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/mt6757/

obj-y += gf_spi.o platform.o
8 changes: 4 additions & 4 deletions drivers/input/fingerprint/gx556/gf_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#define GF_SPIDEV_NAME "goodix,fingerprint"
/*device name after register in charater*/
#define GF_DEV_NAME "goodix_fp"
#define GF_INPUT_NAME "qwerty" /*"goodix_fp" */
#define GF_INPUT_NAME "gf-input" /*"goodix_fp" */
#define SPI_DEV_NAME "spidev"

#define CHRD_DRIVER_NAME "goodix_fp_spi"
Expand Down Expand Up @@ -362,7 +362,7 @@ static SPI_SPEED trans_spi_speed(unsigned int speed)
spi_speed = SPEED_4MHZ;
}

//printk("%s , speed_in=%l, speed_out=%l\n", __func__, speed, spi_speed);
printk("%s , speed_in=%d, speed_out=%d\n",__func__, speed, spi_speed);
return spi_speed;
}

Expand Down Expand Up @@ -842,7 +842,7 @@ static int gf_open(struct inode *inode, struct file *filp)
gf_print("Succeed to open device. irq = %d, users:%d\n",
gf_dev->spi->irq, gf_dev->users);
if (gf_dev->users == 1){
//gf_enable_irq(gf_dev);
gf_enable_irq(gf_dev);
}
}
} else {
Expand Down Expand Up @@ -1086,7 +1086,7 @@ int gf_read_chip_id(struct gf_dev *pdev)

gf_spi_read_word(pdev, 0x0142, &val);
gf_print("goodix-chip id: 0x%x \n", val);
if((val >> 4) == (0x12a1 >> 4)) {
if(val == 0x0) {
return 0;
}
printk(KERN_ERR"3goodix-chip id: 0x%x \n", val);
Expand Down
10 changes: 5 additions & 5 deletions drivers/input/fingerprint/gx556/gf_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@

#ifdef GF_DEBUG
#define gf_print(fmt, args...) do { \
printk(KERN_ERR"gf5216_spi:" fmt, ##args);\
printk(KERN_ERR"gx556:" fmt, ##args);\
} while (0)

//#define gf_print(args...) printk(KERN_ERR "gf_spi:" ##args)
#define FUNC_ENTRY() printk(KERN_ERR "gf5216_spi:%s, entry\n", __func__)
#define FUNC_EXIT() printk(KERN_ERR "gf5216_spi:%s, exit\n", __func__)
#define FUNC_ENTRY() printk(KERN_ERR "gx556:%s, entry\n", __func__)
#define FUNC_EXIT() printk(KERN_ERR "gx556:%s, exit\n", __func__)
#else
#define gf_print(fmt, args...)
#define FUNC_ENTRY()
Expand Down Expand Up @@ -148,10 +148,10 @@ struct gf_dev {
unsigned int isPowerOn;
struct regulator *avdd;
struct pinctrl *pinctrl1;
struct pinctrl_state *pins_default;
struct pinctrl_state *fp_default;
struct pinctrl_state *eint_as_int, *eint_in_low, *eint_in_high, *eint_in_float,
*fp_rst_low, *fp_rst_high,
*miso_pull_up,*miso_pull_disable,*fp_enable_high,*fp_enable_low,*fp_enable1v8_high,*fp_enable1v8_low;
*miso_pull_up,*miso_pull_disable,*fp_enable_high,*fp_enable_low;

};

Expand Down
17 changes: 1 addition & 16 deletions drivers/input/fingerprint/gx556/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int gf_parse_dts(struct gf_dev* pdev)
FUNC_ENTRY();

if(pdev->spi->dev.of_node == NULL) {
pdev->spi->dev.of_node = of_find_compatible_node(NULL, NULL, "mediatek,goodix");
pdev->spi->dev.of_node = of_find_compatible_node(NULL, NULL, "mediatek,fingerprint");
}

if(pdev->spi->dev.of_node) {
Expand Down Expand Up @@ -96,19 +96,6 @@ int gf_parse_dts(struct gf_dev* pdev)
dev_err(&pdev->spi->dev, " Cannot find fp pinctrl fp_enable_low!\n");
return ret;
}
pdev->fp_enable1v8_high = pinctrl_lookup_state(pdev->pinctrl1, "fp_enable1v8_high");
if (IS_ERR(pdev->fp_enable1v8_high)) {
ret = PTR_ERR(pdev->fp_enable1v8_high);
dev_err(&pdev->spi->dev, " Cannot find fp pinctrl fp_enable1v8_high!\n");
return ret;
}
pdev->fp_enable1v8_low = pinctrl_lookup_state(pdev->pinctrl1, "fp_enable1v8_low");
if (IS_ERR(pdev->fp_enable1v8_low)) {
ret = PTR_ERR(pdev->fp_enable1v8_low);
dev_err(&pdev->spi->dev, " Cannot find fp pinctrl fp_enable1v8_low!\n");
return ret;
}


}
else {
Expand Down Expand Up @@ -285,12 +272,10 @@ void gf_power_output(struct gf_dev *pdev, int level)
if (level)
{
pinctrl_select_state(pdev->pinctrl1, pdev->fp_enable_high);
pinctrl_select_state(pdev->pinctrl1, pdev->fp_enable1v8_high);
}
else
{
pinctrl_select_state(pdev->pinctrl1, pdev->fp_enable_low);
pinctrl_select_state(pdev->pinctrl1, pdev->fp_enable1v8_low);
}
mutex_unlock(&gf_set_gpio_mutex);
}
Expand Down

0 comments on commit c0910e6

Please sign in to comment.