I assume that you are using a PSoC 4 device in your application. Please correct if I'm wrong.
We do not have direct APIs to switch between LIN and SPI mode. Although you can switch between SPI to I2C/ UART by using unconfigured SCB mode of the SCB component. You can not switch to LIN mode using this method and hence may not be suitable for your application.
In PSoC 4 devices, it is possible to configure the SCB block as an SPI interface (without using an SPI component from the Top design) by using direct register writes. The steps to configure the SCB block as an SPI interface using register writes in detailed in the architecture TRM. See section Enabling and Initializing SPI section. Detailed explanation of the registers can be found in the respective register TRM.
If you find it difficult to do direct register writes using TRM as reference, you can drag and drop the SPI component and use the generated source to see the right sequence to configure the registers. Make sure to disable the component after you have finished porting the code.
After the SPI functionality is over, reset all the registers and use the LIN component generated APIs (from Top design) to use the SCB block as LIN interface.
As Bradadeesh pointed out it depends on which PSoC type you are using.
For PSoCs that use SCBs (Serial Communication Blocks), switching between SPI and UART is possible.
This applies to many PSoC4s and PSoC6s. The component should list "SCB" in the name or description.
If you are using PSoC3 or PSoC5, UARTs and SPIs are 'custom' built using UDB blocks. Once the UART or SPI is configured in the TopDesign at design-time, the UDB blocks are programmed for that type of comm component. Although it is possible to change the UDB blocks at run-time, it is not practical or easy to perform.
With the UDB-style component, you can create BOTH a SPI and a UART and including routing logic so that you can switch between the two in SW.