aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/ctrl.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /drivers/crypto/caam/ctrl.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto/caam/ctrl.c')
-rw-r--r--drivers/crypto/caam/ctrl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index dacb53fb690e..027e121c6f70 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -7,6 +7,7 @@
7#include <linux/device.h> 7#include <linux/device.h>
8#include <linux/of_address.h> 8#include <linux/of_address.h>
9#include <linux/of_irq.h> 9#include <linux/of_irq.h>
10#include <linux/sys_soc.h>
10 11
11#include "compat.h" 12#include "compat.h"
12#include "regs.h" 13#include "regs.h"
@@ -19,6 +20,8 @@ bool caam_little_end;
19EXPORT_SYMBOL(caam_little_end); 20EXPORT_SYMBOL(caam_little_end);
20bool caam_dpaa2; 21bool caam_dpaa2;
21EXPORT_SYMBOL(caam_dpaa2); 22EXPORT_SYMBOL(caam_dpaa2);
23bool caam_imx;
24EXPORT_SYMBOL(caam_imx);
22 25
23#ifdef CONFIG_CAAM_QI 26#ifdef CONFIG_CAAM_QI
24#include "qi.h" 27#include "qi.h"
@@ -28,19 +31,11 @@ EXPORT_SYMBOL(caam_dpaa2);
28 * i.MX targets tend to have clock control subsystems that can 31 * i.MX targets tend to have clock control subsystems that can
29 * enable/disable clocking to our device. 32 * enable/disable clocking to our device.
30 */ 33 */
31#ifdef CONFIG_CRYPTO_DEV_FSL_CAAM_IMX
32static inline struct clk *caam_drv_identify_clk(struct device *dev, 34static inline struct clk *caam_drv_identify_clk(struct device *dev,
33 char *clk_name) 35 char *clk_name)
34{ 36{
35 return devm_clk_get(dev, clk_name); 37 return caam_imx ? devm_clk_get(dev, clk_name) : NULL;
36} 38}
37#else
38static inline struct clk *caam_drv_identify_clk(struct device *dev,
39 char *clk_name)
40{
41 return NULL;
42}
43#endif
44 39
45/* 40/*
46 * Descriptor to instantiate RNG State Handle 0 in normal mode and 41 * Descriptor to instantiate RNG State Handle 0 in normal mode and
@@ -430,6 +425,10 @@ static int caam_probe(struct platform_device *pdev)
430{ 425{
431 int ret, ring, gen_sk, ent_delay = RTSDCTL_ENT_DLY_MIN; 426 int ret, ring, gen_sk, ent_delay = RTSDCTL_ENT_DLY_MIN;
432 u64 caam_id; 427 u64 caam_id;
428 static const struct soc_device_attribute imx_soc[] = {
429 {.family = "Freescale i.MX"},
430 {},
431 };
433 struct device *dev; 432 struct device *dev;
434 struct device_node *nprop, *np; 433 struct device_node *nprop, *np;
435 struct caam_ctrl __iomem *ctrl; 434 struct caam_ctrl __iomem *ctrl;
@@ -451,6 +450,8 @@ static int caam_probe(struct platform_device *pdev)
451 dev_set_drvdata(dev, ctrlpriv); 450 dev_set_drvdata(dev, ctrlpriv);
452 nprop = pdev->dev.of_node; 451 nprop = pdev->dev.of_node;
453 452
453 caam_imx = (bool)soc_device_match(imx_soc);
454
454 /* Enable clocking */ 455 /* Enable clocking */
455 clk = caam_drv_identify_clk(&pdev->dev, "ipg"); 456 clk = caam_drv_identify_clk(&pdev->dev, "ipg");
456 if (IS_ERR(clk)) { 457 if (IS_ERR(clk)) {