diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-12-13 10:48:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2011-12-23 11:03:15 -0500 |
commit | 0ef7e206d6a5a5de0cd84ed4925a4f688c62e732 (patch) | |
tree | 784f0e4216e361740e862a403a1888ee15ca4928 | |
parent | 4e82786f7039cb707c031dcf0dc84c025e149487 (diff) |
mtd: gpmi-nand: move to dma_transfer_direction
This patch fixes usage of dma direction to adopt dma_transfer_direction.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
-rw-r--r-- | drivers/mtd/nand/gpmi-nand/gpmi-lib.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c index de4db7604a3f..c4c4d6d89cd5 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c | |||
@@ -827,7 +827,7 @@ int gpmi_send_command(struct gpmi_nand_data *this) | |||
827 | pio[1] = pio[2] = 0; | 827 | pio[1] = pio[2] = 0; |
828 | desc = channel->device->device_prep_slave_sg(channel, | 828 | desc = channel->device->device_prep_slave_sg(channel, |
829 | (struct scatterlist *)pio, | 829 | (struct scatterlist *)pio, |
830 | ARRAY_SIZE(pio), DMA_NONE, 0); | 830 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
831 | if (!desc) { | 831 | if (!desc) { |
832 | pr_err("step 1 error\n"); | 832 | pr_err("step 1 error\n"); |
833 | return -1; | 833 | return -1; |
@@ -839,7 +839,7 @@ int gpmi_send_command(struct gpmi_nand_data *this) | |||
839 | sg_init_one(sgl, this->cmd_buffer, this->command_length); | 839 | sg_init_one(sgl, this->cmd_buffer, this->command_length); |
840 | dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); | 840 | dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE); |
841 | desc = channel->device->device_prep_slave_sg(channel, | 841 | desc = channel->device->device_prep_slave_sg(channel, |
842 | sgl, 1, DMA_TO_DEVICE, 1); | 842 | sgl, 1, DMA_MEM_TO_DEV, 1); |
843 | if (!desc) { | 843 | if (!desc) { |
844 | pr_err("step 2 error\n"); | 844 | pr_err("step 2 error\n"); |
845 | return -1; | 845 | return -1; |
@@ -872,7 +872,7 @@ int gpmi_send_data(struct gpmi_nand_data *this) | |||
872 | pio[1] = 0; | 872 | pio[1] = 0; |
873 | desc = channel->device->device_prep_slave_sg(channel, | 873 | desc = channel->device->device_prep_slave_sg(channel, |
874 | (struct scatterlist *)pio, | 874 | (struct scatterlist *)pio, |
875 | ARRAY_SIZE(pio), DMA_NONE, 0); | 875 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
876 | if (!desc) { | 876 | if (!desc) { |
877 | pr_err("step 1 error\n"); | 877 | pr_err("step 1 error\n"); |
878 | return -1; | 878 | return -1; |
@@ -881,7 +881,7 @@ int gpmi_send_data(struct gpmi_nand_data *this) | |||
881 | /* [2] send DMA request */ | 881 | /* [2] send DMA request */ |
882 | prepare_data_dma(this, DMA_TO_DEVICE); | 882 | prepare_data_dma(this, DMA_TO_DEVICE); |
883 | desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, | 883 | desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, |
884 | 1, DMA_TO_DEVICE, 1); | 884 | 1, DMA_MEM_TO_DEV, 1); |
885 | if (!desc) { | 885 | if (!desc) { |
886 | pr_err("step 2 error\n"); | 886 | pr_err("step 2 error\n"); |
887 | return -1; | 887 | return -1; |
@@ -908,7 +908,7 @@ int gpmi_read_data(struct gpmi_nand_data *this) | |||
908 | pio[1] = 0; | 908 | pio[1] = 0; |
909 | desc = channel->device->device_prep_slave_sg(channel, | 909 | desc = channel->device->device_prep_slave_sg(channel, |
910 | (struct scatterlist *)pio, | 910 | (struct scatterlist *)pio, |
911 | ARRAY_SIZE(pio), DMA_NONE, 0); | 911 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
912 | if (!desc) { | 912 | if (!desc) { |
913 | pr_err("step 1 error\n"); | 913 | pr_err("step 1 error\n"); |
914 | return -1; | 914 | return -1; |
@@ -917,7 +917,7 @@ int gpmi_read_data(struct gpmi_nand_data *this) | |||
917 | /* [2] : send DMA request */ | 917 | /* [2] : send DMA request */ |
918 | prepare_data_dma(this, DMA_FROM_DEVICE); | 918 | prepare_data_dma(this, DMA_FROM_DEVICE); |
919 | desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, | 919 | desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl, |
920 | 1, DMA_FROM_DEVICE, 1); | 920 | 1, DMA_DEV_TO_MEM, 1); |
921 | if (!desc) { | 921 | if (!desc) { |
922 | pr_err("step 2 error\n"); | 922 | pr_err("step 2 error\n"); |
923 | return -1; | 923 | return -1; |
@@ -964,7 +964,7 @@ int gpmi_send_page(struct gpmi_nand_data *this, | |||
964 | 964 | ||
965 | desc = channel->device->device_prep_slave_sg(channel, | 965 | desc = channel->device->device_prep_slave_sg(channel, |
966 | (struct scatterlist *)pio, | 966 | (struct scatterlist *)pio, |
967 | ARRAY_SIZE(pio), DMA_NONE, 0); | 967 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 0); |
968 | if (!desc) { | 968 | if (!desc) { |
969 | pr_err("step 2 error\n"); | 969 | pr_err("step 2 error\n"); |
970 | return -1; | 970 | return -1; |
@@ -998,7 +998,8 @@ int gpmi_read_page(struct gpmi_nand_data *this, | |||
998 | | BF_GPMI_CTRL0_XFER_COUNT(0); | 998 | | BF_GPMI_CTRL0_XFER_COUNT(0); |
999 | pio[1] = 0; | 999 | pio[1] = 0; |
1000 | desc = channel->device->device_prep_slave_sg(channel, | 1000 | desc = channel->device->device_prep_slave_sg(channel, |
1001 | (struct scatterlist *)pio, 2, DMA_NONE, 0); | 1001 | (struct scatterlist *)pio, 2, |
1002 | DMA_TRANS_NONE, 0); | ||
1002 | if (!desc) { | 1003 | if (!desc) { |
1003 | pr_err("step 1 error\n"); | 1004 | pr_err("step 1 error\n"); |
1004 | return -1; | 1005 | return -1; |
@@ -1027,7 +1028,7 @@ int gpmi_read_page(struct gpmi_nand_data *this, | |||
1027 | pio[5] = auxiliary; | 1028 | pio[5] = auxiliary; |
1028 | desc = channel->device->device_prep_slave_sg(channel, | 1029 | desc = channel->device->device_prep_slave_sg(channel, |
1029 | (struct scatterlist *)pio, | 1030 | (struct scatterlist *)pio, |
1030 | ARRAY_SIZE(pio), DMA_NONE, 1); | 1031 | ARRAY_SIZE(pio), DMA_TRANS_NONE, 1); |
1031 | if (!desc) { | 1032 | if (!desc) { |
1032 | pr_err("step 2 error\n"); | 1033 | pr_err("step 2 error\n"); |
1033 | return -1; | 1034 | return -1; |
@@ -1045,7 +1046,8 @@ int gpmi_read_page(struct gpmi_nand_data *this, | |||
1045 | | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size); | 1046 | | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size); |
1046 | pio[1] = 0; | 1047 | pio[1] = 0; |
1047 | desc = channel->device->device_prep_slave_sg(channel, | 1048 | desc = channel->device->device_prep_slave_sg(channel, |
1048 | (struct scatterlist *)pio, 2, DMA_NONE, 1); | 1049 | (struct scatterlist *)pio, 2, |
1050 | DMA_TRANS_NONE, 1); | ||
1049 | if (!desc) { | 1051 | if (!desc) { |
1050 | pr_err("step 3 error\n"); | 1052 | pr_err("step 3 error\n"); |
1051 | return -1; | 1053 | return -1; |