Commit 6cecbe52 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

missed a func declaration in the top - for power off

parent c7ba788d
...@@ -287,6 +287,7 @@ static int get_enable(struct device *dev, int chn); ...@@ -287,6 +287,7 @@ static int get_enable(struct device *dev, int chn);
static int set_enable(struct device *dev, int chn, int enable); static int set_enable(struct device *dev, int chn, int enable);
static int get_pgood(struct device *dev, int chn); static int get_pgood(struct device *dev, int chn);
int gpio_10389_ctrl(struct device *dev, int value);
/* /*
Voltages: Voltages:
...@@ -640,6 +641,13 @@ static ssize_t gpio_poweroff(struct device *dev, struct device_attribute *attr, ...@@ -640,6 +641,13 @@ static ssize_t gpio_poweroff(struct device *dev, struct device_attribute *attr,
return count; return count;
} }
int gpio_shutdown(struct device *dev)
{
int gpio_shutdown_index=get_gpio_index_by_name("NSHUTDOWN");
if (gpio_shutdown_index<0) return gpio_shutdown_index;
return gpio_conf_by_index(dev, gpio_shutdown_index, 1, 0);
}
int gpio_10389_ctrl(struct device *dev, int value){ int gpio_10389_ctrl(struct device *dev, int value){
int i, res; int i, res;
int val = 0; int val = 0;
...@@ -647,8 +655,8 @@ int gpio_10389_ctrl(struct device *dev, int value){ ...@@ -647,8 +655,8 @@ int gpio_10389_ctrl(struct device *dev, int value){
for(i=16;i<20;i++){ for(i=16;i<20;i++){
if ((value>>(i-8))&0x1){ if ((value>>(i-8))&0x1){
val = (value>>(i-16))&0x1; val = (value>>(i-16))&0x1;
res = gpio_conf_by_index(dev, i, 1, ~val); //res = gpio_conf_by_index(dev, i, 1, ~val);
if (res<0) return res; //if (res<0) return res;
res = gpio_conf_by_index(dev, i, 1, val); res = gpio_conf_by_index(dev, i, 1, val);
if (res<0) return res; if (res<0) return res;
} }
...@@ -657,13 +665,6 @@ int gpio_10389_ctrl(struct device *dev, int value){ ...@@ -657,13 +665,6 @@ int gpio_10389_ctrl(struct device *dev, int value){
return 0; return 0;
} }
int gpio_shutdown(struct device *dev)
{
int gpio_shutdown_index=get_gpio_index_by_name("NSHUTDOWN");
if (gpio_shutdown_index<0) return gpio_shutdown_index;
return gpio_conf_by_index(dev, gpio_shutdown_index, 1, 0);
}
int por_ctrl(struct device *dev, int disable_por) int por_ctrl(struct device *dev, int disable_por)
{ {
int gpio_disable_por_index=get_gpio_index_by_name("DIS_POR"); int gpio_disable_por_index=get_gpio_index_by_name("DIS_POR");
...@@ -1227,7 +1228,11 @@ static int elphel393_pwr_probe(struct platform_device *pdev) ...@@ -1227,7 +1228,11 @@ static int elphel393_pwr_probe(struct platform_device *pdev)
clientdata->pwr_gpio[i].pin=base[i>>3]+(i & 7); clientdata->pwr_gpio[i].pin=base[i>>3]+(i & 7);
if (i<16) clientdata->pwr_gpio[i].dir=0; /* input */ if (i<16) clientdata->pwr_gpio[i].dir=0; /* input */
else clientdata->pwr_gpio[i].dir=1; /* output */ else clientdata->pwr_gpio[i].dir=1; /* output */
clientdata->pwr_gpio[i].out_val=0; //if (i<16) clientdata->pwr_gpio[i].out_val=0;
//else clientdata->pwr_gpio[i].out_val=1;
clientdata->pwr_gpio[i].out_val=0;
rc=gpio_request(clientdata->pwr_gpio[i].pin, clientdata->pwr_gpio[i].label); rc=gpio_request(clientdata->pwr_gpio[i].pin, clientdata->pwr_gpio[i].label);
if (rc<0){ if (rc<0){
dev_err(&pdev->dev," Failed to get GPIO[%d] with label %s\n",clientdata->pwr_gpio[i].pin,clientdata->pwr_gpio[i].label); dev_err(&pdev->dev," Failed to get GPIO[%d] with label %s\n",clientdata->pwr_gpio[i].pin,clientdata->pwr_gpio[i].label);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment