1. make menuconfig选择Device Drivers -->GPIO Support-->/sys/class/gpio/...

2. 打开kernel目录下的dirvers/gpio/gpiolib.c文件,把以下代码中的属性改为0777.

static /* const */ DEVICE_ATTR(direction, 0644,
  gpio_direction_show, gpio_direction_store);

static const DEVICE_ATTR(value, 0644,
  gpio_value_show, gpio_value_store);

static struct class_attribute gpio_class_attrs[] = {
 __ATTR(export, 0200, NULL, export_store),
 __ATTR(unexport, 0200, NULL, unexport_store),
 __ATTR_NULL,
};

3.使用jni调用产生的GPIO设备文件.