@@ -516,47 +516,108 @@ int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
516516EXPORT_SYMBOL_GPL (zynqmp_pm_clock_getparent );
517517
518518/**
519- * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not
520- * @ioctl_id: IOCTL ID
519+ * zynqmp_pm_set_pll_frac_mode() - PM API for set PLL mode
521520 *
522- * Return: 1 if IOCTL is valid else 0
521+ * @clk_id: PLL clock ID
522+ * @mode: PLL mode (PLL_MODE_FRAC/PLL_MODE_INT)
523+ *
524+ * This function sets PLL mode
525+ *
526+ * Return: Returns status, either success or error+reason
523527 */
524- static inline int zynqmp_is_valid_ioctl (u32 ioctl_id )
528+ int zynqmp_pm_set_pll_frac_mode (u32 clk_id , u32 mode )
525529{
526- switch (ioctl_id ) {
527- case IOCTL_SD_DLL_RESET :
528- case IOCTL_SET_SD_TAPDELAY :
529- case IOCTL_SET_PLL_FRAC_MODE :
530- case IOCTL_GET_PLL_FRAC_MODE :
531- case IOCTL_SET_PLL_FRAC_DATA :
532- case IOCTL_GET_PLL_FRAC_DATA :
533- return 1 ;
534- default :
535- return 0 ;
536- }
530+ return zynqmp_pm_invoke_fn (PM_IOCTL , 0 , IOCTL_SET_PLL_FRAC_MODE ,
531+ clk_id , mode , NULL );
537532}
533+ EXPORT_SYMBOL_GPL (zynqmp_pm_set_pll_frac_mode );
538534
539535/**
540- * zynqmp_pm_ioctl() - PM IOCTL API for device control and configs
541- * @node_id: Node ID of the device
542- * @ioctl_id: ID of the requested IOCTL
543- * @arg1: Argument 1 to requested IOCTL call
544- * @arg2: Argument 2 to requested IOCTL call
545- * @out: Returned output value
536+ * zynqmp_pm_get_pll_frac_mode() - PM API for get PLL mode
537+ *
538+ * @clk_id: PLL clock ID
539+ * @mode: PLL mode
546540 *
547- * This function calls IOCTL to firmware for device control and configuration.
541+ * This function return current PLL mode
548542 *
549543 * Return: Returns status, either success or error+reason
550544 */
551- static int zynqmp_pm_ioctl (u32 node_id , u32 ioctl_id , u32 arg1 , u32 arg2 ,
552- u32 * out )
545+ int zynqmp_pm_get_pll_frac_mode (u32 clk_id , u32 * mode )
553546{
554- if (!zynqmp_is_valid_ioctl (ioctl_id ))
555- return - EINVAL ;
547+ return zynqmp_pm_invoke_fn (PM_IOCTL , 0 , IOCTL_GET_PLL_FRAC_MODE ,
548+ clk_id , 0 , mode );
549+ }
550+ EXPORT_SYMBOL_GPL (zynqmp_pm_get_pll_frac_mode );
551+
552+ /**
553+ * zynqmp_pm_set_pll_frac_data() - PM API for setting pll fraction data
554+ *
555+ * @clk_id: PLL clock ID
556+ * @data: fraction data
557+ *
558+ * This function sets fraction data.
559+ * It is valid for fraction mode only.
560+ *
561+ * Return: Returns status, either success or error+reason
562+ */
563+ int zynqmp_pm_set_pll_frac_data (u32 clk_id , u32 data )
564+ {
565+ return zynqmp_pm_invoke_fn (PM_IOCTL , 0 , IOCTL_SET_PLL_FRAC_DATA ,
566+ clk_id , data , NULL );
567+ }
568+ EXPORT_SYMBOL_GPL (zynqmp_pm_set_pll_frac_data );
569+
570+ /**
571+ * zynqmp_pm_get_pll_frac_data() - PM API for getting pll fraction data
572+ *
573+ * @clk_id: PLL clock ID
574+ * @data: fraction data
575+ *
576+ * This function returns fraction data value.
577+ *
578+ * Return: Returns status, either success or error+reason
579+ */
580+ int zynqmp_pm_get_pll_frac_data (u32 clk_id , u32 * data )
581+ {
582+ return zynqmp_pm_invoke_fn (PM_IOCTL , 0 , IOCTL_GET_PLL_FRAC_DATA ,
583+ clk_id , 0 , data );
584+ }
585+ EXPORT_SYMBOL_GPL (zynqmp_pm_get_pll_frac_data );
556586
557- return zynqmp_pm_invoke_fn (PM_IOCTL , node_id , ioctl_id ,
558- arg1 , arg2 , out );
587+ /**
588+ * zynqmp_pm_set_sd_tapdelay() - Set tap delay for the SD device
589+ *
590+ * @node_id Node ID of the device
591+ * @type Type of tap delay to set (input/output)
592+ * @value Value to set fot the tap delay
593+ *
594+ * This function sets input/output tap delay for the SD device.
595+ *
596+ * @return Returns status, either success or error+reason
597+ */
598+ int zynqmp_pm_set_sd_tapdelay (u32 node_id , u32 type , u32 value )
599+ {
600+ return zynqmp_pm_invoke_fn (PM_IOCTL , node_id , IOCTL_SET_SD_TAPDELAY ,
601+ type , value , NULL );
602+ }
603+ EXPORT_SYMBOL_GPL (zynqmp_pm_set_sd_tapdelay );
604+
605+ /**
606+ * zynqmp_pm_sd_dll_reset() - Reset DLL logic
607+ *
608+ * @node_id Node ID of the device
609+ * @type Reset type
610+ *
611+ * This function resets DLL logic for the SD device.
612+ *
613+ * @return Returns status, either success or error+reason
614+ */
615+ int zynqmp_pm_sd_dll_reset (u32 node_id , u32 type )
616+ {
617+ return zynqmp_pm_invoke_fn (PM_IOCTL , node_id , IOCTL_SET_SD_TAPDELAY ,
618+ type , 0 , NULL );
559619}
620+ EXPORT_SYMBOL_GPL (zynqmp_pm_sd_dll_reset );
560621
561622/**
562623 * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release)
@@ -746,7 +807,6 @@ static int zynqmp_pm_aes_engine(const u64 address, u32 *out)
746807}
747808
748809static const struct zynqmp_eemi_ops eemi_ops = {
749- .ioctl = zynqmp_pm_ioctl ,
750810 .reset_assert = zynqmp_pm_reset_assert ,
751811 .reset_get_status = zynqmp_pm_reset_get_status ,
752812 .init_finalize = zynqmp_pm_init_finalize ,
0 commit comments