Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created April 7, 2015 19:23
Show Gist options
  • Save invisiblek/c886ac462ea9c10fc1ee to your computer and use it in GitHub Desktop.
Save invisiblek/c886ac462ea9c10fc1ee to your computer and use it in GitHub Desktop.
diff --git a/drivers/nfc/pn544-oppo_find7op.c b/../../oppo/n3/drivers/nfc/pn544_op.c
old mode 100644
new mode 100755
index 13d265d..d6a5f59
--- a/drivers/nfc/pn544-oppo_find7op.c
+++ b/../../oppo/n3/drivers/nfc/pn544_op.c
@@ -77,55 +77,10 @@ struct pn544_dev
};

/*OPPO yuyi 2013-10-24 add begin for nfc_devinfo*/
-struct manufacture_info mainboard_info;
struct manufacture_info nfc_info = {
.version = "pn65T",
.manufacture = "NXP",
};
-
-static void mainboard_verify(void)
-{
- switch(get_pcb_version()) {
- case HW_VERSION__10: 
- mainboard_info.version ="10";
- mainboard_info.manufacture = "SA";
- break;
- case HW_VERSION__11:
- mainboard_info.version = "11";
- mainboard_info.manufacture = "SB";
- break;
- case HW_VERSION__12:
- mainboard_info.version = "12";
- mainboard_info.manufacture = "SC";
- break;
- case HW_VERSION__13:
- mainboard_info.version = "13";
- mainboard_info.manufacture = "SD";
- break;
- case HW_VERSION__20:
- mainboard_info.version ="20";
- mainboard_info.manufacture = "SA";
- break;
- case HW_VERSION__21:
- mainboard_info.version = "21";
- mainboard_info.manufacture = "SB";
- break;
- case HW_VERSION__22:
- mainboard_info.version = "22";
- mainboard_info.manufacture = "SC";
- break;
- case HW_VERSION__23:
- mainboard_info.version = "23";
- mainboard_info.manufacture = "SD";
- break;
- default:
- mainboard_info.version = "UNKOWN";
- mainboard_info.manufacture = "UNKOWN";
- }
- 
- 
-}
- 
/*OPPO yuyi 2013-10-24 add end for nfc_devinfo*/

/*OPPO yuyi 2013-03-22 add begin from 12025 board-8064.c*/
@@ -422,7 +377,7 @@ static int pn544_probe(struct i2c_client *client, const struct i2c_device_id *id
{
int ret;
struct pn544_i2c_platform_data *platform_data;
- struct pn544_dev *pn544_dev = NULL;
+ struct pn544_dev *pn544_dev;
/*OPPO yuyi 2014-02-24 add begin for nfc pn65T*/
struct clk*p65T_clk = NULL;
/*OPPO yuyi 2014-02-24 add begin for nfc pn65T*/
@@ -445,8 +400,6 @@ static int pn544_probe(struct i2c_client *client, const struct i2c_device_id *id
// printk("yuyi,pn544_parse_dt pdata->clk_req_gpio = %d\n",platform_data->clk_req_gpio );

register_device_proc("nfc", nfc_info.version, nfc_info.manufacture);
- mainboard_verify();
- register_device_proc("mainboard", mainboard_info.version, mainboard_info.manufacture);
/*OPPO yuyi 2013-10-24 add end for nfc_devinfo*/
if (platform_data == NULL) 
{
@@ -494,7 +447,11 @@ static int pn544_probe(struct i2c_client *client, const struct i2c_device_id *id
*/ 

/*OPPO yuyi 2014-05-24 modify begin for rename clock name from core_clk to cxo_out_d1*/
+#ifndef VENDOR_EDIT
+ p65T_clk = clk_get(&client->dev, "core_clk");
+#else 
p65T_clk = clk_get(&client->dev, "cxo_out_d1");
+#endif
/*OPPO yuyi 2014-05-24 modify end for rename clock name from core_clk to cxo_out_d1*/
if (p65T_clk == NULL) {
printk("yuyi,pn65T clk error!");
@@ -590,10 +547,12 @@ static int pn544_probe(struct i2c_client *client, const struct i2c_device_id *id
pn544_disable_irq(pn544_dev);
i2c_set_clientdata(client, pn544_dev);

+ #ifdef CONFIG_VENDOR_EDIT
/*liuhd add for sleep current because of nfc 2013-12-17*/
gpio_set_value(pn544_dev->ven_gpio, 1);
msleep(10);
gpio_set_value(pn544_dev->ven_gpio, 0);
+ #endif
/*add end by liuhd 2013-12-17*/
return 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment