From f4ec907012bf3f02a66c6c9dcb39bef6b413b89f Mon Sep 17 00:00:00 2001 From: Berne Hebark Date: Thu, 8 Sep 2011 14:23:57 +0530 Subject: ux500: cryp/hash: Updated for both u8500 & u5500 cryp1 & hash1 updated to be compatible on both u8500 and u5500: - added to u5500_defconfig. - settings from devices.c to board-mop500.c & board-u5500.c. - dynamic driver registration in board-mop500.c & board-u5500.c. - added cryp1 to clock-db5500.c and renamed cryp to cryp0. - added function dbx500_add_platform_device_noirq to devices-common.c. - added cryp1 and hash1 inline functions to devices-common.h (dbx500_add_cryp1). - defines added to devices-db5500.h and devices-db8500.h. - u8500_cryp/hash changed to ux500_cryp/hash. - update to handle different value for CRYP_PERIPHERAL_ID2 between u8500 and u5500 (more info in ER336742). ST-Ericsson ID: 257104 ST-Ericsson Linux next: NA ST-Ericsson FOSS-OUT ID: Trivial Ref: Commit-id: Ibe72c72d8f9d781008164f1bf24ceafa82ac9083 Signed-off-by: Avinash A Change-Id: I08a8f71acb89be99cbf8b54390be569e2369c73b Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30437 Reviewed-by: Avinash A Tested-by: Avinash A --- arch/arm/mach-ux500/include/mach/crypto-ux500.h | 5 +- drivers/crypto/ux500/cryp/Makefile | 4 +- drivers/crypto/ux500/cryp/cryp.c | 27 +++++--- drivers/crypto/ux500/cryp/cryp_core.c | 83 ++++++++++++------------- drivers/crypto/ux500/cryp/cryp_p.h | 4 +- drivers/crypto/ux500/hash/Makefile | 4 +- drivers/crypto/ux500/hash/hash_core.c | 69 ++++++++++---------- 7 files changed, 104 insertions(+), 92 deletions(-) diff --git a/arch/arm/mach-ux500/include/mach/crypto-ux500.h b/arch/arm/mach-ux500/include/mach/crypto-ux500.h index 57da88398d5..9d1e1c52c13 100644 --- a/arch/arm/mach-ux500/include/mach/crypto-ux500.h +++ b/arch/arm/mach-ux500/include/mach/crypto-ux500.h @@ -6,11 +6,14 @@ */ #ifndef _CRYPTO_UX500_H #include -#include struct cryp_platform_data { struct stedma40_chan_cfg mem_to_engine; struct stedma40_chan_cfg engine_to_mem; }; +struct hash_platform_data { + struct stedma40_chan_cfg mem_to_engine; +}; + #endif diff --git a/drivers/crypto/ux500/cryp/Makefile b/drivers/crypto/ux500/cryp/Makefile index fd5e6df3861..e5d362a6f68 100644 --- a/drivers/crypto/ux500/cryp/Makefile +++ b/drivers/crypto/ux500/cryp/Makefile @@ -9,5 +9,5 @@ CFLAGS_cryp.o := -DDEBUG -O0 CFLAGS_cryp_irq.o := -DDEBUG -O0 endif -obj-$(CONFIG_CRYPTO_DEV_UX500_CRYP) += u8500_cryp.o -u8500_cryp-objs := cryp.o cryp_irq.o cryp_core.o +obj-$(CONFIG_CRYPTO_DEV_UX500_CRYP) += ux500_cryp.o +ux500_cryp-objs := cryp.o cryp_irq.o cryp_core.o diff --git a/drivers/crypto/ux500/cryp/cryp.c b/drivers/crypto/ux500/cryp/cryp.c index ae4fe318528..211200fed34 100644 --- a/drivers/crypto/ux500/cryp/cryp.c +++ b/drivers/crypto/ux500/cryp/cryp.c @@ -12,6 +12,8 @@ #include #include +#include + #include "cryp_p.h" #include "cryp.h" @@ -30,26 +32,33 @@ void cryp_wait_until_done(struct cryp_device_data *device_data) */ int cryp_check(struct cryp_device_data *device_data) { + int peripheralID2 = 0; + if (NULL == device_data) return -EINVAL; + if (cpu_is_u8500()) + peripheralID2 = CRYP_PERIPHERAL_ID2_DB8500; + else if (cpu_is_u5500()) + peripheralID2 = CRYP_PERIPHERAL_ID2_DB5500; + /* Check Peripheral and Pcell Id Register for CRYP */ if ((CRYP_PERIPHERAL_ID0 == - readl_relaxed(&device_data->base->periphId0)) + readl_relaxed(&device_data->base->periphId0)) && (CRYP_PERIPHERAL_ID1 == - readl_relaxed(&device_data->base->periphId1)) - && (CRYP_PERIPHERAL_ID2 == - readl_relaxed(&device_data->base->periphId2)) + readl_relaxed(&device_data->base->periphId1)) + && (peripheralID2 == + readl_relaxed(&device_data->base->periphId2)) && (CRYP_PERIPHERAL_ID3 == - readl_relaxed(&device_data->base->periphId3)) + readl_relaxed(&device_data->base->periphId3)) && (CRYP_PCELL_ID0 == - readl_relaxed(&device_data->base->pcellId0)) + readl_relaxed(&device_data->base->pcellId0)) && (CRYP_PCELL_ID1 == - readl_relaxed(&device_data->base->pcellId1)) + readl_relaxed(&device_data->base->pcellId1)) && (CRYP_PCELL_ID2 == - readl_relaxed(&device_data->base->pcellId2)) + readl_relaxed(&device_data->base->pcellId2)) && (CRYP_PCELL_ID3 == - readl_relaxed(&device_data->base->pcellId3))) { + readl_relaxed(&device_data->base->pcellId3))) { return 0; } diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index f0aed67f29a..5893abb57dc 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c @@ -33,7 +33,6 @@ #include #include -#include #include "cryp_p.h" #include "cryp.h" @@ -1194,13 +1193,14 @@ static int cryp_hw_calculate(struct cryp_ctx *ctx) } if (hw_crypt_noxts(ctx, device_data)) - pr_err("u8500_cryp:crypX: [%s]: hw_crypt_noxts() failed!", + dev_err(device_data->dev, "[%s]: hw_crypt_noxts() failed!", __func__); out: if (cryp_disable_power(device_data->dev, device_data, false)) dev_err(device_data->dev, "[%s]: " "cryp_disable_power() failed!", __func__); + /* Release the device */ spin_lock(&device_data->ctx_lock); device_data->current_ctx = NULL; @@ -1232,7 +1232,7 @@ static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1252,7 +1252,7 @@ static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1272,7 +1272,7 @@ static void des_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1292,7 +1292,7 @@ static void des_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1312,7 +1312,7 @@ static void des3_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1332,7 +1332,7 @@ static void des3_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in) ctx->datalen = ctx->blocksize; if (cryp_hw_calculate(ctx)) - pr_err("u8500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", + pr_err("ux500_cryp:crypX: [%s]: cryp_hw_calculate() failed!", __func__); } @@ -1605,7 +1605,7 @@ static int des3_cbc_decrypt(struct ablkcipher_request *areq) */ static struct crypto_alg aes_alg = { .cra_name = "aes", - .cra_driver_name = "aes-u8500", + .cra_driver_name = "aes-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_CIPHER, .cra_blocksize = AES_BLOCK_SIZE, @@ -1629,7 +1629,7 @@ static struct crypto_alg aes_alg = { */ static struct crypto_alg des_alg = { .cra_name = "des", - .cra_driver_name = "des-u8500", + .cra_driver_name = "des-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_CIPHER, .cra_blocksize = DES_BLOCK_SIZE, @@ -1653,7 +1653,7 @@ static struct crypto_alg des_alg = { */ static struct crypto_alg des3_alg = { .cra_name = "des3_ede", - .cra_driver_name = "des3_ede-u8500", + .cra_driver_name = "des3_ede-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_CIPHER, .cra_blocksize = DES3_EDE_BLOCK_SIZE, @@ -1677,7 +1677,7 @@ static struct crypto_alg des3_alg = { */ static struct crypto_alg aes_ecb_alg = { .cra_name = "ecb(aes)", - .cra_driver_name = "ecb-aes-u8500", + .cra_driver_name = "ecb-aes-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1703,7 +1703,7 @@ static struct crypto_alg aes_ecb_alg = { */ static struct crypto_alg aes_cbc_alg = { .cra_name = "cbc(aes)", - .cra_driver_name = "cbc-aes-u8500", + .cra_driver_name = "cbc-aes-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1730,7 +1730,7 @@ static struct crypto_alg aes_cbc_alg = { */ static struct crypto_alg aes_ctr_alg = { .cra_name = "ctr(aes)", - .cra_driver_name = "ctr-aes-u8500", + .cra_driver_name = "ctr-aes-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1757,7 +1757,7 @@ static struct crypto_alg aes_ctr_alg = { */ static struct crypto_alg des_ecb_alg = { .cra_name = "ecb(des)", - .cra_driver_name = "ecb-des-u8500", + .cra_driver_name = "ecb-des-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1783,7 +1783,7 @@ static struct crypto_alg des_ecb_alg = { */ static struct crypto_alg des_cbc_alg = { .cra_name = "cbc(des)", - .cra_driver_name = "cbc-des-u8500", + .cra_driver_name = "cbc-des-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1810,7 +1810,7 @@ static struct crypto_alg des_cbc_alg = { */ static struct crypto_alg des3_ecb_alg = { .cra_name = "ecb(des3_ede)", - .cra_driver_name = "ecb-des3_ede-u8500", + .cra_driver_name = "ecb-des3_ede-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1836,7 +1836,7 @@ static struct crypto_alg des3_ecb_alg = { */ static struct crypto_alg des3_cbc_alg = { .cra_name = "cbc(des3_ede)", - .cra_driver_name = "cbc-des3_ede-u8500", + .cra_driver_name = "cbc-des3_ede-ux500", .cra_priority = 100, .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, @@ -1859,9 +1859,9 @@ static struct crypto_alg des3_cbc_alg = { }; /** - * struct crypto_alg *u8500_cryp_algs[] - + * struct crypto_alg *ux500_cryp_algs[] - */ -static struct crypto_alg *u8500_cryp_algs[] = { +static struct crypto_alg *ux500_cryp_algs[] = { &aes_alg, &des_alg, &des3_alg, @@ -1885,19 +1885,19 @@ static int cryp_algs_register_all(void) pr_debug("[%s]", __func__); - for (i = 0; i < ARRAY_SIZE(u8500_cryp_algs); i++) { - ret = crypto_register_alg(u8500_cryp_algs[i]); + for (i = 0; i < ARRAY_SIZE(ux500_cryp_algs); i++) { + ret = crypto_register_alg(ux500_cryp_algs[i]); if (ret) { count = i; pr_err("[%s] alg registration failed", - u8500_cryp_algs[i]->cra_driver_name); + ux500_cryp_algs[i]->cra_driver_name); goto unreg; } } return 0; unreg: for (i = 0; i < count; i++) - crypto_unregister_alg(u8500_cryp_algs[i]); + crypto_unregister_alg(ux500_cryp_algs[i]); return ret; } @@ -1910,11 +1910,11 @@ static void cryp_algs_unregister_all(void) pr_debug(DEV_DBG_NAME " [%s]", __func__); - for (i = 0; i < ARRAY_SIZE(u8500_cryp_algs); i++) - crypto_unregister_alg(u8500_cryp_algs[i]); + for (i = 0; i < ARRAY_SIZE(ux500_cryp_algs); i++) + crypto_unregister_alg(ux500_cryp_algs[i]); } -static int u8500_cryp_probe(struct platform_device *pdev) +static int ux500_cryp_probe(struct platform_device *pdev) { int ret; int cryp_error = 0; @@ -2071,7 +2071,7 @@ out: return ret; } -static int u8500_cryp_remove(struct platform_device *pdev) +static int ux500_cryp_remove(struct platform_device *pdev) { struct resource *res = NULL; struct resource *res_irq = NULL; @@ -2137,7 +2137,7 @@ static int u8500_cryp_remove(struct platform_device *pdev) return 0; } -static void u8500_cryp_shutdown(struct platform_device *pdev) +static void ux500_cryp_shutdown(struct platform_device *pdev) { struct resource *res_irq = NULL; struct cryp_device_data *device_data; @@ -2190,7 +2190,7 @@ static void u8500_cryp_shutdown(struct platform_device *pdev) } -static int u8500_cryp_suspend(struct platform_device *pdev, pm_message_t state) +static int ux500_cryp_suspend(struct platform_device *pdev, pm_message_t state) { int ret; struct cryp_device_data *device_data; @@ -2234,7 +2234,7 @@ static int u8500_cryp_suspend(struct platform_device *pdev, pm_message_t state) return ret; } -static int u8500_cryp_resume(struct platform_device *pdev) +static int ux500_cryp_resume(struct platform_device *pdev) { int ret = 0; struct cryp_device_data *device_data; @@ -2274,40 +2274,39 @@ static int u8500_cryp_resume(struct platform_device *pdev) } static struct platform_driver cryp_driver = { - .probe = u8500_cryp_probe, - .remove = u8500_cryp_remove, - .shutdown = u8500_cryp_shutdown, - .suspend = u8500_cryp_suspend, - .resume = u8500_cryp_resume, + .probe = ux500_cryp_probe, + .remove = ux500_cryp_remove, + .shutdown = ux500_cryp_shutdown, + .suspend = ux500_cryp_suspend, + .resume = ux500_cryp_resume, .driver = { .owner = THIS_MODULE, .name = "cryp1" } }; -static int __init u8500_cryp_mod_init(void) +static int __init ux500_cryp_mod_init(void) { pr_debug("[%s] is called!", __func__); - klist_init(&driver_data.device_list, NULL, NULL); /* Initialize the semaphore to 0 devices (locked state) */ sema_init(&driver_data.device_allocation, 0); return platform_driver_register(&cryp_driver); } -static void __exit u8500_cryp_mod_fini(void) +static void __exit ux500_cryp_mod_fini(void) { pr_debug("[%s] is called!", __func__); platform_driver_unregister(&cryp_driver); return; } -module_init(u8500_cryp_mod_init); -module_exit(u8500_cryp_mod_fini); +module_init(ux500_cryp_mod_init); +module_exit(ux500_cryp_mod_fini); module_param(cryp_mode, int, 0); -MODULE_DESCRIPTION("Driver for ST-Ericsson U8500 CRYP crypto engine."); +MODULE_DESCRIPTION("Driver for ST-Ericsson UX500 CRYP crypto engine."); MODULE_ALIAS("aes-all"); MODULE_ALIAS("des-all"); diff --git a/drivers/crypto/ux500/cryp/cryp_p.h b/drivers/crypto/ux500/cryp/cryp_p.h index 4b615a33fe9..0e070829edc 100644 --- a/drivers/crypto/ux500/cryp/cryp_p.h +++ b/drivers/crypto/ux500/cryp/cryp_p.h @@ -39,7 +39,9 @@ */ #define CRYP_PERIPHERAL_ID0 0xE3 #define CRYP_PERIPHERAL_ID1 0x05 -#define CRYP_PERIPHERAL_ID2 0x28 + +#define CRYP_PERIPHERAL_ID2_DB8500 0x28 +#define CRYP_PERIPHERAL_ID2_DB5500 0x29 #define CRYP_PERIPHERAL_ID3 0x00 #define CRYP_PCELL_ID0 0x0D diff --git a/drivers/crypto/ux500/hash/Makefile b/drivers/crypto/ux500/hash/Makefile index aaa5f56a2c2..b2f90d9bac7 100644 --- a/drivers/crypto/ux500/hash/Makefile +++ b/drivers/crypto/ux500/hash/Makefile @@ -7,5 +7,5 @@ ifdef CONFIG_CRYPTO_DEV_UX500_DEBUG CFLAGS_hash_core.o := -DDEBUG -O0 endif -obj-$(CONFIG_CRYPTO_DEV_UX500_HASH) += u8500_hash.o -u8500_hash-objs := hash_core.o +obj-$(CONFIG_CRYPTO_DEV_UX500_HASH) += ux500_hash.o +ux500_hash-objs := hash_core.o diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index b042808496c..ce2c9d645fa 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1337,7 +1337,7 @@ static struct ahash_alg ahash_sha1_alg = { .halg.statesize = sizeof(struct hash_ctx), .halg.base = { .cra_name = "sha1", - .cra_driver_name = "sha1-u8500", + .cra_driver_name = "sha1-ux500", .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct hash_ctx), @@ -1354,7 +1354,7 @@ static struct ahash_alg ahash_sha256_alg = { .halg.statesize = sizeof(struct hash_ctx), .halg.base = { .cra_name = "sha256", - .cra_driver_name = "sha256-u8500", + .cra_driver_name = "sha256-ux500", .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct hash_ctx), @@ -1373,7 +1373,7 @@ static struct ahash_alg hmac_sha1_alg = { .halg.statesize = sizeof(struct hash_ctx), .halg.base = { .cra_name = "hmac(sha1)", - .cra_driver_name = "hmac-sha1-u8500", + .cra_driver_name = "hmac-sha1-ux500", .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC, .cra_blocksize = SHA1_BLOCK_SIZE, .cra_ctxsize = sizeof(struct hash_ctx), @@ -1392,7 +1392,7 @@ static struct ahash_alg hmac_sha256_alg = { .halg.statesize = sizeof(struct hash_ctx), .halg.base = { .cra_name = "hmac(sha256)", - .cra_driver_name = "hmac-sha256-u8500", + .cra_driver_name = "hmac-sha256-ux500", .cra_flags = CRYPTO_ALG_TYPE_AHASH | CRYPTO_ALG_ASYNC, .cra_blocksize = SHA256_BLOCK_SIZE, .cra_ctxsize = sizeof(struct hash_ctx), @@ -1402,9 +1402,9 @@ static struct ahash_alg hmac_sha256_alg = { }; /** - * struct hash_alg *u8500_hash_algs[] - + * struct hash_alg *ux500_hash_algs[] - */ -static struct ahash_alg *u8500_ahash_algs[] = { +static struct ahash_alg *ux500_ahash_algs[] = { &ahash_sha1_alg, &ahash_sha256_alg, &hmac_sha1_alg, @@ -1422,20 +1422,20 @@ static int ahash_algs_register_all(struct hash_device_data *device_data) dev_dbg(device_data->dev, "[%s]", __func__); - for (i = 0; i < ARRAY_SIZE(u8500_ahash_algs); i++) { - ret = crypto_register_ahash(u8500_ahash_algs[i]); + for (i = 0; i < ARRAY_SIZE(ux500_ahash_algs); i++) { + ret = crypto_register_ahash(ux500_ahash_algs[i]); if (ret) { count = i; dev_err(device_data->dev, "[%s] alg registration" " failed", - u8500_ahash_algs[i]->halg.base.cra_driver_name); + ux500_ahash_algs[i]->halg.base.cra_driver_name); goto unreg; } } return 0; unreg: for (i = 0; i < count; i++) - crypto_unregister_ahash(u8500_ahash_algs[i]); + crypto_unregister_ahash(ux500_ahash_algs[i]); return ret; } @@ -1448,15 +1448,15 @@ static void ahash_algs_unregister_all(struct hash_device_data *device_data) dev_dbg(device_data->dev, "[%s]", __func__); - for (i = 0; i < ARRAY_SIZE(u8500_ahash_algs); i++) - crypto_unregister_ahash(u8500_ahash_algs[i]); + for (i = 0; i < ARRAY_SIZE(ux500_ahash_algs); i++) + crypto_unregister_ahash(ux500_ahash_algs[i]); } /** - * u8500_hash_probe - Function that probes the hash hardware. + * ux500_hash_probe - Function that probes the hash hardware. * @pdev: The platform device. */ -static int u8500_hash_probe(struct platform_device *pdev) +static int ux500_hash_probe(struct platform_device *pdev) { int ret = 0; struct resource *res = NULL; @@ -1571,10 +1571,10 @@ out: } /** - * u8500_hash_remove - Function that removes the hash device from the platform. + * ux500_hash_remove - Function that removes the hash device from the platform. * @pdev: The platform device. */ -static int u8500_hash_remove(struct platform_device *pdev) +static int ux500_hash_remove(struct platform_device *pdev) { struct resource *res; struct hash_device_data *device_data; @@ -1633,10 +1633,10 @@ static int u8500_hash_remove(struct platform_device *pdev) } /** - * u8500_hash_shutdown - Function that shutdown the hash device. + * ux500_hash_shutdown - Function that shutdown the hash device. * @pdev: The platform device */ -static void u8500_hash_shutdown(struct platform_device *pdev) +static void ux500_hash_shutdown(struct platform_device *pdev) { struct resource *res = NULL; struct hash_device_data *device_data; @@ -1686,11 +1686,11 @@ static void u8500_hash_shutdown(struct platform_device *pdev) } /** - * u8500_hash_suspend - Function that suspends the hash device. + * ux500_hash_suspend - Function that suspends the hash device. * @pdev: The platform device. * @state: - */ -static int u8500_hash_suspend(struct platform_device *pdev, pm_message_t state) +static int ux500_hash_suspend(struct platform_device *pdev, pm_message_t state) { int ret; struct hash_device_data *device_data; @@ -1726,10 +1726,10 @@ static int u8500_hash_suspend(struct platform_device *pdev, pm_message_t state) } /** - * u8500_hash_resume - Function that resume the hash device. + * ux500_hash_resume - Function that resume the hash device. * @pdev: The platform device. */ -static int u8500_hash_resume(struct platform_device *pdev) +static int ux500_hash_resume(struct platform_device *pdev) { int ret = 0; struct hash_device_data *device_data; @@ -1762,11 +1762,11 @@ static int u8500_hash_resume(struct platform_device *pdev) } static struct platform_driver hash_driver = { - .probe = u8500_hash_probe, - .remove = u8500_hash_remove, - .shutdown = u8500_hash_shutdown, - .suspend = u8500_hash_suspend, - .resume = u8500_hash_resume, + .probe = ux500_hash_probe, + .remove = ux500_hash_remove, + .shutdown = ux500_hash_shutdown, + .suspend = ux500_hash_suspend, + .resume = ux500_hash_resume, .driver = { .owner = THIS_MODULE, .name = "hash1", @@ -1774,12 +1774,11 @@ static struct platform_driver hash_driver = { }; /** - * u8500_hash_mod_init - The kernel module init function. + * ux500_hash_mod_init - The kernel module init function. */ -static int __init u8500_hash_mod_init(void) +static int __init ux500_hash_mod_init(void) { pr_debug(DEV_DBG_NAME " [%s] is called!", __func__); - klist_init(&driver_data.device_list, NULL, NULL); /* Initialize the semaphore to 0 devices (locked state) */ sema_init(&driver_data.device_allocation, 0); @@ -1788,9 +1787,9 @@ static int __init u8500_hash_mod_init(void) } /** - * u8500_hash_mod_fini - The kernel module exit function. + * ux500_hash_mod_fini - The kernel module exit function. */ -static void __exit u8500_hash_mod_fini(void) +static void __exit ux500_hash_mod_fini(void) { pr_debug(DEV_DBG_NAME " [%s] is called!", __func__); @@ -1798,10 +1797,10 @@ static void __exit u8500_hash_mod_fini(void) return; } -module_init(u8500_hash_mod_init); -module_exit(u8500_hash_mod_fini); +module_init(ux500_hash_mod_init); +module_exit(ux500_hash_mod_fini); -MODULE_DESCRIPTION("Driver for ST-Ericsson U8500 HASH engine."); +MODULE_DESCRIPTION("Driver for ST-Ericsson UX500 HASH engine."); MODULE_LICENSE("GPL"); MODULE_ALIAS("sha1-all"); -- cgit v1.2.3